fix(tests): make the pi sessionDir test use a platform-absolute path - #719
Closed
Adam-Dalloul wants to merge 1 commit into
Closed
fix(tests): make the pi sessionDir test use a platform-absolute path#719Adam-Dalloul wants to merge 1 commit into
Adam-Dalloul wants to merge 1 commit into
Conversation
Contributor
Author
|
Closing: c80b216 fixes this, and more thoroughly. Building the paths through a helper and serializing the JSON also covers the backslash-escape case my version would still have tripped on. |
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.
parsers::pi::tests::settings_json_session_dir_is_honoredfails onRust server on windows-latest, and it fails on main too (run 34542650449 at a691822), so every open PR inherits one red job.The test hard-codes
/srv/pi-sessions.session_dir_from_settingsonly honors an absolutesessionDir, andPath::is_absolutewants a drive or UNC prefix on Windows, so that literal is not absolute there. The gate correctly refuses it, the resolver falls back to<agent_dir>/sessions, and the assertion fails. The~-rooted case right below it has the same problem for the same reason, it just never got to run.The product code looks right to me, so this only changes the test: both paths now get a
C:prefix when the test runs on Windows. Verified by extracting the resolver and running it here with a windows-gnu toolchain: the current form fails both cases and the new form passes, alongside the env-var and relative-path cases which were never platform dependent.