Skip to content

Commit 553f135

Browse files
authored
Tests: enable a test and update skip reason (#8542)
Enable a single test on Windows and include a GitHub issue with some tests that are skipped on Windows.
1 parent 2d48848 commit 553f135

File tree

6 files changed

+14
-12
lines changed

6 files changed

+14
-12
lines changed

Tests/BasicsTests/Serialization/SerializedJSONTests.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ final class SerializedJSONTests: XCTestCase {
3434
}
3535

3636
func testPathInterpolationFailsOnWindows() throws {
37-
try skipOnWindowsAsTestCurrentlyFails(because: "Expectations are not met")
37+
try skipOnWindowsAsTestCurrentlyFails(because: "Expectations are not met. Possibly related to https://github.com/swiftlang/swift-package-manager/issues/8511")
3838

3939
#if os(Windows)
4040
var path = try AbsolutePath(validating: #"\\?\C:\Users"#)

Tests/BuildTests/BuildSystemDelegateTests.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ final class BuildSystemDelegateTests: XCTestCase {
3030
}
3131

3232
func testFilterNonFatalCodesignMessages() async throws {
33-
try skipOnWindowsAsTestCurrentlyFails(because: "Package fails to build when the test is being executed")
33+
try skipOnWindowsAsTestCurrentlyFails(because: "https://github.com/swiftlang/swift-package-manager/issues/8540: Package fails to build when the test is being executed")
3434

3535
try XCTSkipIf(!UserToolchain.default.supportsSDKDependentTests(), "skipping because test environment doesn't support this test")
3636
// Note: we can re-use the `TestableExe` fixture here since we just need an executable.

Tests/PackageGraphTests/ModulesGraphTests.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ import struct TSCBasic.ByteString
2525

2626
final class ModulesGraphTests: XCTestCase {
2727
func testBasic() throws {
28-
try skipOnWindowsAsTestCurrentlyFails()
28+
try skipOnWindowsAsTestCurrentlyFails(because: "Possibly related to: https://github.com/swiftlang/swift-package-manager/issues/8511")
2929
let fs = InMemoryFileSystem(
3030
emptyFiles:
3131
"/Foo/Sources/Foo/source.swift",

Tests/PackageLoadingTests/PackageBuilderTests.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -564,7 +564,7 @@ final class PackageBuilderTests: XCTestCase {
564564
}
565565

566566
func testTestManifestSearch() throws {
567-
try skipOnWindowsAsTestCurrentlyFails()
567+
try skipOnWindowsAsTestCurrentlyFails(because: "possibly related to https://github.com/swiftlang/swift-package-manager/issues/8511")
568568

569569
let fs = InMemoryFileSystem(emptyFiles:
570570
"/pkg/foo.swift",

Tests/PackageModelTests/PackageModelTests.swift

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,6 @@ import Basics
1717

1818
import func TSCBasic.withTemporaryFile
1919
import XCTest
20-
import _InternalTestSupport // for skipOnWindowsAsTestCurrentlyFails
2120

2221
import struct TSCBasic.ByteString
2322

@@ -160,10 +159,7 @@ final class PackageModelTests: XCTestCase {
160159
}
161160

162161
func testDetermineSwiftCompilers() throws {
163-
try skipOnWindowsAsTestCurrentlyFails()
164-
165162
let fs = localFileSystem
166-
try withTemporaryFile { _ in
167163
try withTemporaryDirectory(removeTreeOnDeinit: true) { tmp in
168164
// When swiftc is not in the toolchain bin directory, UserToolchain
169165
// should find it in the system PATH search paths in the order they
@@ -175,10 +171,17 @@ final class PackageModelTests: XCTestCase {
175171

176172
// Create a directory with two swiftc binaries in it.
177173
let binDirs = ["bin1", "bin2"].map { tmp.appending($0) }
174+
#if os(Windows)
175+
let exeSuffix = ".exe"
176+
#else
177+
let exeSuffix = ""
178+
#endif
179+
let expectedExecuable = "swiftc\(exeSuffix)" // Files that end with .exe are considered executable on Windows.
178180
for binDir in binDirs {
179181
try fs.createDirectory(binDir)
180-
let binFile = binDir.appending("swiftc")
182+
let binFile = binDir.appending(expectedExecuable)
181183
try fs.writeFileContents(binFile, bytes: ByteString(Self.tinyPEBytes))
184+
XCTAssertTrue(fs.exists(binFile), "File '\(binFile)' does not exist when it should")
182185
#if !os(Windows)
183186
try fs.chmod(.executable, path: binFile, options: [])
184187
#endif
@@ -193,8 +196,7 @@ final class PackageModelTests: XCTestCase {
193196
)
194197

195198
// The first swiftc in the search paths should be chosen.
196-
XCTAssertEqual(compilers.compile, binDirs.first?.appending("swiftc"))
199+
XCTAssertEqual(compilers.compile, binDirs.first?.appending(expectedExecuable))
197200
}
198-
}
199201
}
200202
}

Tests/QueryEngineTests/QueryEngineTests.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -100,7 +100,7 @@ private struct Expression: CachingQuery {
100100

101101
final class QueryEngineTests: XCTestCase {
102102
func testFilePathHashing() throws {
103-
try skipOnWindowsAsTestCurrentlyFails()
103+
try skipOnWindowsAsTestCurrentlyFails(because: "https://github.com/swiftlang/swift-package-manager/issues/8541")
104104

105105
let path = "/root"
106106

0 commit comments

Comments
 (0)