Skip to content

Tests: enable a test and update skip reason #8542

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Apr 28, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ final class SerializedJSONTests: XCTestCase {
}

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

#if os(Windows)
var path = try AbsolutePath(validating: #"\\?\C:\Users"#)
Expand Down
2 changes: 1 addition & 1 deletion Tests/BuildTests/BuildSystemDelegateTests.swift
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ final class BuildSystemDelegateTests: XCTestCase {
}

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

try XCTSkipIf(!UserToolchain.default.supportsSDKDependentTests(), "skipping because test environment doesn't support this test")
// Note: we can re-use the `TestableExe` fixture here since we just need an executable.
Expand Down
2 changes: 1 addition & 1 deletion Tests/PackageGraphTests/ModulesGraphTests.swift
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ import struct TSCBasic.ByteString

final class ModulesGraphTests: XCTestCase {
func testBasic() throws {
try skipOnWindowsAsTestCurrentlyFails()
try skipOnWindowsAsTestCurrentlyFails(because: "Possibly related to: https://github.com/swiftlang/swift-package-manager/issues/8511")
let fs = InMemoryFileSystem(
emptyFiles:
"/Foo/Sources/Foo/source.swift",
Expand Down
2 changes: 1 addition & 1 deletion Tests/PackageLoadingTests/PackageBuilderTests.swift
Original file line number Diff line number Diff line change
Expand Up @@ -564,7 +564,7 @@ final class PackageBuilderTests: XCTestCase {
}

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

let fs = InMemoryFileSystem(emptyFiles:
"/pkg/foo.swift",
Expand Down
16 changes: 9 additions & 7 deletions Tests/PackageModelTests/PackageModelTests.swift
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@ import Basics

import func TSCBasic.withTemporaryFile
import XCTest
import _InternalTestSupport // for skipOnWindowsAsTestCurrentlyFails

import struct TSCBasic.ByteString

Expand Down Expand Up @@ -160,10 +159,7 @@ final class PackageModelTests: XCTestCase {
}

func testDetermineSwiftCompilers() throws {
try skipOnWindowsAsTestCurrentlyFails()

let fs = localFileSystem
try withTemporaryFile { _ in
try withTemporaryDirectory(removeTreeOnDeinit: true) { tmp in
// When swiftc is not in the toolchain bin directory, UserToolchain
// should find it in the system PATH search paths in the order they
Expand All @@ -175,10 +171,17 @@ final class PackageModelTests: XCTestCase {

// Create a directory with two swiftc binaries in it.
let binDirs = ["bin1", "bin2"].map { tmp.appending($0) }
#if os(Windows)
let exeSuffix = ".exe"
#else
let exeSuffix = ""
#endif
let expectedExecuable = "swiftc\(exeSuffix)" // Files that end with .exe are considered executable on Windows.
for binDir in binDirs {
try fs.createDirectory(binDir)
let binFile = binDir.appending("swiftc")
let binFile = binDir.appending(expectedExecuable)
try fs.writeFileContents(binFile, bytes: ByteString(Self.tinyPEBytes))
XCTAssertTrue(fs.exists(binFile), "File '\(binFile)' does not exist when it should")
#if !os(Windows)
try fs.chmod(.executable, path: binFile, options: [])
#endif
Expand All @@ -193,8 +196,7 @@ final class PackageModelTests: XCTestCase {
)

// The first swiftc in the search paths should be chosen.
XCTAssertEqual(compilers.compile, binDirs.first?.appending("swiftc"))
XCTAssertEqual(compilers.compile, binDirs.first?.appending(expectedExecuable))
}
}
}
}
2 changes: 1 addition & 1 deletion Tests/QueryEngineTests/QueryEngineTests.swift
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@ private struct Expression: CachingQuery {

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

let path = "/root"

Expand Down