Skip to content

Tighten test-scope guidance: test only what the PR changes#68502

Merged
shahar1 merged 2 commits into
apache:mainfrom
shahar1:docs/test-scope-guidance
Jun 15, 2026
Merged

Tighten test-scope guidance: test only what the PR changes#68502
shahar1 merged 2 commits into
apache:mainfrom
shahar1:docs/test-scope-guidance

Conversation

@shahar1

@shahar1 shahar1 commented Jun 13, 2026

Copy link
Copy Markdown
Contributor

Human Summary

I've noticed that AI generated PRs often introduce a lot of unit tests.
In the past (pre-AI), I used to think that having a lot of unit tests is better than having less.
However, it now becomes a burden both for human-reviewing + it overloads the CI.
The idea is that unit tests will reach exactly 100% coverage (no more, no less) - exception is given when we test an integration/behavior, which requires exceeding this limit by nature.

AI Summary

Click here

Tests should be scoped to new behavior introduced by the PR — not to
pre-existing logic that was already there before the PR, and not to
standard-library or third-party functions. A test that passes without
the PR's change is padding, not coverage.

This adds that rule to two places:

  • AGENTS.md (Testing Standards) — so agents and contributors know
    the expectation when writing tests
  • .github/instructions/code-review.instructions.md (Testing
    Requirements) — so reviewers flag over-coverage during code review

Was generative AI tooling used to co-author this PR?
  • Yes — Claude Code (Sonnet 4.6)

Generated-by: Claude Code (Sonnet 4.6) following the guidelines

Add an explicit rule to the Testing Standards and the code-review
checklist clarifying that tests must be scoped to new behavior
introduced by the PR. Pre-existing logic and standard-library
functions are not ours to cover; tests that pass without the PR's
change are padding, not coverage.
Previous phrasing only covered the "no more" direction. Rewrite to
make both sides explicit: every changed behaviour must have a test
that fails without the PR's change, and tests for pre-existing logic
or stdlib are padding. Also surface the integration-test exception.
@shahar1 shahar1 marked this pull request as ready for review June 13, 2026 09:21
@shahar1 shahar1 merged commit 6963783 into apache:main Jun 15, 2026
122 checks passed
pgagnon pushed a commit to pgagnon/airflow that referenced this pull request Jun 15, 2026
imrichardwu pushed a commit to imrichardwu/airflow that referenced this pull request Jun 16, 2026
dingo4dev pushed a commit to dingo4dev/airflow that referenced this pull request Jun 16, 2026
RulerChen pushed a commit to RulerChen/airflow that referenced this pull request Jun 16, 2026
@shahar1 shahar1 mentioned this pull request Jun 19, 2026
1 task
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants