Skip to content

Add multi-scope regression tests for scoped-build implicit-dep detection#47

Merged
typeless merged 1 commit into
mainfrom
regression/scoped-implicit-dep-tests
May 15, 2026
Merged

Add multi-scope regression tests for scoped-build implicit-dep detection#47
typeless merged 1 commit into
mainfrom
regression/scoped-implicit-dep-tests

Conversation

@typeless

Copy link
Copy Markdown
Owner

Summary

Adds a regression test fixture and four [multi-scope] scenarios for the scoped-build implicit-dependency fix landed in 315b2a2.

The fixture (test/e2e/fixtures/scoped_implicit_dep_multi_scope) sets up three TUs (alpha, beta, main) that share an out-of-scope header at include/lib/shared.h, linked into a single binary at app/app. Mirrors the production iOS bug shape (multi-arg scoped invocation, header outside any scope dir).

Four scenarios in test/unit/test_e2e.cpp:

  • Full initial build + scoped rebuild — baseline reproduction
  • Out-of-tree variant build (-B build/v1) — variant-aware path
  • Scoped initial build + scoped rebuild — probes whether index built under a scoped graph still records the implicit edges needed for the fix's exemption logic
  • Full initial + noop scoped pass + scoped rebuild after edit — probes whether intermediate noop scoped invocations leave stale state

All four assert binary_before \!= binary_after on the linked artifact, which catches both the original "Nothing to do (up to date)" failure mode and the "rebuilt some + linked stale" partial-rebuild mode described in pup-header-detection-bug.md's 2026-05-15 follow-up.

RED verification

Reverted the binary_search(implicit_dep_files…) clause from find_changed_files_with_implicit (the one-line fix added in 315b2a2). All four scenarios fail immediately at REQUIRE_FALSE(result.is_noop()) with Nothing to do (up to date). — the exact symptom from the bug doc. Fix restored, all green. The tests genuinely exercise the bug.

Test plan

  • make test — full suite passes (461 cases, 23 622 assertions)
  • ./build/test/unit/putup_test "[multi-scope]" — 4 cases / 30 assertions
  • RED proven: temporary fix revert → all four fail with the documented symptom
  • GREEN restored: fix back in place → all four pass
  • make format clean

Refs 315b2a2.

🤖 Generated with Claude Code

Adds scoped_implicit_dep_multi_scope fixture (three TUs share an out-of-scope header in include/lib/shared.h, linked into a single binary) and four SCENARIOs tagged [multi-scope]:

- Full initial build + scoped rebuild
- Out-of-tree variant build (-B build/v1)
- Scoped initial build + scoped rebuild
- Full initial + noop scoped pass + scoped rebuild after edit

All four assert the linked binary's bytes change after a header edit, catching both the "Nothing to do" noop mode and the "rebuilt some + linked stale" partial-rebuild mode.

Verified RED: reverting the binary_search(implicit_dep_files) clause from 315b2a2 in find_changed_files_with_implicit causes all four to fail with "Nothing to do (up to date)".

Refs 315b2a2.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@typeless typeless merged commit 4fdec14 into main May 15, 2026
9 checks passed
@typeless typeless deleted the regression/scoped-implicit-dep-tests branch May 15, 2026 03:56
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