Skip to content

Skip untestable files in new_pr_handler and close PR#2317

Merged
hiroshinishio merged 1 commit intomainfrom
wes
Feb 24, 2026
Merged

Skip untestable files in new_pr_handler and close PR#2317
hiroshinishio merged 1 commit intomainfrom
wes

Conversation

@hiroshinishio
Copy link
Collaborator

Summary

  • When the dashboard or schedule triggers a coverage PR for a file with no testable code (e.g. __init__.py with only a docstring), the agent now checks should_skip_test() before proceeding
  • If the file has no testable code, the PR is closed with an explanation instead of wasting agent tokens on meaningless tests
  • Also added explicit handling for single-line module docstrings in should_skip_python

Root cause

The dashboard allows users to select any file from the coverage table for test generation. Files like __init__.py that only contain a docstring pass is_source_file() (because .py extension) and enter the coverage DB. The agent then writes trivial tests like test_package_is_importable that add no value.

Related finding

GA's restrict_edit_to_target_test_file_only=True policy prevents it from fixing implementation bugs it discovers. In joeHeld/Unit-Testing-Demo, GA found 4 bugs in logic.py but couldn't fix them - so it wrote tests matching the buggy behavior instead. Worth discussing whether coverage PRs should allow impl fixes when bugs are found.

@hiroshinishio hiroshinishio self-assigned this Feb 24, 2026
@hiroshinishio hiroshinishio merged commit f243ef9 into main Feb 24, 2026
1 check passed
@hiroshinishio hiroshinishio deleted the wes branch February 24, 2026 04:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant