Windows: unit test fixes and skips#15279
Closed
puffnfresh wants to merge 1 commit intoNixOS:masterfrom
Closed
Conversation
Fix test infrastructure for Windows and skip tests that don't pass yet (all with TODO comments to fix later). - nix_api_store.hh: use create_directories (supports nested paths) - compression.cc: add isWine() runtime detection; skip decompression tests under Wine only (exception handling broken in Wine) - file-system.cc: fix makeParentCanonical root test for Windows path - flakeref.cc: add BASE_PATH macro for platform-appropriate paths - nix_api_flake.cc: skip getFlake test on Windows - machines.cc: skip /dev/null and /not/a/file reference tests - nar-info-disk-cache.cc: skip create_and_read on Windows - nix_api_store.cc: skip 11 store API tests on Windows - store-reference.cc: add Windows URI test variation with Z: paths; create local_shorthand_2_windows.txt test data - error_traces.cc: skip filterSource on Windows - nix_api_expr.cc: skip 5 drv/eval tests on Windows - primops.cc: skip baseNameOf, dirOf on Windows; guard coercion test - value/print.cc: fix ansiColorsPath for Windows root path
xokdvium
reviewed
Feb 18, 2026
| auto s = BASE_PATH "?revCount=123&rev=aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"; | ||
| auto flakeref = parseFlakeRef(fetchSettings, s); | ||
| ASSERT_EQ(flakeref.to_string(), "path:/foo/bar?rev=aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa&revCount=123"); | ||
| ASSERT_EQ(flakeref.to_string(), "path:" BASE_PATH "?rev=aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa&revCount=123"); |
Contributor
There was a problem hiding this comment.
Actually, this doesn't parse right. path:C:\ isn't what we want for flakerefs. URLs always need forward slashes even on windows. I think the way for flakerefs on windows paths would be to use the same approach as file: URL RFC specifies - file:///C:/blah/blah.
xokdvium
reviewed
Feb 18, 2026
Comment on lines
+360
to
+364
| #ifdef _WIN32 | ||
| "C:\\" | ||
| #else | ||
| "/" | ||
| #endif |
Contributor
There was a problem hiding this comment.
Doesn't seem correct. CanonPath is still a unixy path even on windows paths- as it should be for now.
Member
Author
|
I'm not sure how much of this is still relevant so I think I'll add the skips to #15303 as needed. |
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.
@Ericson2314 I rebased these old commits because I saw you mention unit tests on Windows. From memory, this was enough to make units tests go green.
Fix test infrastructure for Windows and skip tests that don't pass yet (all with TODO comments to fix later).
Motivation
Context
Add 👍 to pull requests you find important.
The Nix maintainer team uses a GitHub project board to schedule and track reviews.