Repository navigation
test: use forward-slash fixture names in vm-state-snapshot on Windows - #757
Open
jonathanmendoza-tx wants to merge 1 commit into
Open
jonathanmendoza-tx wants to merge 1 commit into
jonathanmendoza-tx wants to merge 1 commit into
Conversation
Refs scratchfoundation#750 path.relative yields backslashes on Windows, forward-slash exclusion list never matched
This branch has not been deployed
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.
Refs #750 path.relative yields backslashes on Windows, forward-slash exclusion list never matched
Resolves
Refs #750 (the
vm-state-snapshotcomment there). Same class of Windows-only failure as #751, #752 and #753.Proposed Changes
In
packages/scratch-vm/test/integration/vm-state-snapshot.js, the fixture names built frompath.relative(...)now go through.replaceAll(path.sep, '/'), with a one-line comment. Fixture names therefore use/on every platform.replaceAllis used rather than.split(path.sep).join('/')because the split/join form trips the@stylistic/newline-per-chained-calllint rule on a single line. On POSIXpath.sepis already/, so Linux and macOS behavior is identical. Snapshot file paths are unaffected, becausepath.joinnormalises separators.Reason for Changes
On Windows,
path.relativereturns backslash names such asload-extensions\confirm-load\videoSensing-simple-project.sb2. The exclusion list just below is written with forward slashes, so.includes(name)never matches and none of the six excluded fixtures is skipped. They are meant to be skipped because they cause intentional load errors or hang onvm.quit(). Because they run:ENOENTfailures;vm.quit(), leaving timers alive that then fail unrelated fixtures in the sameprocess;
The test was added in f4cff74. Evaluating the filter directly shows 0 of 6 exclusions matching as written and 6 of 6 once separators are normalized.
Test Coverage
This test file is the coverage. Run on Windows (cmd.exe, Node 24.21.0) in
packages/scratch-vmwithnpx tap test/integration/vm-state-snapshot.js:{ total: 206, pass: 174, fail: 32 }in 32.4 s, ending intimeout!, withENOENTfor the six excluded fixtures and leaked-timer failures.{ total: 117, pass: 117 }in 12.6 s, with no ENOENT, no timer warnings and no timeout.npm run tap(unit plus integration) gives{ total: 3872, pass: 3872 }. ESLint reports 0 errors.Heads-up for reviewers: on a Windows checkout of current
develop,npm testas a whole still fails on a separateformat-message lintglob issue, which is #753 and not part of this PR. CI on Linux is unaffected either way, sincepath.sepis/there.