swiftlang/swift-package-manager

Fix GitRepositoryTests.testRawRepository on Windows

Open

#8.385 aberto em 19 de mar. de 2025

Ver no GitHub
 (2 comments) (0 reactions) (0 assignees)Swift (1.462 forks)batch import
buggood first issuetest suitewindows

Métricas do repositório

Stars
 (10.145 stars)
Métricas de merge de PR
 (Mesclagem média 9d 13h) (90 fundiu PRs em 30d)

Description

Is it reproducible with SwiftPM command-line tools: swift build, swift test, swift package etc?

  • Confirmed reproduction steps with SwiftPM CLI. The description text must include reproduction steps with either of command-line SwiftPM commands, swift build, swift test, swift package etc.

Description

The GitRepositoryTests.testRawRepository test failed on Windows as Tests/SourceControlTests/Inputs/TestRepo.tgz has unsupported characters in the archive.

Expected behavior

The test passes.

Actual behavior

The current test fails to extract the test repository

Test Suite 'Selected tests' started at 2025-03-19 11:15:25.259
Test Suite 'GitRepositoryTests' started at 2025-03-19 11:15:25.262
Test Case 'GitRepositoryTests.testRawRepository' started at 2025-03-19 11:15:25.262
<EXPR>:0: error: GitRepositoryTests.testRawRepository : threw error "terminated(1): tar.exe -x -v -C C:\Users\bkhouri\AppData\Local\Temp\spm-tests-testRawRepository.IwUiqL -f C:\Users\bkhouri\Documents\git_win\swift-package-manager\Tests\SourceControlTests\Inputs\TestRepo.tgz output:
    x TestRepo/
    x TestRepo/.git/
    x TestRepo/README.txt
    x TestRepo/construct.sh
    x TestRepo/funny-names/
    x TestRepo/subdir/
    x TestRepo/subdir/empty.txt
    x TestRepo/funny-names/a\b: Can't create '\\\\?\\C:\\Users\\bkhouri\\AppData\\Local\\Temp\\spm-tests-testRawRepository.IwUiqL\\TestRepo\\funny-names\\a\b': Invalid argument
    x TestRepo/funny-names/a    b: Can't create '\\\\?\\C:\\Users\\bkhouri\\AppData\\Local\\Temp\\spm-tests-testRawRepository.IwUiqL\\TestRepo\\funny-names\\a  b': Invalid argument
    x TestRepo/funny-names/a\nb: Can't create '\\\\?\\C:\\Users\\bkhouri\\AppData\\Local\\Temp\\spm-tests-testRawRepository.IwUiqL\\TestRepo\\funny-names\\a\nb': Invalid argument
    x TestRepo/funny-names/a\022b: Can't create '\\\\?\\C:\\Users\\bkhouri\\AppData\\Local\\Temp\\spm-tests-testRawRepository.IwUiqL\\TestRepo\\funny-names\\a\022b': Invalid argument
    x TestRepo/funny-names/a b
    x TestRepo/funny-names/a"b
    x TestRepo/funny-names/a$b
    x TestRepo/.git/COMMIT_EDITMSG
    x TestRepo/.git/HEAD
    x TestRepo/.git/branches/
    x TestRepo/.git/config
    x TestRepo/.git/description
    x TestRepo/.git/index
    x TestRepo/.git/info/
    x TestRepo/.git/logs/
    x TestRepo/.git/objects/
    x TestRepo/.git/packed-refs
    x TestRepo/.git/refs/
    x TestRepo/.git/refs/heads/
    x TestRepo/.git/refs/tags/
    x TestRepo/.git/objects/info/
    x TestRepo/.git/objects/pack/
    x TestRepo/.git/objects/pack/pack-a4fa109b46e85a9d707d3677668ae4370348f386.idx
    x TestRepo/.git/objects/pack/pack-a4fa109b46e85a9d707d3677668ae4370348f386.pack
    x TestRepo/.git/objects/info/packs
    x TestRepo/.git/logs/HEAD
    x TestRepo/.git/logs/refs/
    x TestRepo/.git/logs/refs/heads/
    x TestRepo/.git/logs/refs/heads/master
    x TestRepo/.git/info/exclude
    x TestRepo/.git/info/refs
    tar.exe: Error exit delayed from previous errors.

"
Test Case 'GitRepositoryTests.testRawRepository' failed (0.891 seconds)
Test Suite 'GitRepositoryTests' failed at 2025-03-19 11:15:26.153
         Executed 1 test, with 1 failure (1 unexpected) in 0.891 (0.891) seconds
Test Suite 'Selected tests' failed at 2025-03-19 11:15:26.153
         Executed 1 test, with 1 failure (1 unexpected) in 0.891 (0.891) seconds

Steps to reproduce

  1. Ensure the GitRepositoryTests.testRawRepository is not skipped on Windows
  2. Run swift test --filter testRawRepository

Swift Package Manager version/commit hash

No response

Swift & OS version (output of swift --version ; uname -a)

No response

Guia do colaborador