Skip to content

92 Semantics.Paths tests fail on Linux, and main has been red since the matrix added it #191

Description

@matt-edmondson

Summary

Test on ubuntu-latest fails on main with 92 failures, all in Semantics.Paths tests. Test on windows-latest passes. Every PR inherits the red job, which is how it was noticed.

ubuntu-latest windows-latest
main @ 3b40272 (run) ❌ 92 failed, 1006 passed

Why it started

8b9df02 ("ci: adopt the unified dotnet workflow") added Linux to the test matrix two days ago. Its own commit message says exactly what it was for:

Tests now run on Linux as well as Windows, which is new coverage for libraries that ship netstandard and claim to run anywhere but were only ever tested on one operating system.

The coverage found what it was looking for on the first run. Nothing regressed — this is pre-existing behaviour that had never been exercised.

What is failing

All 92 are path tests that assume Windows semantics: drive letters, \ separators, and the 259-character limit. A sample:

  • SemanticPath_RootPath
  • SemanticPath_PathLength_Long
  • PathOperators_CrossPlatformSeparators_HandleCorrectly
  • PathOperators_WithDotPaths_HandleCorrectly
  • RelativeFilePath_AsAbsoluteWithBase_ResolvesCorrectly
  • RelativeDirectoryPath_Parent_ReturnsCorrectParent
  • IsChildOf_WithMixedSeparators_WorksCorrectly
  • SemanticFilePath_FileName_WithPathSeparators_ShouldReturnOnlyFileName
  • AbsoluteToRelative_RoundTrip_WorksCorrectly

Suggested shape of the fix

Most of these look like test assumptions rather than defects in Semantics.Paths, so the work is mostly to express each expectation in terms of the running platform:

  • Build fixtures with Path.Combine and Path.DirectorySeparatorChar instead of literal C:\... strings.
  • Take the root from Path.GetPathRoot(Environment.CurrentDirectory) rather than hard-coding C:\.
  • Gate the 259-character limit behind [TestCategory("OS-Specific")], which CLAUDE.md already prescribes for exactly this.

Check each one as you go, though — the point of a Linux matrix is to find real bugs, and some of these may be genuine Semantics.Paths defects on a platform where \ is a legal filename character and there is no drive letter. IsChildOf_WithMixedSeparators_WorksCorrectly in particular is worth reading carefully before assuming the test is at fault: treating \ as a separator on Linux would be a library bug, not a test bug.

Acceptance criteria

  • Test on ubuntu-latest passes on main.
  • Any failure that turned out to be a library defect rather than a test assumption is called out in the PR, with the fix in Semantics.Paths rather than in the test.
  • Tests that are genuinely Windows-only carry [TestCategory("OS-Specific")].

Context

Found while working #181. Analysis was posted on #188 and #190 to explain why those PRs left the job red — neither introduced a failure, and both matched main's count exactly.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions