Repository navigation
Tests on Windows: test:changed runs, and the RTP tests stay out of APPDATA - #104
Open
Xehanort88 wants to merge 1 commit into
Open
Xehanort88 wants to merge 1 commit into
Xehanort88 wants to merge 1 commit into
Conversation
…PDATA run-tier.cjs could not start a run on Windows. It named the time reporter by a bare path, which Node loads as an ES module URL and refuses for a drive letter (ERR_UNSUPPORTED_ESM_URL_SCHEME); it is now a file URL. A whole run's list of 1,046 files was also too long for one Windows command line (ENAMETOOLONG); a list that does not fit now runs in batches one after another, each with the same flags, passes read from the shared journal once at the end and times merged as each batch ends. Where the list fits (any list on Linux) it is one process, as before. legacy-rtp-archives and legacy-rtp-title redirected HOME and XDG_DATA_HOME but not APPDATA, which is where downloadFolder keeps an RTP on Windows. Every Windows run unpacked fixture RTPs into the real %APPDATA%\RPG Reactor\RTP, and the editor then listed them as installed RTPs. tests/helpers/user-folders.cjs points all three into the test's own folder, and the expected folders come from downloadFolder instead of the Linux layout. The four tests that failed on Windows for this now pass. test-tiers: the batching (every file once, in order, each batch within the limit) and the reporter URL. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
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.
Two test-harness problems on Windows. No product code changes.
npm run test:changedcould not start on Windowseditor/tests/run-tier.cjsfailed before running a single test, for two reasons:--test-reporter=D:\…\file-times-reporter.mjsis loaded as an ES module, and Node readsD:as a URL scheme:ERR_UNSUPPORTED_ESM_URL_SCHEME. It is nowpathToFileURL(…).href, which Node accepts on every platform.spawnSync … ENAMETOOLONG. A list that does not fit now runs in batches, one after another, with the same flags each time. Passes go to the same journal and are read once at the end, and each batch's times are merged as it ends (the next batch writes over the file;--measuregets the merged set). Where the list fits, which is any list on Linux, it is one process as before. The limit is 30,000 on win32 (room for quoting), unlimited elsewhere.Exit status is the first non-zero batch's status, else 0.
The RTP tests wrote into the real
%APPDATA%legacy-rtp-archivesandlegacy-rtp-titleredirectedHOMEandXDG_DATA_HOME, butRtpManager.downloadFolderusesAPPDATAon win32 (src/legacy/RtpManager.js:30). So every Windows run unpacked fixture RTPs (1-byte files) into the user's real%APPDATA%\RPG Reactor\RTP, where the editor then lists them as installed RTPs. The four tests that assert XDG paths also failed on Windows, the leaked folders making two of them fail a second way (a "none found" case found the leaked one).New
tests/helpers/user-folders.cjs,userFoldersIn(root), pointsHOME,XDG_DATA_HOMEandAPPDATAinto the test's own folder and clearsRPG2K_RTP_PATH/RPG2K3_RTP_PATH, returning the undo. The five tests that set these by hand use it. The expected folders now come fromRM.downloadFolder(...)(XDG on Linux,APPDATAon Windows,HOME/Libraryon macOS) instead of the Linux layout, and the archive test asserts the folder is inside the test's root.Verification (Windows 11, Git Bash, Node 24.14)
legacy-rtp-archives,legacy-rtp-title,test-tiers: 24 tests, 23 pass, 1 skipped (the existing skip when no real RTP installer is at hand), 0 fail. Before: 4 failures. The existing leaked folders in%APPDATA%\RPG Reactor\RTPkept their timestamps through the run; before, each run rewrote them.tests-run-anywhere: passes.npm run test:changed -- --only=legacy-rtp --limit=3runs and records its passes, which it could not do before. Two newtest-tierstests: the batching keeps every file once, in order, each batch within the limit, one batch with no limit; and the reporter is named by a file URL.test:changedon Windows ran all 1,046 files in--limit=270slices.Limits
🤖 Generated with Claude Code