Repository navigation
test: add a documented local test entry point that cannot report a vacuous pass - #240
Merged
Merged
Conversation
`scripts/bootstrap_local_tests.sh` makes the suite runnable locally, but nothing pointed at it: the README had build instructions only, there was no Makefile, and the Tier 3 note in #128 already counted the bootstrap as done. A contributor who runs a bare `swift test` on a fresh checkout can still get a run that reports success while almost nothing executed — MLX aborts the process when it cannot load its Metal library, and `swift test` exits 0 anyway. Add `make test`, a one-command entry point over the bootstrap plus `swift test --skip-build`, and document it under Build from Source along with the Swift 6.4 / Swift 6.2 difference and the Metal Toolchain requirement. `scripts/run-tests.sh` also rejects a short run: an unfiltered run that executed fewer than 200 tests fails with the metallib explanation instead of reporting a pass. Filtered runs are exempt, because narrowing is the point there. Verified on Swift 6.4 / Xcode 27: `make test` runs 326 tests, exit 0; `make test-filter FILTER=PromptCacheTests` runs 25, exit 0; forcing MIN_TESTS=100000 turns the same green run into the intended failure. Refs #128.
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.
Closes the discoverability gap left by Tier 3 of #128.
Problem
scripts/bootstrap_local_tests.shalready makes the suite runnable locally (landed in #222, verified on both Swift 6.4 and 6.2). Nothing pointed at it: the README had build instructions only, there was no Makefile, and #128's Tier 3 was already recorded as done. So the trap the Tier 3 note described was still live for anyone who did not already know the script existed:swift teston a fresh checkout aborts when MLX cannot load its Metal library,swift teststill exits 0 after printingFailed to load the default metallib— the run looks like a short green pass while almost nothing executed.Change
make test— one command over the bootstrap plusswift test --skip-build.scripts/run-tests.sh— runs the bootstrap, then fails an unfiltered run that executed fewer than 200 tests, with the metallib explanation. Filtered runs are exempt, because narrowing is the point there (make test-filter FILTER=PromptCacheTests).mlxwheel. It also records why copying a metallib into<bundle>.xctest/Contents/MacOSis harmful on 6.4 (CodeSign).No production code changes; no behaviour change to the test suite itself.
Verification
On Swift 6.4 / Xcode 27 (the toolchain on this machine):
make testmake test-filter FILTER=PromptCacheTestsMIN_TESTS=100000 ./scripts/run-tests.shbash scripts/bootstrap_local_tests.sh.build/outpath, checks the Metal Toolchain, copies nothingbash -n,make -nThe Swift 6.2 path is unchanged by this PR; it was verified on this machine on 2026-10-11 (recorded in #128) and remains covered by CI.