Skip to content

Delta builds: regenerate a runner and preprocessed test file when what they read changes - #1345

Merged
mkarlesky merged 5 commits into
next_versionfrom
fix/runner-delta-dependencies
Oct 17, 2026
Merged

mkarlesky merged 5 commits into
next_versionfrom
fix/runner-delta-dependencies

Conversation

@mkarlesky

Copy link
Copy Markdown
Member

Summary

Two delta-build gaps from the #1083 work could leave a stale runner after a change that doesn't touch the test file. Both are new in the 1.2.0 prerelease (1.1.x rebuilt every stage every run), so there is no Changelog entry.

  • Runner (stages 12–13). The runner was keyed on the raw test file and runner configuration alone, but it is generated from stage 4's reconciled mock and include lists and from test case names in the preprocessed test file. Enabling a module in a header left the new mock out of the runner. Its Init/Verify/Destroy never ran, so a missing expected call went undetected, a false pass. The runner target now depends on its input file too, and carries its mock and include lists in its meta.
  • Preprocessed test file (stage 11). Its full gcc -E expansion reads every header the test reaches, but only the test file, flags, defines and search paths were tracked. A test case guarded by a macro defined in a header never appeared after the header enabled it, so the test was silently never run. Stage 11 now registers the project files its expansion's line markers name, as stage 4's directives-only pass already does.

Refactor

  • Stages 11–13 move out of TestBuildExecutor into TestFilePreprocessinator (stage 11) and TestRunnerGeneratinator (stages 12–13). Both are fully RuboCop compliant.
  • Registering "the project files a preprocessor's output entered" is shared through TestPipelineHelpers#register_preprocessed_dependencies. Preprocessinator#directives_only_dependencies becomes preprocessed_dependencies, since it reads any -E output.
  • The RuboCop backlog drops from 847 to 840, with neither new class in it.
  • PIPELINE.md and the dependencies README are updated.

Tests

  • Unit specs for both new classes, the helper, and the renames. The wiring spec covers the new objects.yml entries.
  • Two system examples in conditional_mock_includes_spec.rb, both red on next_version and green here (GCC 14, Docker):
    • after only a header enables MODULE_2, the rebuilt runner includes mock_MyModulePart2;
    • after only a header enables FEATURE_X, the guarded test case runs (TESTED goes from 1 to 2).
  • Unit (4677 examples) and integration (452) tiers pass. In Docker, delta_builds, plugin_delta_builds, preprocessing_parameterized_tests, test_source_file_directive and shuffle_tests pass, so unchanged builds still skip these stages.

🤖 Generated with Claude Code

mkarlesky and others added 5 commits October 16, 2026 22:51
Test-file preprocessing moves into TestFilePreprocessinator, and runner
details and generation into TestRunnerGeneratinator, which owns the one
runner target both stages check. TestPipelineManager sequences them.
TestBuildExecutor no longer needs the test context extractor or the
TEST_SOURCE_FILE() resolver, and its comment on mock stand-ins describes
StandinHeaderinator.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Preprocessinator#preprocessed_dependencies reads the files any output with
line markers entered, a full expansion as well as directives-only output.
TestPipelineHelpers#register_preprocessed_dependencies registers the
project files among them, which stage 4's directives-only pass now uses.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The preprocessed test file was cached against the test file alone, but it
comes from a full expansion that reads every header the test reaches. A
header that enables a test case could therefore leave the test case out of
the runner. The stage now registers the project files its expansion
entered, from the expansion's line markers.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The runner was keyed on the raw test file and runner configuration alone,
but it is generated from stage 4's reconciled mock and include lists and
from test case names parsed from the preprocessed test file. A header
macro that enables a mock or a test case changed neither, so the runner
was skipped and the new mock was never initialized or verified, or the
new test case never ran.

The runner target now depends on its input file as well as the test
file, and carries its mock and include lists in its meta.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@mkarlesky
mkarlesky merged commit 3413fd2 into next_version Oct 17, 2026
22 checks passed
@mkarlesky
mkarlesky deleted the fix/runner-delta-dependencies branch October 17, 2026 11:05
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