Repository navigation
Tests remove their temporary folders; CI fails if any are left - #18
Merged
Merged
Conversation
Each focused test file now creates its folders through test/support/temp-dir.mjs, which removes them when that test process exits. scripts/test-temp-guard.mjs runs tests against a private temp location and fails on leftovers; CI uses it. Fixes #17
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.
One run of the focused tests used to leave about 100 folders in the temp location. Now it leaves none, and CI fails if that comes back.
test/support/temp-dir.mjs:tempDir(prefix)creates a folder and removes it when that test file's process exits, however its tests ended. It retries on Windows file locks and honoursFACTORY_TEST_TMP. The eleven leaking test files now use it. Folder names and locations are unchanged, so path-length tests still test the same thing.scripts/test-temp-guard.mjs: runs tests with the temp location pointed at a private empty folder, lists anything left behind and fails if it is not empty. The workflow now runs the focused tests and the evidence regressions through it.Scope: only the tests in
.github/workflows/public-sdk.yml. Test files outside that list are unchanged.Fixes #17
Proof: items left in the test temp location after one focused run
Measured by
scripts/test-temp-guard.mjsover the focused list plus the evidence regressions (205 tests).The guard also exits non-zero when tests pass but folders remain, which is what the "before" runs did.
Local CI (AGENTS.md)
Same steps as
.github/workflows/public-sdk.yml, on a cleangit archiveexport of 7714828 with freshnpm ci:factory-selfhost profilesnode:22.17.0-bookworm, Python 3.11node:24.22.2-bookworm, Python 3.11On Windows, the Windows
tarmust come before Git's on the PATH; Git'starreadsC:as a remote host and fails five evidence tests. That was already so before this change.No model or cloud call was made.