fix(test): clean before build:test so orphan dist cannot mask deleted sources - #1944
Merged
Conversation
…n from test/test:full
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
build:testwas an incremental tsc build that never removed the compiled output of deleted sources. When a source file and its test were removed (e.g.composer-skill-pickerin #1915), the orphandistartifacts survived, andnode --test "dist/**/*.test.js"picked up the stale test, which then crashed against the deleted component — surfacing as mysteriousundefined.labelfailures. Clean runs (npm test) and CI (fresh checkout) were unaffected; only the localbuild:test/test:fastpath was.This PR makes
build:testthe single owner of dist freshness: it runsnpm run cleanfirst, sodistis always derived from current sources and orphan artifacts cannot exist. Full rebuild costs ~6.5s locally (measured), so there is no practical incremental-vs-clean tradeoff.test/test:fullno longer repeat the clean (build:testowns it).Closes #1941 (the issue is a stale-dist false positive; the clean-build gate removes the mechanism that produced it).
Verification
packages/ui/dist, rannpm run build:test(6.53s real, exit 0), confirmed the orphan was removed by the leadingclean.@maka/ui247/247,@maka/cli467/467,@maka/desktop1400/1400; the staleruntime/dist/__tests__/agent-team-tools.test.jsorphan is gone.npm run test:scripts23/23,npm run format:checkclean.check-stale-dist.mjswould be inferior (mtime-only, not wired into the test path).