Skip to content

Force test executables to rerun past delta-build caching - #1213

Merged
mkarlesky merged 1 commit into
next_versionfrom
force-test-rerun
Aug 19, 2026
Merged

Force test executables to rerun past delta-build caching#1213
mkarlesky merged 1 commit into
next_versionfrom
force-test-rerun

Conversation

@mkarlesky

Copy link
Copy Markdown
Member

Summary

Delta builds skip actually running a test executable when nothing changed since its last build, reusing the previous run's cached result. That's correct for an ordinary rebuild, but it quietly defeats :unity:shuffle_tests: shuffled test-case order is decided at runtime inside the compiled executable itself, not at compile or link time, so an unchanged executable that never runs again also never produces a new order.

  • Test execution is now forced whenever :unity:shuffle_tests is enabled, so the feature actually does something on any build past the very first.
  • The same override is exposed as a new --force-test-rerun build flag, for anyone who wants fresh results regardless of caching, independent of shuffling.

Test plan

  • Unit: spec/units/test_build_executor_spec.rb (#stage_execute) covers both trigger paths, plus the existing unchanged/cached-result behavior.
  • Unit: spec/units/bin/cli_helper_spec.rb (#process_force_test_rerun) covers the flag's no-op/raise/pass conditions, mirroring #process_testcase_filters's existing validation shape.
  • System: spec/system/delta_builds_spec.rb new scenarios confirm both the CLI flag and :shuffle_tests cause a test executable to actually rerun on an otherwise fully-cached rebuild (no recompiling/relinking, but Running still occurs), and the full file's pre-existing scenarios still pass with no regressions.

Delta builds skip actually running a test executable when nothing
changed since its last build, reusing the previous run's cached
result. That's the right call for an ordinary rebuild, but it quietly
defeats :unity ↳ :shuffle_tests: shuffled test-case order is decided
at runtime inside the compiled executable itself, not at compile or
link time, so an unchanged executable that never runs again also
never produces a new order.

Test execution is now forced whenever shuffling is enabled, so the
feature actually does something past the very first build. The same
override is available on demand via a new --force-test-rerun flag,
for anyone who wants fresh results regardless of caching.
@mkarlesky
mkarlesky merged commit 2f544da into next_version Aug 19, 2026
21 of 40 checks passed
@mkarlesky
mkarlesky deleted the force-test-rerun branch August 19, 2026 04:30
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