Lokasi ngalangkungan proxy:   [ UP ]  
[Ngawartoskeun bug]   [Panyetelan cookie]                
Skip to content

Select tests that reach changed code through helpers and module objects (0.261.530) - #2019

Merged
Paul Lizer (paullizer) merged 2 commits into
microsoft:Developmentfrom
paullizer:claude/select-tests-helper-paths
Dec 2, 2026
Merged

Paul Lizer (paullizer) merged 2 commits into
microsoft:Developmentfrom
paullizer:claude/select-tests-helper-paths

Conversation

@paullizer

Copy link
Copy Markdown
Collaborator

What happened

The pull request for 0.261.524 changed the orchestration planner's prompt, plan_request, discover_result_aliases, the plan schema and the relational calculation code. scripts/select_tests.py chose 363 of 2,043 test files, and none of six files the change broke: five golden tests that pin the planner's prompt and payload byte for byte, and test_orchestration_workflow_results_aliases.py. CI passed without running them.

Why they were missed

Path In the missed tests Why it was not followed
A name used on a module object The golden tests load the planner with import_module and call planner.plan_request(...) A changed name counted only when no dot stood before it
A module reached through helper code The alias test builds a HarnessEnvironment from test_support, which loads functions_orchestration_services, and calls env.service_bindings.discover_result_aliases(...). It never names the module Only the test's own text was read
A changed name used inside its own module plan_request reaches PLANNER_PROMPT_SECTIONS through two other planner functions Only definitions whose own source differed counted as changed

The third did not cause the miss on that pull request, because plan_request itself changed. It is the path a prompt-only edit takes: the selector chose 3 files for one and none of the golden tests.

What changes

  • Inside a changed module, the definitions that use a changed name are affected with it, at any depth. The same in each importer.
  • Between application modules, import x as y then y.name, and from x import name as other, count as uses of name.
  • In a test's own text, a changed name counts alone or after a dot.
  • A test depends on the helper code it imports from other test files and from test_support: those definitions, what they use in their own file, what they import in turn, and the module-level code on the way. Helper code is followed by definition, so importing one fixture from a large test file does not pull in the file.
  • In helper code a name counts when Python resolves it (identifier, attribute, imported name, a string that is exactly the name), not when it stands in a comment, docstring or longer string.

Every file selected before is still selected.

Cost

Change Before Now
The four modules of the 0.261.524 pull request, name by name 123, none of the six 431, all six
That whole pull request 363 1,726
That pull request without its one changed logging constant 363 705
A planner prompt edit alone 3 274, the five golden tests
A version bump alone 245 401
A planner prompt edit with its version bump 247 474

Over the 25 pull requests merged up to 0.261.525 (one ran everything): the median of the other 24 goes from 300 to 454 files and the mean from 416 to 766. Thirteen small ones go from 251–312 to 407–454, four from 272–450 to 500–648, and seven that changed widely used code from 349–1,278 to 1,229–1,726.

A typical planner change runs five jobs of about 100 files instead of three. CI time itself was not measured.

Two things account for the growth: the version bump is now followed into the functions that write the version into what they produce and their callers (about 155 files on every pull request), and a change to anything log_event or get_settings reads now reaches nearly every module.

How many tests depend on the application in these ways

Of 2,043 test files, 769 use at least one name of a module only as object.name, and 1,006 reach at least one application module only through helper code (751 without the version helper). 1,258 do one or the other.

For the reviewer

  • The version floor helper is not followed on a version bump. test_support/versioning.py reads VERSION with a regular expression, which is not a name the helper resolves, so a bump does not select the roughly 830 files that only call assert_app_version_at_least. Following it would add them to every pull request. test_selector_does_not_follow_the_version_floor_helper_on_a_version_bump fails if the helper starts importing config.
  • The version bump still adds about 155 files to every pull request. Leaving VERSION out of propagation would be a rule about one name; this change does not add one.
  • Not fixed here: a changed decorator on a top-level function is not seen as a change to that function when other names in the module changed too. It is listed under Limits in FUNCTIONAL_TEST_SELECTION.md.
  • Version 0.261.530: Development is at 0.261.527 and two open pull requests use 0.261.528.

Tests

functional_tests/test_functional_suite_ci_runner.py has four new tests. Three run the selector on a small application and test suite written to a temporary folder, one path each; the selector before this change selects none of the expected files there. The fourth checks that a change to PLANNER_PROMPT_SECTIONS and to discover_result_aliases selects the six files in this repository.

Run locally: the 15 tests in that file and the three docs integrity files pass (21 passed, 2 skipped). This pull request changes scripts/select_tests.py, so its own CI runs every test file.

Documents: docs/explanation/fixes/FUNCTIONAL_TEST_SELECTION_INDIRECT_DEPENDENCIES_FIX.md, docs/explanation/features/FUNCTIONAL_TEST_SELECTION.md, docs/contributing/testing.md, release notes for 0.261.530.

🤖 Generated with Claude Code

…and same-module uses (0.261.530)

The pull request for 0.261.524 changed the orchestration planner's prompt and
discover_result_aliases, and passed CI without running six test files it broke.
select_tests.py did not select them, for three reasons:

- The five golden tests call planner.plan_request() on a module from
  import_module. A changed name counted only when no dot stood before it.
- The alias test reaches functions_orchestration_services through
  HarnessEnvironment in test_support and never names the module. Only a test's
  own text was read.
- A changed name was not followed into the definitions of its own module that
  use it, so a prompt-only edit selected 3 files and none of the goldens.

The selector now follows all three, and the same two forms between application
modules (import x as y; from x import name as other). Helper code is followed
by definition, and a name counts there only when Python resolves it, so a
version bump does not select the files that only check a version floor.

Every file selected before is still selected. Over the last 24 pull requests
the median selection goes from 300 to 454 files and the mean from 416 to 766.

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
The composer's Send button gained startModePending in 0.261.520, and this
source check still pinned the whole condition. It fails on Development; the
full run on this pull request showed it. The test now pins the part it is
about: that Send reads uploadsBlocked.

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
@paullizer
Paul Lizer (paullizer) merged commit deeb1c6 into microsoft:Development Dec 2, 2026
25 checks passed
Paul Lizer (paullizer) added a commit to paullizer/simplechat that referenced this pull request Dec 2, 2026
…lts are now 0.261.531

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Paul Lizer (paullizer) added a commit to paullizer/simplechat that referenced this pull request Dec 2, 2026
… replies stays 0.261.531

Takes Development's version of the agreement gate test fix, which
supersedes this branch's.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
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