Skip to content

Run GitRepositoryTests.testRawRepository on Windows - #10680

Open
Kernel-Hunter wants to merge 1 commit into
swiftlang:mainfrom
Kernel-Hunter:windows-raw-repository-test
Open

Kernel-Hunter wants to merge 1 commit into
swiftlang:mainfrom
Kernel-Hunter:windows-raw-repository-test

Conversation

@Kernel-Hunter

Copy link
Copy Markdown

Run GitRepositoryTests.testRawRepository on Windows by leaving the non-portable working-tree files out of the extraction.

Motivation:

Fixes #8385. TestRepo.tgz contains a checked-out funny-names directory with files named a\b, a"b, a\nb and similar. tar.exe can't create those on Windows ("Invalid argument"), so the extraction step fails and the test has been skipped there.

The test only reads funny-names through the object database (readCommit, readTree on commit a7b19a7). It never touches the working-tree copies.

Modifications:

Result:

The test runs on Windows outside the self-hosted CI. No change on other platforms.

How I checked it:

  • macOS: tar -x --exclude '*/funny-names/*' on the archive, then git ls-tree a7b19a7 still lists README.txt, funny-names and subdir, and 1.0 and main resolve to the same commit.
  • Windows (GitHub Actions windows-latest, tar.exe): the current command fails with Can't create ... funny-names\a\b: Invalid argument. The new command extracts cleanly, and the same values the test asserts come back from git: main equals 1.0^{commit}, the initial commit a8b9fcbf... and tree 9d463c3b..., and the three entries of the a7b19a7 tree.

I couldn't run the Swift test itself on Windows. A plain build of main there currently fails in the swift-build checkout (FileDescriptor.OpenOptions has no member closeOnExec), which also shows up in other PR runs today, so I checked the extraction and the git reads directly instead.

The archived test repository has files whose names Windows doesn't allow
(a\b, a"b and others), so tar.exe failed and the test was skipped. The
test reads those names from the object database only, so extract the
archive without the funny-names working-tree files on Windows.

Fixes swiftlang#8385
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Fix GitRepositoryTests.testRawRepository on Windows

1 participant