From b7b9cd439632a95658a657908fc43eff9f9cd313 Mon Sep 17 00:00:00 2001 From: Sam Khouri Date: Thu, 9 Jan 2025 23:49:57 -0500 Subject: [PATCH 01/20] Tests: Skip failing tests on windows The Pipelines do not currently test on windows platform. To get to a point where we can execute tests on windows, we will first disable the failing tests and later enable them as the pipeline is setup to ensure we do not regress in behaviour. related to #8121 rdar://139977454 --- .../_InternalTestSupport/XCTSkipHelpers.swift | 12 + Tests/BasicsTests/AsyncProcessTests.swift | 5 + .../BasicsTests/ConcurrencyHelpersTests.swift | 6 + .../Environment/EnvironmentTests.swift | 12 +- Tests/BasicsTests/FileSystem/PathTests.swift | 64 +- Tests/BasicsTests/FileSystem/VFSTests.swift | 4 + Tests/BasicsTests/HTTPClientTests.swift | 2 + .../Serialization/SerializedJSONTests.swift | 3 + Tests/BuildTests/BuildPlanTests.swift | 8 + .../BuildTests/BuildSystemDelegateTests.swift | 2 + .../LLBuildManifestBuilderTests.swift | 2 + Tests/BuildTests/PluginsBuildPlanTests.swift | 2 + Tests/BuildTests/PrepareForIndexTests.swift | 6 + .../PackageGraphPerfTests.swift | 2 + .../PackageGraphTests/ModulesGraphTests.swift | 1 + .../PackageBuilderTests.swift | 2 + .../PkgConfigParserTests.swift | 29 +- .../PackageLoadingTests/PkgConfigTests.swift | 6 + .../PackageModelTests/PackageModelTests.swift | 3 + Tests/QueryEngineTests/QueryEngineTests.swift | 2 + .../SourceKitLSPAPITests.swift | 2 + .../ManifestSourceGenerationTests.swift | 2 + .../RegistryPackageContainerTests.swift | 5 + .../SourceControlPackageContainerTests.swift | 8 + Tests/WorkspaceTests/WorkspaceTests.swift | 4 + xunit-windows-failures-original.xml | 3395 +++++++++++++++++ ...indows-failures-swift-testing-original.xml | 6 + 27 files changed, 3572 insertions(+), 23 deletions(-) create mode 100644 xunit-windows-failures-original.xml create mode 100644 xunit-windows-failures-swift-testing-original.xml diff --git a/Sources/_InternalTestSupport/XCTSkipHelpers.swift b/Sources/_InternalTestSupport/XCTSkipHelpers.swift index e3ebbf586a5..f4fb92c9ffb 100644 --- a/Sources/_InternalTestSupport/XCTSkipHelpers.swift +++ b/Sources/_InternalTestSupport/XCTSkipHelpers.swift @@ -17,6 +17,18 @@ import XCTest import class Basics.AsyncProcess import struct TSCBasic.StringError +public func skipOnWindowsAsTestCurrentlyFails(because reason: String? = nil) throws { + #if os(Windows) + let failureCause: String + if reason == nil { + failureCause = "" + } else { + failureCause = " because \(reason!.description)" + } + throw XCTSkip("Test fails on windows\(failureCause)") + #endif +} + extension Toolchain { package func skipUnlessAtLeastSwift6( file: StaticString = #file, diff --git a/Tests/BasicsTests/AsyncProcessTests.swift b/Tests/BasicsTests/AsyncProcessTests.swift index cae5f2cd604..8d7c36fa3bc 100644 --- a/Tests/BasicsTests/AsyncProcessTests.swift +++ b/Tests/BasicsTests/AsyncProcessTests.swift @@ -23,6 +23,11 @@ import func TSCBasic.withTemporaryFile import func TSCTestSupport.withCustomEnv final class AsyncProcessTests: XCTestCase { + + override func setUp() async throws { + try skipOnWindowsAsTestCurrentlyFails() + } + func testBasics() throws { do { let process = AsyncProcess(args: "echo", "hello") diff --git a/Tests/BasicsTests/ConcurrencyHelpersTests.swift b/Tests/BasicsTests/ConcurrencyHelpersTests.swift index 2efa891fded..fb47cfcd3dc 100644 --- a/Tests/BasicsTests/ConcurrencyHelpersTests.swift +++ b/Tests/BasicsTests/ConcurrencyHelpersTests.swift @@ -14,9 +14,15 @@ import TSCTestSupport import XCTest +import _InternalTestSupport // for skipOnWindowsAsTestCurrentlyFails + final class ConcurrencyHelpersTest: XCTestCase { let queue = DispatchQueue(label: "ConcurrencyHelpersTest", attributes: .concurrent) + override func setUpWithError() throws { + try skipOnWindowsAsTestCurrentlyFails() + } + func testThreadSafeKeyValueStore() { for _ in 0 ..< 100 { let sync = DispatchGroup() diff --git a/Tests/BasicsTests/Environment/EnvironmentTests.swift b/Tests/BasicsTests/Environment/EnvironmentTests.swift index 837d93706c4..220fb8c08f1 100644 --- a/Tests/BasicsTests/Environment/EnvironmentTests.swift +++ b/Tests/BasicsTests/Environment/EnvironmentTests.swift @@ -15,6 +15,7 @@ import Basics import XCTest +import _InternalTestSupport // for skipOnWindowsAsTestCurrentlyFails() final class EnvironmentTests: XCTestCase { func test_init() { @@ -35,10 +36,11 @@ final class EnvironmentTests: XCTestCase { "testKey": "TestValue2", ] let environment = Environment(dictionary) - XCTAssertEqual(environment["TestKey"], "TestValue") #if os(Windows) + XCTAssertEqual(environment["TestKey"], "TestValue2") XCTAssertEqual(environment.count, 1) #else + XCTAssertEqual(environment["TestKey"], "TestValue") XCTAssertEqual(environment.count, 2) #endif } @@ -47,6 +49,7 @@ final class EnvironmentTests: XCTestCase { let dictionary = ["TestKey": "TestValue"] let environment = Environment(dictionary) XCTAssertEqual(environment["TestKey"], "TestValue") + XCTAssertEqual(environment.count, 1) } func path(_ components: String...) -> String { @@ -99,10 +102,13 @@ final class EnvironmentTests: XCTestCase { /// Important: This test is inherently race-prone, if it is proven to be /// flaky, it should run in a singled threaded environment/removed entirely. - func test_current() { + func test_current() throws { + try skipOnWindowsAsTestCurrentlyFails(because: "ProcessInfo.processInfo.environment[\"PATH\"] return nil") + XCTAssertEqual( Environment.current["PATH"], - ProcessInfo.processInfo.environment["PATH"]) + ProcessInfo.processInfo.environment["PATH"] + ) } /// Important: This test is inherently race-prone, if it is proven to be diff --git a/Tests/BasicsTests/FileSystem/PathTests.swift b/Tests/BasicsTests/FileSystem/PathTests.swift index 1f9e7b7b80b..720697106a6 100644 --- a/Tests/BasicsTests/FileSystem/PathTests.swift +++ b/Tests/BasicsTests/FileSystem/PathTests.swift @@ -12,6 +12,8 @@ import Basics import Foundation import XCTest +import _InternalTestSupport // for skipOnWindowsAsTestCurrentlyFails() + #if os(Windows) private var windows: Bool { true } #else @@ -54,28 +56,36 @@ class PathTests: XCTestCase { XCTAssertEqual(rel2.pathString, "~") // `~` is not special } - func testRepeatedPathSeparators() { + func testRepeatedPathSeparators() throws { + try skipOnWindowsAsTestCurrentlyFails(because: "all assertions fail") + XCTAssertEqual(AbsolutePath("/ab//cd//ef").pathString, windows ? #"\ab\cd\ef"# : "/ab/cd/ef") XCTAssertEqual(AbsolutePath("/ab///cd//ef").pathString, windows ? #"\ab\cd\ef"# : "/ab/cd/ef") XCTAssertEqual(RelativePath("ab//cd//ef").pathString, windows ? #"ab\cd\ef"# : "ab/cd/ef") XCTAssertEqual(RelativePath("ab//cd///ef").pathString, windows ? #"ab\cd\ef"# : "ab/cd/ef") } - func testTrailingPathSeparators() { + func testTrailingPathSeparators() throws { + try skipOnWindowsAsTestCurrentlyFails(because: "trailing path seperator is not removed from pathString") + XCTAssertEqual(AbsolutePath("/ab/cd/ef/").pathString, windows ? #"\ab\cd\ef"# : "/ab/cd/ef") XCTAssertEqual(AbsolutePath("/ab/cd/ef//").pathString, windows ? #"\ab\cd\ef"# : "/ab/cd/ef") XCTAssertEqual(RelativePath("ab/cd/ef/").pathString, windows ? #"ab\cd\ef"# : "ab/cd/ef") XCTAssertEqual(RelativePath("ab/cd/ef//").pathString, windows ? #"ab\cd\ef"# : "ab/cd/ef") } - func testDotPathComponents() { + func testDotPathComponents() throws { + try skipOnWindowsAsTestCurrentlyFails() + XCTAssertEqual(AbsolutePath("/ab/././cd//ef").pathString, "/ab/cd/ef") XCTAssertEqual(AbsolutePath("/ab/./cd//ef/.").pathString, "/ab/cd/ef") XCTAssertEqual(RelativePath("ab/./cd/././ef").pathString, "ab/cd/ef") XCTAssertEqual(RelativePath("ab/./cd/ef/.").pathString, "ab/cd/ef") } - func testDotDotPathComponents() { + func testDotDotPathComponents() throws { + try skipOnWindowsAsTestCurrentlyFails() + XCTAssertEqual(AbsolutePath("/..").pathString, windows ? #"\"# : "/") XCTAssertEqual(AbsolutePath("/../../../../..").pathString, windows ? #"\"# : "/") XCTAssertEqual(AbsolutePath("/abc/..").pathString, windows ? #"\"# : "/") @@ -91,7 +101,9 @@ class PathTests: XCTestCase { XCTAssertEqual(RelativePath("abc/..").pathString, ".") } - func testCombinationsAndEdgeCases() { + func testCombinationsAndEdgeCases() throws { + try skipOnWindowsAsTestCurrentlyFails() + XCTAssertEqual(AbsolutePath("///").pathString, windows ? #"\"# : "/") XCTAssertEqual(AbsolutePath("/./").pathString, windows ? #"\"# : "/") XCTAssertEqual(RelativePath("").pathString, ".") @@ -120,7 +132,9 @@ class PathTests: XCTestCase { XCTAssertEqual(RelativePath("a/../////../////./////").pathString, "..") } - func testDirectoryNameExtraction() { + func testDirectoryNameExtraction() throws { + try skipOnWindowsAsTestCurrentlyFails() + XCTAssertEqual(AbsolutePath("/").dirname, windows ? #"\"# : "/") XCTAssertEqual(AbsolutePath("/a").dirname, windows ? #"\"# : "/") XCTAssertEqual(AbsolutePath("/./a").dirname, windows ? #"\"# : "/") @@ -137,7 +151,9 @@ class PathTests: XCTestCase { XCTAssertEqual(RelativePath(".").dirname, ".") } - func testBaseNameExtraction() { + func testBaseNameExtraction() throws { + try skipOnWindowsAsTestCurrentlyFails() + XCTAssertEqual(AbsolutePath("/").basename, windows ? #"\"# : "/") XCTAssertEqual(AbsolutePath("/a").basename, "a") XCTAssertEqual(AbsolutePath("/./a").basename, "a") @@ -153,7 +169,9 @@ class PathTests: XCTestCase { XCTAssertEqual(RelativePath(".").basename, ".") } - func testBaseNameWithoutExt() { + func testBaseNameWithoutExt() throws{ + try skipOnWindowsAsTestCurrentlyFails() + XCTAssertEqual(AbsolutePath("/").basenameWithoutExt, windows ? #"\"# : "/") XCTAssertEqual(AbsolutePath("/a").basenameWithoutExt, "a") XCTAssertEqual(AbsolutePath("/./a").basenameWithoutExt, "a") @@ -176,7 +194,9 @@ class PathTests: XCTestCase { XCTAssertEqual(RelativePath("abc.xyz.123").basenameWithoutExt, "abc.xyz") } - func testSuffixExtraction() { + func testSuffixExtraction() throws { + try skipOnWindowsAsTestCurrentlyFails(because: "expected nil is not the actual") + XCTAssertEqual(RelativePath("a").suffix, nil) XCTAssertEqual(RelativePath("a").extension, nil) XCTAssertEqual(RelativePath("a.").suffix, nil) @@ -201,7 +221,9 @@ class PathTests: XCTestCase { XCTAssertEqual(RelativePath(".a.foo.bar.baz").extension, "baz") } - func testParentDirectory() { + func testParentDirectory() throws { + try skipOnWindowsAsTestCurrentlyFails() + XCTAssertEqual(AbsolutePath("/").parentDirectory, AbsolutePath("/")) XCTAssertEqual(AbsolutePath("/").parentDirectory.parentDirectory, AbsolutePath("/")) XCTAssertEqual(AbsolutePath("/bar").parentDirectory, AbsolutePath("/")) @@ -210,7 +232,9 @@ class PathTests: XCTestCase { } @available(*, deprecated) - func testConcatenation() { + func testConcatenation() throws { + try skipOnWindowsAsTestCurrentlyFails() + XCTAssertEqual(AbsolutePath(AbsolutePath("/"), RelativePath("")).pathString, windows ? #"\"# : "/") XCTAssertEqual(AbsolutePath(AbsolutePath("/"), RelativePath(".")).pathString, windows ? #"\"# : "/") XCTAssertEqual(AbsolutePath(AbsolutePath("/"), RelativePath("..")).pathString, windows ? #"\"# : "/") @@ -247,7 +271,9 @@ class PathTests: XCTestCase { XCTAssertEqual(RelativePath("hello").appending(RelativePath("a/b/../c/d")).pathString, windows ? #"hello\a\c\d"# : "hello/a/c/d") } - func testPathComponents() { + func testPathComponents() throws { + try skipOnWindowsAsTestCurrentlyFails() + XCTAssertEqual(AbsolutePath("/").components, ["/"]) XCTAssertEqual(AbsolutePath("/.").components, ["/"]) XCTAssertEqual(AbsolutePath("/..").components, ["/"]) @@ -275,7 +301,9 @@ class PathTests: XCTestCase { XCTAssertEqual(RelativePath("abc").components, ["abc"]) } - func testRelativePathFromAbsolutePaths() { + func testRelativePathFromAbsolutePaths() throws { + try skipOnWindowsAsTestCurrentlyFails() + XCTAssertEqual(AbsolutePath("/").relative(to: AbsolutePath("/")), RelativePath(".")); XCTAssertEqual(AbsolutePath("/a/b/c/d").relative(to: AbsolutePath("/")), RelativePath("a/b/c/d")); XCTAssertEqual(AbsolutePath("/").relative(to: AbsolutePath("/a/b/c")), RelativePath("../../..")); @@ -316,7 +344,9 @@ class PathTests: XCTestCase { XCTAssertTrue(AbsolutePath("/foo").isAncestor(of: AbsolutePath("/foo/bar"))) } - func testAbsolutePathValidation() { + func testAbsolutePathValidation() throws { + try skipOnWindowsAsTestCurrentlyFails() + XCTAssertNoThrow(try AbsolutePath(validating: "/a/b/c/d")) XCTAssertThrowsError(try AbsolutePath(validating: "~/a/b/d")) { error in @@ -328,7 +358,9 @@ class PathTests: XCTestCase { } } - func testRelativePathValidation() { + func testRelativePathValidation() throws { + try skipOnWindowsAsTestCurrentlyFails() + XCTAssertNoThrow(try RelativePath(validating: "a/b/c/d")) XCTAssertThrowsError(try RelativePath(validating: "/a/b/d")) { error in @@ -342,6 +374,8 @@ class PathTests: XCTestCase { } func testCodable() throws { + try skipOnWindowsAsTestCurrentlyFails() + struct Foo: Codable, Equatable { var path: AbsolutePath } diff --git a/Tests/BasicsTests/FileSystem/VFSTests.swift b/Tests/BasicsTests/FileSystem/VFSTests.swift index 83b8513fa69..4cb98615ef4 100644 --- a/Tests/BasicsTests/FileSystem/VFSTests.swift +++ b/Tests/BasicsTests/FileSystem/VFSTests.swift @@ -16,6 +16,8 @@ import XCTest import struct TSCBasic.ByteString +import _InternalTestSupport // for skipOnWindowsAsTestCurrentlyFails + func testWithTemporaryDirectory( function: StaticString = #function, body: @escaping (AbsolutePath) async throws -> Void @@ -36,6 +38,8 @@ func testWithTemporaryDirectory( class VFSTests: XCTestCase { func testLocalBasics() throws { + try skipOnWindowsAsTestCurrentlyFails() + // tiny PE binary from: https://archive.is/w01DO let contents: [UInt8] = [ 0x4d, 0x5a, 0x00, 0x00, 0x50, 0x45, 0x00, 0x00, 0x4c, 0x01, 0x01, 0x00, diff --git a/Tests/BasicsTests/HTTPClientTests.swift b/Tests/BasicsTests/HTTPClientTests.swift index 6b230151297..ef313889238 100644 --- a/Tests/BasicsTests/HTTPClientTests.swift +++ b/Tests/BasicsTests/HTTPClientTests.swift @@ -226,6 +226,8 @@ final class HTTPClientTests: XCTestCase { } func testExponentialBackoff() async throws { + try skipOnWindowsAsTestCurrentlyFails() + let counter = SendableBox(0) let lastCall = SendableBox() let maxAttempts = 5 diff --git a/Tests/BasicsTests/Serialization/SerializedJSONTests.swift b/Tests/BasicsTests/Serialization/SerializedJSONTests.swift index ecefe820d5c..a7841df439f 100644 --- a/Tests/BasicsTests/Serialization/SerializedJSONTests.swift +++ b/Tests/BasicsTests/Serialization/SerializedJSONTests.swift @@ -12,9 +12,12 @@ @testable import Basics import XCTest +import _InternalTestSupport // for skipOnWindowsAsTestCurrentlyFails final class SerializedJSONTests: XCTestCase { func testPathInterpolation() throws { + try skipOnWindowsAsTestCurrentlyFails() + var path = try AbsolutePath(validating: #"/test\backslashes"#) var json: SerializedJSON = "\(path)" diff --git a/Tests/BuildTests/BuildPlanTests.swift b/Tests/BuildTests/BuildPlanTests.swift index 47dc72b7fec..65b89f35deb 100644 --- a/Tests/BuildTests/BuildPlanTests.swift +++ b/Tests/BuildTests/BuildPlanTests.swift @@ -2000,6 +2000,8 @@ final class BuildPlanTests: XCTestCase { } func test_symbolGraphExtract_arguments() async throws { + try skipOnWindowsAsTestCurrentlyFails() + // ModuleGraph: // . // ├── A (Swift) @@ -4620,6 +4622,8 @@ final class BuildPlanTests: XCTestCase { } func testUserToolchainCompileFlags() async throws { + try skipOnWindowsAsTestCurrentlyFails() + let fs = InMemoryFileSystem( emptyFiles: "/Pkg/Sources/exe/main.swift", @@ -4883,6 +4887,8 @@ final class BuildPlanTests: XCTestCase { } func testUserToolchainWithToolsetCompileFlags() async throws { + try skipOnWindowsAsTestCurrentlyFails() + let fileSystem = InMemoryFileSystem( emptyFiles: "/Pkg/Sources/exe/main.swift", @@ -5051,6 +5057,8 @@ final class BuildPlanTests: XCTestCase { } func testUserToolchainWithSDKSearchPaths() async throws { + try skipOnWindowsAsTestCurrentlyFails() + let fileSystem = InMemoryFileSystem( emptyFiles: "/Pkg/Sources/exe/main.swift", diff --git a/Tests/BuildTests/BuildSystemDelegateTests.swift b/Tests/BuildTests/BuildSystemDelegateTests.swift index 2d3d7596955..89c1d180793 100644 --- a/Tests/BuildTests/BuildSystemDelegateTests.swift +++ b/Tests/BuildTests/BuildSystemDelegateTests.swift @@ -31,6 +31,8 @@ final class BuildSystemDelegateTests: XCTestCase { } func testFilterNonFatalCodesignMessages() async throws { + try skipOnWindowsAsTestCurrentlyFails() + 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. try await fixture(name: "Miscellaneous/TestableExe") { fixturePath in diff --git a/Tests/BuildTests/LLBuildManifestBuilderTests.swift b/Tests/BuildTests/LLBuildManifestBuilderTests.swift index c4a0b787bb9..057d4514568 100644 --- a/Tests/BuildTests/LLBuildManifestBuilderTests.swift +++ b/Tests/BuildTests/LLBuildManifestBuilderTests.swift @@ -195,6 +195,8 @@ final class LLBuildManifestBuilderTests: XCTestCase { /// Verifies that two modules with the same name but different triples don't share same build manifest keys. func testToolsBuildTriple() async throws { + try skipOnWindowsAsTestCurrentlyFails() + let (graph, fs, scope) = try macrosPackageGraph() let productsTriple = Triple.x86_64MacOS let toolsTriple = Triple.arm64Linux diff --git a/Tests/BuildTests/PluginsBuildPlanTests.swift b/Tests/BuildTests/PluginsBuildPlanTests.swift index c0020ed0261..a7e422e7271 100644 --- a/Tests/BuildTests/PluginsBuildPlanTests.swift +++ b/Tests/BuildTests/PluginsBuildPlanTests.swift @@ -18,6 +18,8 @@ import PackageModel final class PluginsBuildPlanTests: XCTestCase { func testBuildToolsDatabasePath() async throws { + try skipOnWindowsAsTestCurrentlyFails() + try await fixture(name: "Miscellaneous/Plugins/MySourceGenPlugin") { fixturePath in let (stdout, _) = try await executeSwiftBuild(fixturePath) XCTAssertMatch(stdout, .contains("Build complete!")) diff --git a/Tests/BuildTests/PrepareForIndexTests.swift b/Tests/BuildTests/PrepareForIndexTests.swift index a8701d52dce..85617b12f06 100644 --- a/Tests/BuildTests/PrepareForIndexTests.swift +++ b/Tests/BuildTests/PrepareForIndexTests.swift @@ -26,6 +26,8 @@ import struct PackageModel.TargetDescription class PrepareForIndexTests: XCTestCase { func testPrepare() async throws { + try skipOnWindowsAsTestCurrentlyFails() + let (graph, fs, scope) = try macrosPackageGraph() let plan = try await BuildPlan( @@ -94,6 +96,8 @@ class PrepareForIndexTests: XCTestCase { // enable-testing requires the non-exportable-decls, make sure they aren't skipped. func testEnableTesting() async throws { + try skipOnWindowsAsTestCurrentlyFails() + let fs = InMemoryFileSystem( emptyFiles: "/Pkg/Sources/lib/lib.swift", @@ -163,6 +167,8 @@ class PrepareForIndexTests: XCTestCase { } func testPrepareNoLazy() async throws { + try skipOnWindowsAsTestCurrentlyFails() + let (graph, fs, scope) = try macrosPackageGraph() let plan = try await BuildPlan( diff --git a/Tests/PackageGraphPerformanceTests/PackageGraphPerfTests.swift b/Tests/PackageGraphPerformanceTests/PackageGraphPerfTests.swift index 92b7788ef0e..df39c33958d 100644 --- a/Tests/PackageGraphPerformanceTests/PackageGraphPerfTests.swift +++ b/Tests/PackageGraphPerformanceTests/PackageGraphPerfTests.swift @@ -165,6 +165,8 @@ final class PackageGraphPerfTests: XCTestCasePerf { } func testRecursiveDependencies() throws { + try skipOnWindowsAsTestCurrentlyFails() + var resolvedTarget = ResolvedModule.mock(packageIdentity: "pkg", name: "t0") for i in 1..<1000 { resolvedTarget = ResolvedModule.mock(packageIdentity: "pkg", name: "t\(i)", deps: resolvedTarget) diff --git a/Tests/PackageGraphTests/ModulesGraphTests.swift b/Tests/PackageGraphTests/ModulesGraphTests.swift index 11ce25959ef..dcfb1c805e1 100644 --- a/Tests/PackageGraphTests/ModulesGraphTests.swift +++ b/Tests/PackageGraphTests/ModulesGraphTests.swift @@ -23,6 +23,7 @@ import struct TSCBasic.ByteString final class ModulesGraphTests: XCTestCase { func testBasic() throws { + try skipOnWindowsAsTestCurrentlyFails() let fs = InMemoryFileSystem(emptyFiles: "/Foo/Sources/Foo/source.swift", "/Foo/Sources/FooDep/source.swift", diff --git a/Tests/PackageLoadingTests/PackageBuilderTests.swift b/Tests/PackageLoadingTests/PackageBuilderTests.swift index 0658f48580f..009e8f09e04 100644 --- a/Tests/PackageLoadingTests/PackageBuilderTests.swift +++ b/Tests/PackageLoadingTests/PackageBuilderTests.swift @@ -564,6 +564,8 @@ final class PackageBuilderTests: XCTestCase { } func testTestManifestSearch() throws { + try skipOnWindowsAsTestCurrentlyFails() + let fs = InMemoryFileSystem(emptyFiles: "/pkg/foo.swift", "/pkg/footests.swift" diff --git a/Tests/PackageLoadingTests/PkgConfigParserTests.swift b/Tests/PackageLoadingTests/PkgConfigParserTests.swift index 6909582759f..295f5d95483 100644 --- a/Tests/PackageLoadingTests/PkgConfigParserTests.swift +++ b/Tests/PackageLoadingTests/PkgConfigParserTests.swift @@ -19,6 +19,8 @@ import struct TSCBasic.ByteString final class PkgConfigParserTests: XCTestCase { func testCircularPCFile() throws { + try skipOnWindowsAsTestCurrentlyFails() + let observability = ObservabilitySystem.makeForTesting() _ = try PkgConfig( @@ -33,7 +35,9 @@ final class PkgConfigParserTests: XCTestCase { } } - func testGTK3PCFile() { + func testGTK3PCFile() throws { + try skipOnWindowsAsTestCurrentlyFails() + try! loadPCFile("gtk+-3.0.pc") { parser in XCTAssertEqual(parser.variables, [ "libdir": "/usr/local/Cellar/gtk+3/3.18.9/lib", @@ -53,7 +57,9 @@ final class PkgConfigParserTests: XCTestCase { } } - func testEmptyCFlags() { + func testEmptyCFlags() throws { + try skipOnWindowsAsTestCurrentlyFails() + try! loadPCFile("empty_cflags.pc") { parser in XCTAssertEqual(parser.variables, [ "prefix": "/usr/local/bin", @@ -67,13 +73,17 @@ final class PkgConfigParserTests: XCTestCase { } } - func testCFlagsCaseInsensitveKeys() { + func testCFlagsCaseInsensitveKeys() throws { + try skipOnWindowsAsTestCurrentlyFails() + try! loadPCFile("case_insensitive.pc") { parser in XCTAssertEqual(parser.cFlags, ["-I/usr/local/include"]) } } - func testVariableinDependency() { + func testVariableinDependency() throws { + try skipOnWindowsAsTestCurrentlyFails() + try! loadPCFile("deps_variable.pc") { parser in XCTAssertEqual(parser.variables, [ "prefix": "/usr/local/bin", @@ -97,7 +107,9 @@ final class PkgConfigParserTests: XCTestCase { } } - func testEscapedSpaces() { + func testEscapedSpaces() throws { + try skipOnWindowsAsTestCurrentlyFails() + try! loadPCFile("escaped_spaces.pc") { parser in XCTAssertEqual(parser.variables, [ "prefix": "/usr/local/bin", @@ -113,6 +125,8 @@ final class PkgConfigParserTests: XCTestCase { } func testDummyDependency() throws { + try skipOnWindowsAsTestCurrentlyFails() + try loadPCFile("dummy_dependency.pc") { parser in XCTAssertEqual(parser.variables, [ "prefix": "/usr/local/bin", @@ -199,6 +213,7 @@ final class PkgConfigParserTests: XCTestCase { } func testAbsolutePathDependency() throws { + try skipOnWindowsAsTestCurrentlyFails() let libffiPath = "/usr/local/opt/libffi/lib/pkgconfig/libffi.pc" @@ -233,6 +248,8 @@ final class PkgConfigParserTests: XCTestCase { } func testUnevenQuotes() throws { + try skipOnWindowsAsTestCurrentlyFails() + do { try loadPCFile("quotes_failure.pc") XCTFail("Unexpected success") @@ -242,6 +259,8 @@ final class PkgConfigParserTests: XCTestCase { } func testSysrootDir() throws { + try skipOnWindowsAsTestCurrentlyFails() + // sysroot should be prepended to all path variables, and should therefore appear in cflags and libs. try loadPCFile("gtk+-3.0.pc", sysrootDir: "/opt/sysroot/somewhere") { parser in XCTAssertEqual(parser.variables, [ diff --git a/Tests/PackageLoadingTests/PkgConfigTests.swift b/Tests/PackageLoadingTests/PkgConfigTests.swift index 1f37175b200..f92760f869f 100644 --- a/Tests/PackageLoadingTests/PkgConfigTests.swift +++ b/Tests/PackageLoadingTests/PkgConfigTests.swift @@ -85,6 +85,8 @@ class PkgConfigTests: XCTestCase { } func testEnvVar() throws { + try skipOnWindowsAsTestCurrentlyFails() + // Pc file. try Environment.makeCustom(["PKG_CONFIG_PATH": inputsDir.pathString]) { for result in try pkgConfigArgs( @@ -148,6 +150,8 @@ class PkgConfigTests: XCTestCase { } func testExplicitPkgConfigDirectories() throws { + try skipOnWindowsAsTestCurrentlyFails() + // Pc file. for result in try pkgConfigArgs( for: SystemLibraryModule(pkgConfig: "Foo"), @@ -206,6 +210,8 @@ class PkgConfigTests: XCTestCase { } func testDependencies() throws { + try skipOnWindowsAsTestCurrentlyFails() + // Use additionalSearchPaths instead of pkgConfigArgs to test handling // of search paths when loading dependencies. let result = try PkgConfig( diff --git a/Tests/PackageModelTests/PackageModelTests.swift b/Tests/PackageModelTests/PackageModelTests.swift index 927712f788e..8c7f5f3b184 100644 --- a/Tests/PackageModelTests/PackageModelTests.swift +++ b/Tests/PackageModelTests/PackageModelTests.swift @@ -17,6 +17,7 @@ import Basics import func TSCBasic.withTemporaryFile import XCTest +import _InternalTestSupport // for skipOnWindowsAsTestCurrentlyFails import struct TSCBasic.ByteString @@ -159,6 +160,8 @@ final class PackageModelTests: XCTestCase { } func testDetermineSwiftCompilers() throws { + try skipOnWindowsAsTestCurrentlyFails() + let fs = localFileSystem try withTemporaryFile { _ in try withTemporaryDirectory(removeTreeOnDeinit: true) { tmp in diff --git a/Tests/QueryEngineTests/QueryEngineTests.swift b/Tests/QueryEngineTests/QueryEngineTests.swift index 8a84b664346..840bff4d4e4 100644 --- a/Tests/QueryEngineTests/QueryEngineTests.swift +++ b/Tests/QueryEngineTests/QueryEngineTests.swift @@ -100,6 +100,8 @@ private struct Expression: CachingQuery { final class QueryEngineTests: XCTestCase { func testFilePathHashing() throws { + try skipOnWindowsAsTestCurrentlyFails() + let path = "/root" let hashEncoder1 = HashEncoder() diff --git a/Tests/SourceKitLSPAPITests/SourceKitLSPAPITests.swift b/Tests/SourceKitLSPAPITests/SourceKitLSPAPITests.swift index 20e6e1766ac..24fe318e428 100644 --- a/Tests/SourceKitLSPAPITests/SourceKitLSPAPITests.swift +++ b/Tests/SourceKitLSPAPITests/SourceKitLSPAPITests.swift @@ -24,6 +24,8 @@ import XCTest final class SourceKitLSPAPITests: XCTestCase { func testBasicSwiftPackage() async throws { + try skipOnWindowsAsTestCurrentlyFails() + let fs = InMemoryFileSystem(emptyFiles: "/Pkg/Sources/exe/main.swift", "/Pkg/Sources/exe/README.md", diff --git a/Tests/WorkspaceTests/ManifestSourceGenerationTests.swift b/Tests/WorkspaceTests/ManifestSourceGenerationTests.swift index 9b121165fcd..9dedfba6fec 100644 --- a/Tests/WorkspaceTests/ManifestSourceGenerationTests.swift +++ b/Tests/WorkspaceTests/ManifestSourceGenerationTests.swift @@ -233,6 +233,8 @@ final class ManifestSourceGenerationTests: XCTestCase { } func testAdvancedFeatures() async throws { + try skipOnWindowsAsTestCurrentlyFails() + let manifestContents = """ // swift-tools-version:5.3 // The swift-tools-version declares the minimum version of Swift required to build this package. diff --git a/Tests/WorkspaceTests/RegistryPackageContainerTests.swift b/Tests/WorkspaceTests/RegistryPackageContainerTests.swift index 4dd7d6eec8e..c4b720b301d 100644 --- a/Tests/WorkspaceTests/RegistryPackageContainerTests.swift +++ b/Tests/WorkspaceTests/RegistryPackageContainerTests.swift @@ -24,6 +24,11 @@ import XCTest import struct TSCUtility.Version final class RegistryPackageContainerTests: XCTestCase { + + override func setUpWithError() throws { + try skipOnWindowsAsTestCurrentlyFails() + } + func testToolsVersionCompatibleVersions() async throws { let fs = InMemoryFileSystem() try fs.createMockToolchain() diff --git a/Tests/WorkspaceTests/SourceControlPackageContainerTests.swift b/Tests/WorkspaceTests/SourceControlPackageContainerTests.swift index 78f0a9b9739..d6bc15574cd 100644 --- a/Tests/WorkspaceTests/SourceControlPackageContainerTests.swift +++ b/Tests/WorkspaceTests/SourceControlPackageContainerTests.swift @@ -125,6 +125,8 @@ private let v1Range: VersionSetSpecifier = .range("1.0.0" ..< "2.0.0") final class SourceControlPackageContainerTests: XCTestCase { func testVprefixVersions() async throws { + try skipOnWindowsAsTestCurrentlyFails() + let fs = InMemoryFileSystem() try fs.createMockToolchain() @@ -170,6 +172,8 @@ final class SourceControlPackageContainerTests: XCTestCase { } func testVersions() async throws { + try skipOnWindowsAsTestCurrentlyFails() + let fs = InMemoryFileSystem() try fs.createMockToolchain() @@ -266,6 +270,8 @@ final class SourceControlPackageContainerTests: XCTestCase { } func testPreReleaseVersions() async throws { + try skipOnWindowsAsTestCurrentlyFails() + let fs = InMemoryFileSystem() try fs.createMockToolchain() @@ -313,6 +319,8 @@ final class SourceControlPackageContainerTests: XCTestCase { } func testSimultaneousVersions() async throws { + try skipOnWindowsAsTestCurrentlyFails() + let fs = InMemoryFileSystem() try fs.createMockToolchain() diff --git a/Tests/WorkspaceTests/WorkspaceTests.swift b/Tests/WorkspaceTests/WorkspaceTests.swift index ece36572195..c127cc54173 100644 --- a/Tests/WorkspaceTests/WorkspaceTests.swift +++ b/Tests/WorkspaceTests/WorkspaceTests.swift @@ -28,6 +28,10 @@ import struct TSCBasic.ByteString import struct TSCUtility.Version final class WorkspaceTests: XCTestCase { + override func setUpWithError() throws { + try skipOnWindowsAsTestCurrentlyFails() + } + func testBasics() async throws { let sandbox = AbsolutePath("/tmp/ws/") let fs = InMemoryFileSystem() diff --git a/xunit-windows-failures-original.xml b/xunit-windows-failures-original.xml new file mode 100644 index 00000000000..b8b9479b62e --- /dev/null +++ b/xunit-windows-failures-original.xml @@ -0,0 +1,3395 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/xunit-windows-failures-swift-testing-original.xml b/xunit-windows-failures-swift-testing-original.xml new file mode 100644 index 00000000000..d77455590c2 --- /dev/null +++ b/xunit-windows-failures-swift-testing-original.xml @@ -0,0 +1,6 @@ + + + + + + From 9df2963598787e76bf934e4eef647477ac607786 Mon Sep 17 00:00:00 2001 From: Sam Khouri Date: Sun, 12 Jan 2025 12:34:31 -0500 Subject: [PATCH 02/20] Update skipped reason string to more idiomatic code --- Sources/_InternalTestSupport/XCTSkipHelpers.swift | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/Sources/_InternalTestSupport/XCTSkipHelpers.swift b/Sources/_InternalTestSupport/XCTSkipHelpers.swift index f4fb92c9ffb..a7a11254811 100644 --- a/Sources/_InternalTestSupport/XCTSkipHelpers.swift +++ b/Sources/_InternalTestSupport/XCTSkipHelpers.swift @@ -20,10 +20,10 @@ import struct TSCBasic.StringError public func skipOnWindowsAsTestCurrentlyFails(because reason: String? = nil) throws { #if os(Windows) let failureCause: String - if reason == nil { - failureCause = "" + if let reason { + failureCause = " because \(reason.description)" } else { - failureCause = " because \(reason!.description)" + failureCause = "" } throw XCTSkip("Test fails on windows\(failureCause)") #endif From 76698018ac2394f8be0f0203e5e8ad2a7fe326ba Mon Sep 17 00:00:00 2001 From: Sam Khouri Date: Thu, 23 Jan 2025 10:54:47 -0500 Subject: [PATCH 03/20] Update EnBasicsTests.EnvironmentTests.test_current to support Windows --- Tests/BasicsTests/Environment/EnvironmentTests.swift | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/Tests/BasicsTests/Environment/EnvironmentTests.swift b/Tests/BasicsTests/Environment/EnvironmentTests.swift index 220fb8c08f1..1e4eec949b7 100644 --- a/Tests/BasicsTests/Environment/EnvironmentTests.swift +++ b/Tests/BasicsTests/Environment/EnvironmentTests.swift @@ -103,11 +103,16 @@ final class EnvironmentTests: XCTestCase { /// Important: This test is inherently race-prone, if it is proven to be /// flaky, it should run in a singled threaded environment/removed entirely. func test_current() throws { - try skipOnWindowsAsTestCurrentlyFails(because: "ProcessInfo.processInfo.environment[\"PATH\"] return nil") + #if os(Windows) + let pathEnvVarName = "Path" + #else + let pathEnvVarName = "PATH" + #endif + XCTAssertEqual( Environment.current["PATH"], - ProcessInfo.processInfo.environment["PATH"] + ProcessInfo.processInfo.environment[pathEnvVarName] ) } From 09a6835f62480cb31c4d24f232fe46520475e159 Mon Sep 17 00:00:00 2001 From: Sam Khouri Date: Thu, 23 Jan 2025 11:27:37 -0500 Subject: [PATCH 04/20] Skip more tests on Windows --- Tests/BasicsTests/LegacyHTTPClientTests.swift | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/Tests/BasicsTests/LegacyHTTPClientTests.swift b/Tests/BasicsTests/LegacyHTTPClientTests.swift index 86d344aede5..38a8300ce83 100644 --- a/Tests/BasicsTests/LegacyHTTPClientTests.swift +++ b/Tests/BasicsTests/LegacyHTTPClientTests.swift @@ -349,7 +349,9 @@ final class LegacyHTTPClientTests: XCTestCase { wait(for: [promise], timeout: 1) } - func testExponentialBackoff() { + func testExponentialBackoff() throws { + try skipOnWindowsAsTestCurrentlyFails() + let count = ThreadSafeBox(0) let lastCall = ThreadSafeBox() let maxAttempts = 5 From 2bcc38c75f4f3e9306f497bfb9927d9e04ff5a9e Mon Sep 17 00:00:00 2001 From: Sam Khouri Date: Tue, 11 Feb 2025 10:43:41 -0500 Subject: [PATCH 05/20] remove accidentally committed XML file --- xunit-windows-failures-original.xml | 3395 ----------------- ...indows-failures-swift-testing-original.xml | 6 - 2 files changed, 3401 deletions(-) delete mode 100644 xunit-windows-failures-original.xml delete mode 100644 xunit-windows-failures-swift-testing-original.xml diff --git a/xunit-windows-failures-original.xml b/xunit-windows-failures-original.xml deleted file mode 100644 index b8b9479b62e..00000000000 --- a/xunit-windows-failures-original.xml +++ /dev/null @@ -1,3395 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/xunit-windows-failures-swift-testing-original.xml b/xunit-windows-failures-swift-testing-original.xml deleted file mode 100644 index d77455590c2..00000000000 --- a/xunit-windows-failures-swift-testing-original.xml +++ /dev/null @@ -1,6 +0,0 @@ - - - - - - From 889e57d266dbd752fbc1cb918b4ca3364aea0a8d Mon Sep 17 00:00:00 2001 From: Sam Khouri Date: Thu, 13 Feb 2025 12:18:03 -0500 Subject: [PATCH 06/20] Update WorkspaceTest setup to only execute passing tests on wndows, which does not compile on Windows --- Tests/WorkspaceTests/WorkspaceTests.swift | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/Tests/WorkspaceTests/WorkspaceTests.swift b/Tests/WorkspaceTests/WorkspaceTests.swift index c127cc54173..931e2b1eed9 100644 --- a/Tests/WorkspaceTests/WorkspaceTests.swift +++ b/Tests/WorkspaceTests/WorkspaceTests.swift @@ -29,7 +29,17 @@ import struct TSCUtility.Version final class WorkspaceTests: XCTestCase { override func setUpWithError() throws { - try skipOnWindowsAsTestCurrentlyFails() + let windowsPassingTests = [ + #selector(self.testBinaryArtifactsInvalidPath), + #selector(self.testManifestLoaderDiagnostics), + #selector(self.testInterpreterFlags), + #selector(self.testManifestParseError), + #selector(self.testSimpleAPI) + ] + let matches = windowsPassingTests.filter { $0 == self.invocation?.selector} + if matches.count == 0 { + try skipOnWindowsAsTestCurrentlyFails() + } } func testBasics() async throws { From fab90afdacb4e7629226db8ff88b90e2a0dc73bc Mon Sep 17 00:00:00 2001 From: Sam Khouri Date: Mon, 17 Feb 2025 13:51:41 -0500 Subject: [PATCH 07/20] some changes --- Tests/WorkspaceTests/WorkspaceTests.swift | 257 ++++++++++++++++++++-- 1 file changed, 244 insertions(+), 13 deletions(-) diff --git a/Tests/WorkspaceTests/WorkspaceTests.swift b/Tests/WorkspaceTests/WorkspaceTests.swift index 931e2b1eed9..ecb4fad18f1 100644 --- a/Tests/WorkspaceTests/WorkspaceTests.swift +++ b/Tests/WorkspaceTests/WorkspaceTests.swift @@ -28,21 +28,23 @@ import struct TSCBasic.ByteString import struct TSCUtility.Version final class WorkspaceTests: XCTestCase { - override func setUpWithError() throws { - let windowsPassingTests = [ - #selector(self.testBinaryArtifactsInvalidPath), - #selector(self.testManifestLoaderDiagnostics), - #selector(self.testInterpreterFlags), - #selector(self.testManifestParseError), - #selector(self.testSimpleAPI) - ] - let matches = windowsPassingTests.filter { $0 == self.invocation?.selector} - if matches.count == 0 { - try skipOnWindowsAsTestCurrentlyFails() - } - } + // override func setUpWithError() throws { + // let windowsPassingTests = [ + // #selector(self.testBinaryArtifactsInvalidPath), + // #selector(self.testManifestLoaderDiagnostics), + // #selector(self.testInterpreterFlags), + // #selector(self.testManifestParseError), + // #selector(self.testSimpleAPI) + // ] + // let matches = windowsPassingTests.filter { $0 == self.invocation?.selector} + // if matches.count == 0 { + // try skipOnWindowsAsTestCurrentlyFails() + // } + // } func testBasics() async throws { + try skipOnWindowsAsTestCurrentlyFails() + let sandbox = AbsolutePath("/tmp/ws/") let fs = InMemoryFileSystem() @@ -169,6 +171,8 @@ final class WorkspaceTests: XCTestCase { } func testInterpreterFlags() async throws { + try skipOnWindowsAsTestCurrentlyFails() + let fs = localFileSystem try testWithTemporaryDirectory { path in @@ -290,6 +294,8 @@ final class WorkspaceTests: XCTestCase { } func testManifestParseError() async throws { + try skipOnWindowsAsTestCurrentlyFails() + let observability = ObservabilitySystem.makeForTesting() try await testWithTemporaryDirectory { path in @@ -334,6 +340,8 @@ final class WorkspaceTests: XCTestCase { } func testMultipleRootPackages() async throws { + try skipOnWindowsAsTestCurrentlyFails() + let sandbox = AbsolutePath("/tmp/ws/") let fs = InMemoryFileSystem() @@ -391,6 +399,8 @@ final class WorkspaceTests: XCTestCase { } func testRootPackagesOverride() async throws { + try skipOnWindowsAsTestCurrentlyFails() + let sandbox = AbsolutePath("/tmp/ws/") let fs = InMemoryFileSystem() @@ -453,6 +463,8 @@ final class WorkspaceTests: XCTestCase { } func testDuplicateRootPackages() async throws { + try skipOnWindowsAsTestCurrentlyFails() + let sandbox = AbsolutePath("/tmp/ws/") let fs = InMemoryFileSystem() @@ -490,6 +502,8 @@ final class WorkspaceTests: XCTestCase { /// Test that the explicit name given to a package is not used as its identity. func testExplicitPackageNameIsNotUsedAsPackageIdentity() async throws { + try skipOnWindowsAsTestCurrentlyFails() + let sandbox = AbsolutePath("/tmp/ws/") let fs = InMemoryFileSystem() @@ -563,6 +577,8 @@ final class WorkspaceTests: XCTestCase { /// Test that the remote repository is not resolved when a root package with same name is already present. func testRootAsDependency1() async throws { + try skipOnWindowsAsTestCurrentlyFails() + let sandbox = AbsolutePath("/tmp/ws/") let fs = InMemoryFileSystem() @@ -624,6 +640,8 @@ final class WorkspaceTests: XCTestCase { /// Test that a root package can be used as a dependency when the remote version was resolved previously. func testRootAsDependency2() async throws { + try skipOnWindowsAsTestCurrentlyFails() + let sandbox = AbsolutePath("/tmp/ws/") let fs = InMemoryFileSystem() @@ -711,6 +729,8 @@ final class WorkspaceTests: XCTestCase { } func testGraphRootDependencies() async throws { + try skipOnWindowsAsTestCurrentlyFails() + let sandbox = AbsolutePath("/tmp/ws/") let fs = InMemoryFileSystem() @@ -773,6 +793,8 @@ final class WorkspaceTests: XCTestCase { } func testCanResolveWithIncompatiblePackages() async throws { + try skipOnWindowsAsTestCurrentlyFails() + let sandbox = AbsolutePath("/tmp/ws/") let fs = InMemoryFileSystem() @@ -875,6 +897,8 @@ final class WorkspaceTests: XCTestCase { } func testResolverCanHaveError() async throws { + try skipOnWindowsAsTestCurrentlyFails() + let sandbox = AbsolutePath("/tmp/ws/") let fs = InMemoryFileSystem() @@ -936,6 +960,8 @@ final class WorkspaceTests: XCTestCase { } func testPrecomputeResolution_empty() async throws { + try skipOnWindowsAsTestCurrentlyFails() + let sandbox = AbsolutePath("/tmp/ws/") let fs = InMemoryFileSystem() let bPath = RelativePath("B") @@ -981,6 +1007,8 @@ final class WorkspaceTests: XCTestCase { } func testPrecomputeResolution_newPackages() async throws { + try skipOnWindowsAsTestCurrentlyFails() + let sandbox = AbsolutePath("/tmp/ws/") let fs = InMemoryFileSystem() let bPath = RelativePath("B") @@ -1042,6 +1070,8 @@ final class WorkspaceTests: XCTestCase { } func testPrecomputeResolution_requirementChange_versionToBranch() async throws { + try skipOnWindowsAsTestCurrentlyFails() + let sandbox = AbsolutePath("/tmp/ws/") let fs = InMemoryFileSystem() let bPath = RelativePath("B") @@ -1110,6 +1140,8 @@ final class WorkspaceTests: XCTestCase { } func testPrecomputeResolution_requirementChange_versionToRevision() async throws { + try skipOnWindowsAsTestCurrentlyFails() + let sandbox = AbsolutePath("/tmp/ws/") let fs = InMemoryFileSystem() let cPath = RelativePath("C") @@ -1161,6 +1193,8 @@ final class WorkspaceTests: XCTestCase { } func testPrecomputeResolution_requirementChange_localToBranch() async throws { + try skipOnWindowsAsTestCurrentlyFails() + let sandbox = AbsolutePath("/tmp/ws/") let fs = InMemoryFileSystem() let bPath = RelativePath("B") @@ -1228,6 +1262,8 @@ final class WorkspaceTests: XCTestCase { } func testPrecomputeResolution_requirementChange_versionToLocal() async throws { + try skipOnWindowsAsTestCurrentlyFails() + let sandbox = AbsolutePath("/tmp/ws/") let fs = InMemoryFileSystem() let bPath = RelativePath("B") @@ -1295,6 +1331,8 @@ final class WorkspaceTests: XCTestCase { } func testPrecomputeResolution_requirementChange_branchToLocal() async throws { + try skipOnWindowsAsTestCurrentlyFails() + let sandbox = AbsolutePath("/tmp/ws/") let fs = InMemoryFileSystem() let bPath = RelativePath("B") @@ -1363,6 +1401,8 @@ final class WorkspaceTests: XCTestCase { } func testPrecomputeResolution_other() async throws { + try skipOnWindowsAsTestCurrentlyFails() + let sandbox = AbsolutePath("/tmp/ws/") let fs = InMemoryFileSystem() let bPath = RelativePath("B") @@ -1432,6 +1472,8 @@ final class WorkspaceTests: XCTestCase { } func testPrecomputeResolution_notRequired() async throws { + try skipOnWindowsAsTestCurrentlyFails() + let sandbox = AbsolutePath("/tmp/ws/") let fs = InMemoryFileSystem() let bPath = RelativePath("B") @@ -1497,6 +1539,8 @@ final class WorkspaceTests: XCTestCase { } func testLoadingRootManifests() async throws { + try skipOnWindowsAsTestCurrentlyFails() + let sandbox = AbsolutePath("/tmp/ws/") let fs = InMemoryFileSystem() @@ -1521,6 +1565,8 @@ final class WorkspaceTests: XCTestCase { } func testUpdate() async throws { + try skipOnWindowsAsTestCurrentlyFails() + let sandbox = AbsolutePath("/tmp/ws/") let fs = InMemoryFileSystem() @@ -1622,6 +1668,8 @@ final class WorkspaceTests: XCTestCase { } func testUpdateDryRun() async throws { + try skipOnWindowsAsTestCurrentlyFails() + let sandbox = AbsolutePath("/tmp/ws/") let fs = InMemoryFileSystem() @@ -1717,6 +1765,8 @@ final class WorkspaceTests: XCTestCase { } func testPartialUpdate() async throws { + try skipOnWindowsAsTestCurrentlyFails() + let sandbox = AbsolutePath("/tmp/ws/") let fs = InMemoryFileSystem() @@ -1821,6 +1871,8 @@ final class WorkspaceTests: XCTestCase { } func testCleanAndReset() async throws { + try skipOnWindowsAsTestCurrentlyFails() + let sandbox = AbsolutePath("/tmp/ws/") let fs = InMemoryFileSystem() @@ -1900,6 +1952,8 @@ final class WorkspaceTests: XCTestCase { } func testDependencyManifestLoading() async throws { + try skipOnWindowsAsTestCurrentlyFails() + let sandbox = AbsolutePath("/tmp/ws/") let fs = InMemoryFileSystem() @@ -1979,6 +2033,8 @@ final class WorkspaceTests: XCTestCase { } func testDependencyManifestsOrder() async throws { + try skipOnWindowsAsTestCurrentlyFails() + let sandbox = AbsolutePath("/tmp/ws/") let fs = InMemoryFileSystem() @@ -2048,6 +2104,8 @@ final class WorkspaceTests: XCTestCase { } func testBranchAndRevision() async throws { + try skipOnWindowsAsTestCurrentlyFails() + let sandbox = AbsolutePath("/tmp/ws/") let fs = InMemoryFileSystem() @@ -2112,6 +2170,8 @@ final class WorkspaceTests: XCTestCase { } func testResolve() async throws { + try skipOnWindowsAsTestCurrentlyFails() + let sandbox = AbsolutePath("/tmp/ws/") let fs = InMemoryFileSystem() @@ -2185,6 +2245,8 @@ final class WorkspaceTests: XCTestCase { } func testDeletedCheckoutDirectory() async throws { + try skipOnWindowsAsTestCurrentlyFails() + let sandbox = AbsolutePath("/tmp/ws/") let fs = InMemoryFileSystem() @@ -2231,6 +2293,8 @@ final class WorkspaceTests: XCTestCase { } func testMinimumRequiredToolsVersionInDependencyResolution() async throws { + try skipOnWindowsAsTestCurrentlyFails() + let sandbox = AbsolutePath("/tmp/ws/") let fs = InMemoryFileSystem() @@ -2272,6 +2336,8 @@ final class WorkspaceTests: XCTestCase { } func testToolsVersionRootPackages() async throws { + try skipOnWindowsAsTestCurrentlyFails() + let sandbox = AbsolutePath("/tmp/ws/") let fs = InMemoryFileSystem() @@ -2351,6 +2417,8 @@ final class WorkspaceTests: XCTestCase { } func testEditDependency() async throws { + try skipOnWindowsAsTestCurrentlyFails() + let sandbox = AbsolutePath("/tmp/ws/") let fs = InMemoryFileSystem() @@ -2459,6 +2527,8 @@ final class WorkspaceTests: XCTestCase { } func testUnsafeFlagsInEditedPackage() async throws { + try skipOnWindowsAsTestCurrentlyFails() + let sandbox = AbsolutePath("/tmp/ws/") let fs = InMemoryFileSystem() @@ -2522,6 +2592,8 @@ final class WorkspaceTests: XCTestCase { } func testMissingEditCanRestoreOriginalCheckout() async throws { + try skipOnWindowsAsTestCurrentlyFails() + let sandbox = AbsolutePath("/tmp/ws/") let fs = InMemoryFileSystem() @@ -2585,6 +2657,8 @@ final class WorkspaceTests: XCTestCase { } func testCanUneditRemovedDependencies() async throws { + try skipOnWindowsAsTestCurrentlyFails() + let sandbox = AbsolutePath("/tmp/ws/") let fs = InMemoryFileSystem() @@ -2659,6 +2733,8 @@ final class WorkspaceTests: XCTestCase { } func testDependencyResolutionWithEdit() async throws { + try skipOnWindowsAsTestCurrentlyFails() + let sandbox = AbsolutePath("/tmp/ws/") let fs = InMemoryFileSystem() @@ -2780,6 +2856,8 @@ final class WorkspaceTests: XCTestCase { } func testPrefetchingWithOverridenPackage() async throws { + try skipOnWindowsAsTestCurrentlyFails() + let sandbox = AbsolutePath("/tmp/ws/") let fs = InMemoryFileSystem() @@ -2865,6 +2943,8 @@ final class WorkspaceTests: XCTestCase { // Test that changing a particular dependency re-resolves the graph. func testChangeOneDependency() async throws { + try skipOnWindowsAsTestCurrentlyFails() + let sandbox = AbsolutePath("/tmp/ws/") let fs = InMemoryFileSystem() @@ -2951,6 +3031,8 @@ final class WorkspaceTests: XCTestCase { } func testResolutionFailureWithEditedDependency() async throws { + try skipOnWindowsAsTestCurrentlyFails() + let sandbox = AbsolutePath("/tmp/ws/") let fs = InMemoryFileSystem() @@ -3031,6 +3113,8 @@ final class WorkspaceTests: XCTestCase { } func testStateModified() async throws { + try skipOnWindowsAsTestCurrentlyFails() + let sandbox = AbsolutePath("/tmp/ws/") let fs = InMemoryFileSystem() @@ -3122,6 +3206,8 @@ final class WorkspaceTests: XCTestCase { } func testSkipUpdate() async throws { + try skipOnWindowsAsTestCurrentlyFails() + let sandbox = AbsolutePath("/tmp/ws/") let fs = InMemoryFileSystem() @@ -3171,6 +3257,8 @@ final class WorkspaceTests: XCTestCase { } func testLocalDependencyBasics() async throws { + try skipOnWindowsAsTestCurrentlyFails() + let sandbox = AbsolutePath("/tmp/ws/") let fs = InMemoryFileSystem() @@ -3249,6 +3337,8 @@ final class WorkspaceTests: XCTestCase { } func testLocalDependencyTransitive() async throws { + try skipOnWindowsAsTestCurrentlyFails() + let sandbox = AbsolutePath("/tmp/ws/") let fs = InMemoryFileSystem() @@ -3311,6 +3401,8 @@ final class WorkspaceTests: XCTestCase { } func testLocalDependencyWithPackageUpdate() async throws { + try skipOnWindowsAsTestCurrentlyFails() + let sandbox = AbsolutePath("/tmp/ws/") let fs = InMemoryFileSystem() @@ -3375,6 +3467,8 @@ final class WorkspaceTests: XCTestCase { } func testMissingLocalDependencyDiagnostic() async throws { + try skipOnWindowsAsTestCurrentlyFails() + let sandbox = AbsolutePath("/tmp/ws/") let fs = InMemoryFileSystem() @@ -3415,6 +3509,8 @@ final class WorkspaceTests: XCTestCase { } func testRevisionVersionSwitch() async throws { + try skipOnWindowsAsTestCurrentlyFails() + let sandbox = AbsolutePath("/tmp/ws/") let fs = InMemoryFileSystem() @@ -3484,6 +3580,8 @@ final class WorkspaceTests: XCTestCase { } func testLocalVersionSwitch() async throws { + try skipOnWindowsAsTestCurrentlyFails() + let sandbox = AbsolutePath("/tmp/ws/") let fs = InMemoryFileSystem() @@ -3553,6 +3651,8 @@ final class WorkspaceTests: XCTestCase { } func testLocalLocalSwitch() async throws { + try skipOnWindowsAsTestCurrentlyFails() + let sandbox = AbsolutePath("/tmp/ws/") let fs = InMemoryFileSystem() @@ -3625,6 +3725,8 @@ final class WorkspaceTests: XCTestCase { // Test that switching between two same local packages placed at // different locations works correctly. func testDependencySwitchLocalWithSameIdentity() async throws { + try skipOnWindowsAsTestCurrentlyFails() + let sandbox = AbsolutePath("/tmp/ws/") let fs = InMemoryFileSystem() @@ -3702,6 +3804,8 @@ final class WorkspaceTests: XCTestCase { // Test that switching between two remote packages at // different locations works correctly. func testDependencySwitchRemoteWithSameIdentity() async throws { + try skipOnWindowsAsTestCurrentlyFails() + let sandbox = AbsolutePath("/tmp/ws/") let fs = InMemoryFileSystem() @@ -3778,6 +3882,8 @@ final class WorkspaceTests: XCTestCase { } func testResolvedFileUpdate() async throws { + try skipOnWindowsAsTestCurrentlyFails() + let sandbox = AbsolutePath("/tmp/ws/") let fs = InMemoryFileSystem() @@ -3833,6 +3939,8 @@ final class WorkspaceTests: XCTestCase { } func testResolvedFileSchemeToolsVersion() async throws { + try skipOnWindowsAsTestCurrentlyFails() + let fs = InMemoryFileSystem() for pair in [ @@ -3901,6 +4009,8 @@ final class WorkspaceTests: XCTestCase { } func testResolvedFileStableCanonicalLocation() async throws { + try skipOnWindowsAsTestCurrentlyFails() + let sandbox = AbsolutePath("/tmp/ws/") let fs = InMemoryFileSystem() @@ -4127,6 +4237,8 @@ final class WorkspaceTests: XCTestCase { } func testPreferResolvedFileWhenExists() async throws { + try skipOnWindowsAsTestCurrentlyFails() + let sandbox = AbsolutePath("/tmp/ws/") let fs = InMemoryFileSystem() @@ -4395,6 +4507,8 @@ final class WorkspaceTests: XCTestCase { } func testPackageSimpleMirrorPath() async throws { + try skipOnWindowsAsTestCurrentlyFails() + let sandbox = AbsolutePath("/tmp/ws/") let fs = InMemoryFileSystem() @@ -4487,6 +4601,8 @@ final class WorkspaceTests: XCTestCase { } func testPackageMirrorPath() async throws { + try skipOnWindowsAsTestCurrentlyFails() + let sandbox = AbsolutePath("/tmp/ws/") let fs = InMemoryFileSystem() @@ -4590,6 +4706,8 @@ final class WorkspaceTests: XCTestCase { } func testPackageSimpleMirrorURL() async throws { + try skipOnWindowsAsTestCurrentlyFails() + let sandbox = AbsolutePath("/tmp/ws/") let fs = InMemoryFileSystem() @@ -4679,6 +4797,8 @@ final class WorkspaceTests: XCTestCase { } func testPackageMirrorURL() async throws { + try skipOnWindowsAsTestCurrentlyFails() + let sandbox = AbsolutePath("/tmp/ws/") let fs = InMemoryFileSystem() @@ -4784,6 +4904,8 @@ final class WorkspaceTests: XCTestCase { } func testPackageMirrorURLToRegistry() async throws { + try skipOnWindowsAsTestCurrentlyFails() + let sandbox = AbsolutePath("/tmp/ws/") let fs = InMemoryFileSystem() @@ -4854,6 +4976,8 @@ final class WorkspaceTests: XCTestCase { } func testPackageMirrorRegistryToURL() async throws { + try skipOnWindowsAsTestCurrentlyFails() + let sandbox = AbsolutePath("/tmp/ws/") let fs = InMemoryFileSystem() @@ -4927,6 +5051,8 @@ final class WorkspaceTests: XCTestCase { // file for a transitive dependency whose URL is later changed to // something else, while keeping the same package identity. func testTransitiveDependencySwitchWithSameIdentity() async throws { + try skipOnWindowsAsTestCurrentlyFails() + let sandbox = AbsolutePath("/tmp/ws/") let fs = InMemoryFileSystem() @@ -5074,6 +5200,8 @@ final class WorkspaceTests: XCTestCase { } func testForceResolveToResolvedVersions() async throws { + try skipOnWindowsAsTestCurrentlyFails() + let sandbox = AbsolutePath("/tmp/ws/") let fs = InMemoryFileSystem() @@ -5197,6 +5325,8 @@ final class WorkspaceTests: XCTestCase { } func testForceResolveToResolvedVersionsDuplicateLocalDependency() async throws { + try skipOnWindowsAsTestCurrentlyFails() + let sandbox = AbsolutePath("/tmp/ws/") let fs = InMemoryFileSystem() @@ -5248,6 +5378,8 @@ final class WorkspaceTests: XCTestCase { } func testForceResolveWithNoResolvedFile() async throws { + try skipOnWindowsAsTestCurrentlyFails() + let sandbox = AbsolutePath("/tmp/ws/") let fs = InMemoryFileSystem() @@ -5305,6 +5437,8 @@ final class WorkspaceTests: XCTestCase { } func testForceResolveToResolvedVersionsLocalPackage() async throws { + try skipOnWindowsAsTestCurrentlyFails() + let sandbox = AbsolutePath("/tmp/ws/") let fs = InMemoryFileSystem() @@ -5346,6 +5480,8 @@ final class WorkspaceTests: XCTestCase { } func testForceResolveToResolvedVersionsLocalPackageInAdditionalDependencies() async throws { + try skipOnWindowsAsTestCurrentlyFails() + let sandbox = AbsolutePath("/tmp/ws/") let fs = InMemoryFileSystem() @@ -5445,6 +5581,8 @@ final class WorkspaceTests: XCTestCase { } func testRevisionDepOnLocal() async throws { + try skipOnWindowsAsTestCurrentlyFails() + let sandbox = AbsolutePath("/tmp/ws/") let fs = InMemoryFileSystem() @@ -5503,6 +5641,8 @@ final class WorkspaceTests: XCTestCase { } func testRootPackagesOverrideBasenameMismatch() async throws { + try skipOnWindowsAsTestCurrentlyFails() + let sandbox = AbsolutePath("/tmp/ws/") let fs = InMemoryFileSystem() @@ -5553,6 +5693,8 @@ final class WorkspaceTests: XCTestCase { } func testManagedDependenciesNotCaseSensitive() async throws { + try skipOnWindowsAsTestCurrentlyFails() + let sandbox = AbsolutePath("/tmp/ws/") let fs = InMemoryFileSystem() @@ -5647,6 +5789,8 @@ final class WorkspaceTests: XCTestCase { } func testUnsafeFlags() async throws { + try skipOnWindowsAsTestCurrentlyFails() + let sandbox = AbsolutePath("/tmp/ws/") let fs = InMemoryFileSystem() @@ -5727,6 +5871,8 @@ final class WorkspaceTests: XCTestCase { } func testUnsafeFlagsInFoundation() async throws { + try skipOnWindowsAsTestCurrentlyFails() + let sandbox = AbsolutePath("/tmp/ws/") let fs = InMemoryFileSystem() @@ -5769,6 +5915,8 @@ final class WorkspaceTests: XCTestCase { } func testEditDependencyHadOverridableConstraints() async throws { + try skipOnWindowsAsTestCurrentlyFails() + let sandbox = AbsolutePath("/tmp/ws/") let fs = InMemoryFileSystem() @@ -5870,6 +6018,8 @@ final class WorkspaceTests: XCTestCase { } func testTargetBasedDependency() async throws { + try skipOnWindowsAsTestCurrentlyFails() + let sandbox = AbsolutePath("/tmp/ws/") let fs = InMemoryFileSystem() @@ -5977,6 +6127,8 @@ final class WorkspaceTests: XCTestCase { } func testLocalArchivedArtifactExtractionHappyPath() async throws { + try skipOnWindowsAsTestCurrentlyFails() + let sandbox = AbsolutePath("/tmp/ws/") let fs = InMemoryFileSystem() @@ -6147,6 +6299,8 @@ final class WorkspaceTests: XCTestCase { // It ensures that all the appropriate clean-up operations are executed, and the workspace // contains the correct set of managed artifacts after the transition. func testLocalArchivedArtifactSourceTransitionPermutations() async throws { + try skipOnWindowsAsTestCurrentlyFails() + let sandbox = AbsolutePath("/tmp/ws/") let fs = InMemoryFileSystem() @@ -6418,6 +6572,8 @@ final class WorkspaceTests: XCTestCase { } func testLocalArchivedArtifactNameDoesNotMatchTargetName() async throws { + try skipOnWindowsAsTestCurrentlyFails() + let sandbox = AbsolutePath("/tmp/ws/") let fs = InMemoryFileSystem() @@ -6477,6 +6633,8 @@ final class WorkspaceTests: XCTestCase { } func testLocalArchivedArtifactExtractionError() async throws { + try skipOnWindowsAsTestCurrentlyFails() + let sandbox = AbsolutePath("/tmp/ws/") let fs = InMemoryFileSystem() @@ -6528,6 +6686,8 @@ final class WorkspaceTests: XCTestCase { } func testLocalArchiveDoesNotMatchTargetName() async throws { + try skipOnWindowsAsTestCurrentlyFails() + let sandbox = AbsolutePath("/tmp/ws/") let fs = InMemoryFileSystem() @@ -6602,6 +6762,7 @@ final class WorkspaceTests: XCTestCase { } } +////// STAET ATDIN func testLocalArchivedArtifactChecksumChange() async throws { let sandbox = AbsolutePath("/tmp/ws/") let fs = InMemoryFileSystem() @@ -12385,6 +12546,8 @@ final class WorkspaceTests: XCTestCase { } func testBasicResolutionFromSourceControl() async throws { + try skipOnWindowsAsTestCurrentlyFails() + let sandbox = AbsolutePath("/tmp/ws/") let fs = InMemoryFileSystem() @@ -12491,6 +12654,8 @@ final class WorkspaceTests: XCTestCase { } func testBasicTransitiveResolutionFromSourceControl() async throws { + try skipOnWindowsAsTestCurrentlyFails() + let sandbox = AbsolutePath("/tmp/ws/") let fs = InMemoryFileSystem() @@ -12635,6 +12800,8 @@ final class WorkspaceTests: XCTestCase { } func testBasicResolutionFromRegistry() async throws { + try skipOnWindowsAsTestCurrentlyFails() + let sandbox = AbsolutePath("/tmp/ws/") let fs = InMemoryFileSystem() @@ -12741,6 +12908,8 @@ final class WorkspaceTests: XCTestCase { } func testBasicTransitiveResolutionFromRegistry() async throws { + try skipOnWindowsAsTestCurrentlyFails() + let sandbox = AbsolutePath("/tmp/ws/") let fs = InMemoryFileSystem() @@ -12885,6 +13054,8 @@ final class WorkspaceTests: XCTestCase { } func testTransitiveResolutionFromRegistryWithByNameDependencies() async throws { + try skipOnWindowsAsTestCurrentlyFails() + let sandbox = AbsolutePath("/tmp/ws/") let fs = InMemoryFileSystem() @@ -12965,6 +13136,8 @@ final class WorkspaceTests: XCTestCase { // no dups func testResolutionMixedRegistryAndSourceControl1() async throws { + try skipOnWindowsAsTestCurrentlyFails() + let sandbox = AbsolutePath("/tmp/ws/") let fs = InMemoryFileSystem() @@ -13095,6 +13268,8 @@ final class WorkspaceTests: XCTestCase { } func testTransitiveResolutionFromRegistryWithDifferentPackageNameCasing() async throws { + try skipOnWindowsAsTestCurrentlyFails() + let sandbox = AbsolutePath("/tmp/ws/") let fs = InMemoryFileSystem() @@ -13160,6 +13335,8 @@ final class WorkspaceTests: XCTestCase { // duplicate package at root level func testResolutionMixedRegistryAndSourceControl2() async throws { + try skipOnWindowsAsTestCurrentlyFails() + let sandbox = AbsolutePath("/tmp/ws/") let fs = InMemoryFileSystem() @@ -13257,6 +13434,8 @@ final class WorkspaceTests: XCTestCase { // mixed graph root --> dep1 scm // --> dep2 scm --> dep1 registry func testResolutionMixedRegistryAndSourceControl3() async throws { + try skipOnWindowsAsTestCurrentlyFails() + let sandbox = AbsolutePath("/tmp/ws/") let fs = InMemoryFileSystem() @@ -13420,6 +13599,8 @@ final class WorkspaceTests: XCTestCase { // mixed graph root --> dep1 scm // --> dep2 registry --> dep1 registry func testResolutionMixedRegistryAndSourceControl4() async throws { + try skipOnWindowsAsTestCurrentlyFails() + let sandbox = AbsolutePath("/tmp/ws/") let fs = InMemoryFileSystem() @@ -13558,6 +13739,8 @@ final class WorkspaceTests: XCTestCase { // mixed graph root --> dep1 scm // --> dep2 scm --> dep1 registry incompatible version func testResolutionMixedRegistryAndSourceControl5() async throws { + try skipOnWindowsAsTestCurrentlyFails() + let sandbox = AbsolutePath("/tmp/ws/") let fs = InMemoryFileSystem() @@ -13683,6 +13866,8 @@ final class WorkspaceTests: XCTestCase { // mixed graph root --> dep1 registry // --> dep2 registry --> dep1 scm func testResolutionMixedRegistryAndSourceControl6() async throws { + try skipOnWindowsAsTestCurrentlyFails() + let sandbox = AbsolutePath("/tmp/ws/") let fs = InMemoryFileSystem() @@ -13829,6 +14014,8 @@ final class WorkspaceTests: XCTestCase { // mixed graph root --> dep1 registry // --> dep2 registry --> dep1 scm incompatible version func testResolutionMixedRegistryAndSourceControl7() async throws { + try skipOnWindowsAsTestCurrentlyFails() + let sandbox = AbsolutePath("/tmp/ws/") let fs = InMemoryFileSystem() @@ -13954,6 +14141,8 @@ final class WorkspaceTests: XCTestCase { // mixed graph root --> dep1 registry --> dep3 scm // --> dep2 registry --> dep3 registry func testResolutionMixedRegistryAndSourceControl8() async throws { + try skipOnWindowsAsTestCurrentlyFails() + let sandbox = AbsolutePath("/tmp/ws/") let fs = InMemoryFileSystem() @@ -14124,6 +14313,8 @@ final class WorkspaceTests: XCTestCase { // mixed graph root --> dep1 registry --> dep3 scm // --> dep2 registry --> dep3 registry incompatible version func testResolutionMixedRegistryAndSourceControl9() async throws { + try skipOnWindowsAsTestCurrentlyFails() + let sandbox = AbsolutePath("/tmp/ws/") let fs = InMemoryFileSystem() @@ -14265,6 +14456,8 @@ final class WorkspaceTests: XCTestCase { // mixed graph root --> dep1 scm branch // --> dep2 registry --> dep1 registry func testResolutionMixedRegistryAndSourceControl10() async throws { + try skipOnWindowsAsTestCurrentlyFails() + let sandbox = AbsolutePath("/tmp/ws/") let fs = InMemoryFileSystem() @@ -14412,6 +14605,8 @@ final class WorkspaceTests: XCTestCase { } func testCustomPackageContainerProvider() async throws { + try skipOnWindowsAsTestCurrentlyFails() + let sandbox = AbsolutePath("/tmp/ws/") let fs = InMemoryFileSystem() @@ -14501,6 +14696,8 @@ final class WorkspaceTests: XCTestCase { } func testRegistryMissingConfigurationErrors() async throws { + try skipOnWindowsAsTestCurrentlyFails() + let sandbox = AbsolutePath("/tmp/ws/") let fs = InMemoryFileSystem() @@ -14554,6 +14751,8 @@ final class WorkspaceTests: XCTestCase { } func testRegistryReleasesServerErrors() async throws { + try skipOnWindowsAsTestCurrentlyFails() + let sandbox = AbsolutePath("/tmp/ws/") let fs = InMemoryFileSystem() @@ -14639,6 +14838,8 @@ final class WorkspaceTests: XCTestCase { } func testRegistryReleaseChecksumServerErrors() async throws { + try skipOnWindowsAsTestCurrentlyFails() + let sandbox = AbsolutePath("/tmp/ws/") let fs = InMemoryFileSystem() @@ -14726,6 +14927,8 @@ final class WorkspaceTests: XCTestCase { } func testRegistryManifestServerErrors() async throws { + try skipOnWindowsAsTestCurrentlyFails() + let sandbox = AbsolutePath("/tmp/ws/") let fs = InMemoryFileSystem() @@ -14811,6 +15014,8 @@ final class WorkspaceTests: XCTestCase { } func testRegistryDownloadServerErrors() async throws { + try skipOnWindowsAsTestCurrentlyFails() + let sandbox = AbsolutePath("/tmp/ws/") let fs = InMemoryFileSystem() @@ -14898,6 +15103,8 @@ final class WorkspaceTests: XCTestCase { } func testRegistryArchiveErrors() async throws { + try skipOnWindowsAsTestCurrentlyFails() + let sandbox = AbsolutePath("/tmp/ws/") let fs = InMemoryFileSystem() @@ -14960,6 +15167,8 @@ final class WorkspaceTests: XCTestCase { } func testRegistryMetadata() async throws { + try skipOnWindowsAsTestCurrentlyFails() + let sandbox = AbsolutePath("/tmp/ws/") let fs = InMemoryFileSystem() @@ -15042,6 +15251,8 @@ final class WorkspaceTests: XCTestCase { } func testRegistryDefaultRegistryConfiguration() async throws { + try skipOnWindowsAsTestCurrentlyFails() + let sandbox = AbsolutePath("/tmp/ws/") let fs = InMemoryFileSystem() @@ -15105,6 +15316,8 @@ final class WorkspaceTests: XCTestCase { // MARK: - Expected signing entity verification func createBasicRegistryWorkspace(metadata: [String: RegistryReleaseMetadata], mirrors: DependencyMirrors? = nil) async throws -> MockWorkspace { + try skipOnWindowsAsTestCurrentlyFails() + let sandbox = AbsolutePath("/tmp/ws/") let fs = InMemoryFileSystem() @@ -15191,6 +15404,8 @@ final class WorkspaceTests: XCTestCase { } func testSigningEntityVerification_SignedCorrectly() async throws { + try skipOnWindowsAsTestCurrentlyFails() + let actualMetadata = RegistryReleaseMetadata.createWithSigningEntity(.recognized( type: "adp", commonName: "John Doe", @@ -15208,6 +15423,8 @@ final class WorkspaceTests: XCTestCase { } func testSigningEntityVerification_SignedIncorrectly() async throws { + try skipOnWindowsAsTestCurrentlyFails() + let actualMetadata = RegistryReleaseMetadata.createWithSigningEntity(.recognized( type: "adp", commonName: "John Doe", @@ -15237,6 +15454,8 @@ final class WorkspaceTests: XCTestCase { } func testSigningEntityVerification_Unsigned() async throws { + try skipOnWindowsAsTestCurrentlyFails() + let expectedSigningEntity: RegistryReleaseMetadata.SigningEntity = .recognized( type: "adp", commonName: "Jane Doe", @@ -15259,6 +15478,8 @@ final class WorkspaceTests: XCTestCase { } func testSigningEntityVerification_NotFound() async throws { + try skipOnWindowsAsTestCurrentlyFails() + let expectedSigningEntity: RegistryReleaseMetadata.SigningEntity = .recognized( type: "adp", commonName: "Jane Doe", @@ -15281,6 +15502,8 @@ final class WorkspaceTests: XCTestCase { } func testSigningEntityVerification_MirroredSignedCorrectly() async throws { + try skipOnWindowsAsTestCurrentlyFails() + let mirrors = try DependencyMirrors() try mirrors.set(mirror: "ecorp.bar", for: "org.bar") @@ -15305,6 +15528,8 @@ final class WorkspaceTests: XCTestCase { } func testSigningEntityVerification_MirrorSignedIncorrectly() async throws { + try skipOnWindowsAsTestCurrentlyFails() + let mirrors = try DependencyMirrors() try mirrors.set(mirror: "ecorp.bar", for: "org.bar") @@ -15337,6 +15562,8 @@ final class WorkspaceTests: XCTestCase { } func testSigningEntityVerification_MirroredUnsigned() async throws { + try skipOnWindowsAsTestCurrentlyFails() + let mirrors = try DependencyMirrors() try mirrors.set(mirror: "ecorp.bar", for: "org.bar") @@ -15362,6 +15589,8 @@ final class WorkspaceTests: XCTestCase { } func testSigningEntityVerification_MirroredToSCM() async throws { + try skipOnWindowsAsTestCurrentlyFails() + let mirrors = try DependencyMirrors() try mirrors.set(mirror: "https://scm.com/org/bar-mirror", for: "org.bar") @@ -15404,6 +15633,8 @@ final class WorkspaceTests: XCTestCase { archiver: Archiver? = .none, fileSystem: FileSystem ) throws -> RegistryClient { + try skipOnWindowsAsTestCurrentlyFails() + let jsonEncoder = JSONEncoder.makeWithDefaults() guard let identity = packageIdentity.registry else { From dcf82c816b20c447f3fa6772323acbad7198ae79 Mon Sep 17 00:00:00 2001 From: Sam Khouri Date: Thu, 27 Feb 2025 15:27:19 -0500 Subject: [PATCH 08/20] Disable more tests on Windows --- .../GitRepositoryTests.swift | 32 +++++++++++++++++++ .../RepositoryManagerTests.swift | 4 +++ 2 files changed, 36 insertions(+) diff --git a/Tests/SourceControlTests/GitRepositoryTests.swift b/Tests/SourceControlTests/GitRepositoryTests.swift index 5dc0a57ab5c..bdf69ce2a11 100644 --- a/Tests/SourceControlTests/GitRepositoryTests.swift +++ b/Tests/SourceControlTests/GitRepositoryTests.swift @@ -110,6 +110,10 @@ class GitRepositoryTests: XCTestCase { /// Check hash validation. func testGitRepositoryHash() throws { + try skipOnWindowsAsTestCurrentlyFails(because: """ + Test failed with: 0 [main] sh (9736) C:\\Program Files\\Git\\usr\\bin\\sh.exe: *** fatal error - add_item ("\\??\\C:\\Program Files\\Git", "/", ...) failed, errno 1 + """) + let validHash = "0123456789012345678901234567890123456789" XCTAssertNotEqual(GitRepository.Hash(validHash), nil) @@ -187,6 +191,10 @@ class GitRepositoryTests: XCTestCase { } func testSubmoduleRead() throws { + try skipOnWindowsAsTestCurrentlyFails(because: """ + Test failed with: 0 [main] sh (9736) C:\\Program Files\\Git\\usr\\bin\\sh.exe: *** fatal error - add_item ("\\??\\C:\\Program Files\\Git", "/", ...) failed, errno 1 + """) + try testWithTemporaryDirectory { path in let testRepoPath = path.appending("test-repo") try makeDirectories(testRepoPath) @@ -298,6 +306,10 @@ class GitRepositoryTests: XCTestCase { /// Test the handling of local checkouts. func testCheckouts() throws { + try skipOnWindowsAsTestCurrentlyFails(because: """ + Test failed with: 0 [main] sh (9736) C:\\Program Files\\Git\\usr\\bin\\sh.exe: *** fatal error - add_item ("\\??\\C:\\Program Files\\Git", "/", ...) failed, errno 1 + """) + try testWithTemporaryDirectory { path in // Create a test repository. let testRepoPath = path.appending("test-repo") @@ -344,6 +356,10 @@ class GitRepositoryTests: XCTestCase { } func testFetch() throws { + try skipOnWindowsAsTestCurrentlyFails(because: """ + Test failed with: 0 [main] sh (9736) C:\\Program Files\\Git\\usr\\bin\\sh.exe: *** fatal error - add_item ("\\??\\C:\\Program Files\\Git", "/", ...) failed, errno 1 + """) + try testWithTemporaryDirectory { path in // Create a repo. let testRepoPath = path.appending("test-repo") @@ -383,6 +399,10 @@ class GitRepositoryTests: XCTestCase { } func testHasUnpushedCommits() throws { + try skipOnWindowsAsTestCurrentlyFails(because: """ + Test failed with: 0 [main] sh (9736) C:\\Program Files\\Git\\usr\\bin\\sh.exe: *** fatal error - add_item ("\\??\\C:\\Program Files\\Git", "/", ...) failed, errno 1 + """) + try testWithTemporaryDirectory { path in // Create a repo. let testRepoPath = path.appending("test-repo") @@ -419,6 +439,10 @@ class GitRepositoryTests: XCTestCase { } func testSetRemote() throws { + try skipOnWindowsAsTestCurrentlyFails(because: """ + Test failed with: 0 [main] sh (9736) C:\\Program Files\\Git\\usr\\bin\\sh.exe: *** fatal error - add_item ("\\??\\C:\\Program Files\\Git", "/", ...) failed, errno 1 + """) + try testWithTemporaryDirectory { path in // Create a repo. let testRepoPath = path.appending("test-repo") @@ -531,6 +555,10 @@ class GitRepositoryTests: XCTestCase { } func testCheckoutRevision() throws { + try skipOnWindowsAsTestCurrentlyFails(because: """ + Test failed with: 0 [main] sh (9736) C:\\Program Files\\Git\\usr\\bin\\sh.exe: *** fatal error - add_item ("\\??\\C:\\Program Files\\Git", "/", ...) failed, errno 1 + """) + try testWithTemporaryDirectory { path in // Create a repo. let testRepoPath = path.appending("test-repo") @@ -733,6 +761,10 @@ class GitRepositoryTests: XCTestCase { } func testMissingDefaultBranch() throws { + try skipOnWindowsAsTestCurrentlyFails(because: """ + Test failed with: 0 [main] sh (9736) C:\\Program Files\\Git\\usr\\bin\\sh.exe: *** fatal error - add_item ("\\??\\C:\\Program Files\\Git", "/", ...) failed, errno 1 + """) + try testWithTemporaryDirectory { path in // Create a repository. let testRepoPath = path.appending("test-repo") diff --git a/Tests/SourceControlTests/RepositoryManagerTests.swift b/Tests/SourceControlTests/RepositoryManagerTests.swift index 81b32496df4..cf74e43dd25 100644 --- a/Tests/SourceControlTests/RepositoryManagerTests.swift +++ b/Tests/SourceControlTests/RepositoryManagerTests.swift @@ -19,6 +19,10 @@ import XCTest final class RepositoryManagerTests: XCTestCase { func testBasics() async throws { + try skipOnWindowsAsTestCurrentlyFails(because: """ + Test failed with: 0 [main] sh (9736) C:\\Program Files\\Git\\usr\\bin\\sh.exe: *** fatal error - add_item ("\\??\\C:\\Program Files\\Git", "/", ...) failed, errno 1 + """) + let fs = localFileSystem let observability = ObservabilitySystem.makeForTesting() From b1110994c499a21c3f4d94ead37b456523536e71 Mon Sep 17 00:00:00 2001 From: Sam Khouri Date: Mon, 17 Mar 2025 14:53:13 -0400 Subject: [PATCH 09/20] Add missing import --- Sources/_InternalTestSupport/misc.swift | 1 + 1 file changed, 1 insertion(+) diff --git a/Sources/_InternalTestSupport/misc.swift b/Sources/_InternalTestSupport/misc.swift index b91fa9eaa04..a9fb6a16cf8 100644 --- a/Sources/_InternalTestSupport/misc.swift +++ b/Sources/_InternalTestSupport/misc.swift @@ -11,6 +11,7 @@ //===----------------------------------------------------------------------===// import Foundation +import XCTest import Basics import struct Foundation.URL #if os(macOS) From b3a2e58e4a2416434e698483807855979bd1ced1 Mon Sep 17 00:00:00 2001 From: Sam Khouri Date: Mon, 17 Mar 2025 15:32:08 -0400 Subject: [PATCH 10/20] Skip more tests on Windows, and fix SourceKitLSPAPITests.SourceKitLSPAPITests.testLoadPackage to have windows path --- .../SourceKitLSPAPITests.swift | 12 +- Tests/WorkspaceTests/WorkspaceTests.swift | 126 ++++++++++++++++++ Utilities/README.md | 2 +- 3 files changed, 138 insertions(+), 2 deletions(-) diff --git a/Tests/SourceKitLSPAPITests/SourceKitLSPAPITests.swift b/Tests/SourceKitLSPAPITests/SourceKitLSPAPITests.swift index 016d5e5a907..c2c5e47a3a0 100644 --- a/Tests/SourceKitLSPAPITests/SourceKitLSPAPITests.swift +++ b/Tests/SourceKitLSPAPITests/SourceKitLSPAPITests.swift @@ -318,7 +318,7 @@ final class SourceKitLSPAPITests: XCTestCase { "-package-name", "pkg", "-emit-dependencies", "-emit-module", - "-emit-module-path", "/path/to/build/\(destinationBuildParameters.triple)/debug/Modules/lib.swiftmodule" + "-emit-module-path", "/path/to/build/\(destinationBuildParameters.triple)/debug/Modules/lib.swiftmodule".fixwin ], isPartOfRootPackage: true ) @@ -402,3 +402,13 @@ extension SourceKitLSPAPI.BuildDescription { return result } } + +extension String { + var fixwin: String { + #if os(Windows) + return self.replacingOccurrences(of: "/", with: "\\") + #else + return self + #endif + } +} diff --git a/Tests/WorkspaceTests/WorkspaceTests.swift b/Tests/WorkspaceTests/WorkspaceTests.swift index fcc877313a5..75bfe9edecb 100644 --- a/Tests/WorkspaceTests/WorkspaceTests.swift +++ b/Tests/WorkspaceTests/WorkspaceTests.swift @@ -6847,6 +6847,8 @@ final class WorkspaceTests: XCTestCase { ////// STAET ATDIN func testLocalArchivedArtifactChecksumChange() async throws { + try skipOnWindowsAsTestCurrentlyFails(because: #"\tmp\ws doesn't exist in file system"#) + let sandbox = AbsolutePath("/tmp/ws/") let fs = InMemoryFileSystem() @@ -6951,6 +6953,8 @@ final class WorkspaceTests: XCTestCase { } func testLocalArchivedArtifactStripFirstComponent() async throws { + try skipOnWindowsAsTestCurrentlyFails(because: #"\tmp\ws doesn't exist in file system"#) + let sandbox = AbsolutePath("/tmp/ws/") let fs = InMemoryFileSystem() @@ -7061,6 +7065,8 @@ final class WorkspaceTests: XCTestCase { } func testLocalArtifactHappyPath() async throws { + try skipOnWindowsAsTestCurrentlyFails(because: #"\tmp\ws doesn't exist in file system"#) + let sandbox = AbsolutePath("/tmp/ws/") let fs = InMemoryFileSystem() @@ -7113,6 +7119,8 @@ final class WorkspaceTests: XCTestCase { } func testLocalArtifactDoesNotExist() async throws { + try skipOnWindowsAsTestCurrentlyFails(because: #"\tmp\ws doesn't exist in file system"#) + let sandbox = AbsolutePath("/tmp/ws/") let fs = InMemoryFileSystem() @@ -7157,6 +7165,8 @@ final class WorkspaceTests: XCTestCase { } func testArtifactDownloadHappyPath() async throws { + try skipOnWindowsAsTestCurrentlyFails(because: #"\tmp\ws doesn't exist in file system"#) + let sandbox = AbsolutePath("/tmp/ws/") let fs = InMemoryFileSystem() let downloads = ThreadSafeKeyValueStore() @@ -7346,6 +7356,8 @@ final class WorkspaceTests: XCTestCase { } func testArtifactDownloadWithPreviousState() async throws { + try skipOnWindowsAsTestCurrentlyFails(because: #"\tmp\ws doesn't exist in file system"#) + let sandbox = AbsolutePath("/tmp/ws/") let fs = InMemoryFileSystem() let downloads = ThreadSafeKeyValueStore() @@ -7654,6 +7666,8 @@ final class WorkspaceTests: XCTestCase { } func testArtifactDownloadTwice() async throws { + try skipOnWindowsAsTestCurrentlyFails(because: #"\tmp\ws doesn't exist in file system"#) + let sandbox = AbsolutePath("/tmp/ws/") let fs = InMemoryFileSystem() let downloads = ThreadSafeArrayStore<(URL, AbsolutePath)>() @@ -7776,6 +7790,8 @@ final class WorkspaceTests: XCTestCase { } func testArtifactDownloadServerError() async throws { + try skipOnWindowsAsTestCurrentlyFails(because: #"\tmp\ws doesn't exist in file system"#) + let fs = InMemoryFileSystem() let sandbox = AbsolutePath("/tmp/ws/") try fs.createDirectory(sandbox, recursive: true) @@ -7846,6 +7862,8 @@ final class WorkspaceTests: XCTestCase { } func testArtifactDownloaderOrArchiverError() async throws { + try skipOnWindowsAsTestCurrentlyFails(because: #"\tmp\ws doesn't exist in file system"#) + let sandbox = AbsolutePath("/tmp/ws/") let fs = InMemoryFileSystem() @@ -7933,6 +7951,8 @@ final class WorkspaceTests: XCTestCase { } func testDownloadedArtifactNotAnArchiveError() async throws { + try skipOnWindowsAsTestCurrentlyFails(because: #"\tmp\ws doesn't exist in file system"#) + let sandbox = AbsolutePath("/tmp/ws/") let fs = InMemoryFileSystem() @@ -8041,6 +8061,8 @@ final class WorkspaceTests: XCTestCase { } func testDownloadedArtifactInvalid() async throws { + try skipOnWindowsAsTestCurrentlyFails(because: #"\tmp\ws doesn't exist in file system"#) + let sandbox = AbsolutePath("/tmp/ws/") let fs = InMemoryFileSystem() @@ -8112,6 +8134,8 @@ final class WorkspaceTests: XCTestCase { } func testDownloadedArtifactDoesNotMatchTargetName() async throws { + try skipOnWindowsAsTestCurrentlyFails(because: #"\tmp\ws doesn't exist in file system"#) + let sandbox = AbsolutePath("/tmp/ws/") let fs = InMemoryFileSystem() @@ -8187,6 +8211,8 @@ final class WorkspaceTests: XCTestCase { } func testArtifactChecksum() async throws { + try skipOnWindowsAsTestCurrentlyFails(because: #"\tmp\ws doesn't exist in file system"#) + let fs = InMemoryFileSystem() try fs.createMockToolchain() let sandbox = AbsolutePath("/tmp/ws/") @@ -8259,6 +8285,8 @@ final class WorkspaceTests: XCTestCase { } func testDownloadedArtifactChecksumChange() async throws { + try skipOnWindowsAsTestCurrentlyFails(because: #"\tmp\ws doesn't exist in file system"#) + let sandbox = AbsolutePath("/tmp/ws/") let fs = InMemoryFileSystem() @@ -8311,6 +8339,8 @@ final class WorkspaceTests: XCTestCase { } func testDownloadedArtifactChecksumChangeURLChange() async throws { + try skipOnWindowsAsTestCurrentlyFails(because: #"\tmp\ws doesn't exist in file system"#) + let sandbox = AbsolutePath("/tmp/ws/") let fs = InMemoryFileSystem() @@ -8402,6 +8432,8 @@ final class WorkspaceTests: XCTestCase { } func testArtifactDownloadAddsAcceptHeader() async throws { + try skipOnWindowsAsTestCurrentlyFails(because: #"\tmp\ws doesn't exist in file system"#) + let sandbox = AbsolutePath("/tmp/ws/") let fs = InMemoryFileSystem() let acceptHeaders = ThreadSafeBox([String]()) @@ -8478,6 +8510,8 @@ final class WorkspaceTests: XCTestCase { } func testDownloadedArtifactNoCache() async throws { + try skipOnWindowsAsTestCurrentlyFails(because: #"\tmp\ws doesn't exist in file system"#) + let sandbox = AbsolutePath("/tmp/ws/") let fs = InMemoryFileSystem() let downloads = ThreadSafeBox(0) @@ -8567,6 +8601,8 @@ final class WorkspaceTests: XCTestCase { } func testDownloadedArtifactCache() async throws { + try skipOnWindowsAsTestCurrentlyFails(because: #"\tmp\ws doesn't exist in file system"#) + let sandbox = AbsolutePath("/tmp/ws/") let fs = InMemoryFileSystem() let downloads = ThreadSafeBox(0) @@ -8671,6 +8707,8 @@ final class WorkspaceTests: XCTestCase { } func testDownloadedArtifactTransitive() async throws { + try skipOnWindowsAsTestCurrentlyFails(because: #"\tmp\ws doesn't exist in file system"#) + let sandbox = AbsolutePath("/tmp/ws/") let fs = InMemoryFileSystem() let downloads = ThreadSafeKeyValueStore() @@ -8841,6 +8879,8 @@ final class WorkspaceTests: XCTestCase { } func testDownloadedArtifactArchiveExists() async throws { + try skipOnWindowsAsTestCurrentlyFails(because: #"\tmp\ws doesn't exist in file system"#) + let sandbox = AbsolutePath("/tmp/ws/") let fs = InMemoryFileSystem() // this relies on internal knowledge of the destination path construction @@ -8953,6 +8993,8 @@ final class WorkspaceTests: XCTestCase { } func testDownloadedArtifactConcurrency() async throws { + try skipOnWindowsAsTestCurrentlyFails(because: #"\tmp\ws doesn't exist in file system"#) + let sandbox = AbsolutePath("/tmp/ws/") let fs = InMemoryFileSystem() @@ -9065,6 +9107,8 @@ final class WorkspaceTests: XCTestCase { } func testDownloadedArtifactStripFirstComponent() async throws { + try skipOnWindowsAsTestCurrentlyFails(because: #"\tmp\ws doesn't exist in file system"#) + let sandbox = AbsolutePath("/tmp/ws/") let fs = InMemoryFileSystem() let downloads = ThreadSafeKeyValueStore() @@ -9225,6 +9269,8 @@ final class WorkspaceTests: XCTestCase { } func testArtifactMultipleExtensions() async throws { + try skipOnWindowsAsTestCurrentlyFails(because: #"\tmp\ws doesn't exist in file system"#) + let sandbox = AbsolutePath("/tmp/ws/") let fs = InMemoryFileSystem() let downloads = ThreadSafeKeyValueStore() @@ -9349,6 +9395,8 @@ final class WorkspaceTests: XCTestCase { } func testLoadRootPackageWithBinaryDependencies() async throws { + try skipOnWindowsAsTestCurrentlyFails(because: #"\tmp\ws doesn't exist in file system"#) + let sandbox = AbsolutePath("/tmp/ws/") let fs = InMemoryFileSystem() @@ -9393,6 +9441,8 @@ final class WorkspaceTests: XCTestCase { } func testDownloadArchiveIndexFilesHappyPath() async throws { + try skipOnWindowsAsTestCurrentlyFails(because: #"\tmp\ws doesn't exist in file system"#) + let sandbox = AbsolutePath("/tmp/ws/") let fs = InMemoryFileSystem() try fs.createMockToolchain() @@ -9635,6 +9685,8 @@ final class WorkspaceTests: XCTestCase { } func testDownloadArchiveIndexServerError() async throws { + try skipOnWindowsAsTestCurrentlyFails(because: #"\tmp\ws doesn't exist in file system"#) + let sandbox = AbsolutePath("/tmp/ws/") let fs = InMemoryFileSystem() @@ -9677,6 +9729,8 @@ final class WorkspaceTests: XCTestCase { } func testDownloadArchiveIndexFileBadChecksum() async throws { + try skipOnWindowsAsTestCurrentlyFails(because: #"\tmp\ws doesn't exist in file system"#) + let sandbox = AbsolutePath("/tmp/ws/") let fs = InMemoryFileSystem() try fs.createMockToolchain() @@ -9743,6 +9797,8 @@ final class WorkspaceTests: XCTestCase { } func testDownloadArchiveIndexFileChecksumChanges() async throws { + try skipOnWindowsAsTestCurrentlyFails(because: #"\tmp\ws doesn't exist in file system"#) + let sandbox = AbsolutePath("/tmp/ws/") let fs = InMemoryFileSystem() @@ -9793,6 +9849,8 @@ final class WorkspaceTests: XCTestCase { } func testDownloadArchiveIndexFileBadArchivesChecksum() async throws { + try skipOnWindowsAsTestCurrentlyFails(because: #"\tmp\ws doesn't exist in file system"#) + let sandbox = AbsolutePath("/tmp/ws/") let fs = InMemoryFileSystem() try fs.createMockToolchain() @@ -9900,6 +9958,8 @@ final class WorkspaceTests: XCTestCase { } func testDownloadArchiveIndexFileArchiveNotFound() async throws { + try skipOnWindowsAsTestCurrentlyFails(because: #"\tmp\ws doesn't exist in file system"#) + let sandbox = AbsolutePath("/tmp/ws/") let fs = InMemoryFileSystem() try fs.createMockToolchain() @@ -9972,6 +10032,8 @@ final class WorkspaceTests: XCTestCase { } func testDownloadArchiveIndexTripleNotFound() async throws { + try skipOnWindowsAsTestCurrentlyFails(because: #"\tmp\ws doesn't exist in file system"#) + let sandbox = AbsolutePath("/tmp/ws/") let fs = InMemoryFileSystem() try fs.createMockToolchain() @@ -10042,6 +10104,8 @@ final class WorkspaceTests: XCTestCase { } func testDuplicateDependencyIdentityWithNameAtRoot() async throws { + try skipOnWindowsAsTestCurrentlyFails(because: #"\tmp\ws doesn't exist in file system"#) + let sandbox = AbsolutePath("/tmp/ws/") let fs = InMemoryFileSystem() @@ -10111,6 +10175,8 @@ final class WorkspaceTests: XCTestCase { } func testDuplicateDependencyIdentityWithoutNameAtRoot() async throws { + try skipOnWindowsAsTestCurrentlyFails(because: #"\tmp\ws doesn't exist in file system"#) + let sandbox = AbsolutePath("/tmp/ws/") let fs = InMemoryFileSystem() @@ -10172,6 +10238,8 @@ final class WorkspaceTests: XCTestCase { } func testDuplicateExplicitDependencyName_AtRoot() async throws { + try skipOnWindowsAsTestCurrentlyFails(because: #"\tmp\ws doesn't exist in file system"#) + let sandbox = AbsolutePath("/tmp/ws/") let fs = InMemoryFileSystem() @@ -10241,6 +10309,8 @@ final class WorkspaceTests: XCTestCase { } func testDuplicateManifestNameAtRoot() async throws { + try skipOnWindowsAsTestCurrentlyFails(because: #"\tmp\ws doesn't exist in file system"#) + let sandbox = AbsolutePath("/tmp/ws/") let fs = InMemoryFileSystem() @@ -10296,6 +10366,8 @@ final class WorkspaceTests: XCTestCase { } func testDuplicateManifestName_ExplicitProductPackage_AtRoot() async throws { + try skipOnWindowsAsTestCurrentlyFails(because: #"\tmp\ws doesn't exist in file system"#) + let sandbox = AbsolutePath("/tmp/ws/") let fs = InMemoryFileSystem() @@ -10351,6 +10423,8 @@ final class WorkspaceTests: XCTestCase { } func testManifestNameAndIdentityConflict_AtRoot_Pre52() async throws { + try skipOnWindowsAsTestCurrentlyFails(because: #"\tmp\ws doesn't exist in file system"#) + let sandbox = AbsolutePath("/tmp/ws/") let fs = InMemoryFileSystem() @@ -10406,6 +10480,8 @@ final class WorkspaceTests: XCTestCase { } func testManifestNameAndIdentityConflict_AtRoot_Post52_Incorrect() async throws { + try skipOnWindowsAsTestCurrentlyFails(because: #"\tmp\ws doesn't exist in file system"#) + let sandbox = AbsolutePath("/tmp/ws/") let fs = InMemoryFileSystem() @@ -10470,6 +10546,8 @@ final class WorkspaceTests: XCTestCase { } func testManifestNameAndIdentityConflict_AtRoot_Post52_Correct() async throws { + try skipOnWindowsAsTestCurrentlyFails(because: #"\tmp\ws doesn't exist in file system"#) + let sandbox = AbsolutePath("/tmp/ws/") let fs = InMemoryFileSystem() @@ -10525,6 +10603,8 @@ final class WorkspaceTests: XCTestCase { } func testManifestNameAndIdentityConflict_ExplicitDependencyNames_AtRoot() async throws { + try skipOnWindowsAsTestCurrentlyFails(because: #"\tmp\ws doesn't exist in file system"#) + let sandbox = AbsolutePath("/tmp/ws/") let fs = InMemoryFileSystem() @@ -10589,6 +10669,8 @@ final class WorkspaceTests: XCTestCase { } func testManifestNameAndIdentityConflict_ExplicitDependencyNames_ExplicitProductPackage_AtRoot() async throws { + try skipOnWindowsAsTestCurrentlyFails(because: #"\tmp\ws doesn't exist in file system"#) + let sandbox = AbsolutePath("/tmp/ws/") let fs = InMemoryFileSystem() @@ -10653,6 +10735,8 @@ final class WorkspaceTests: XCTestCase { } func testDuplicateTransitiveIdentityWithNames() async throws { + try skipOnWindowsAsTestCurrentlyFails(because: #"\tmp\ws doesn't exist in file system"#) + let sandbox = AbsolutePath("/tmp/ws/") let fs = InMemoryFileSystem() @@ -10742,6 +10826,8 @@ final class WorkspaceTests: XCTestCase { } func testDuplicateTransitiveIdentityWithoutNames() async throws { + try skipOnWindowsAsTestCurrentlyFails(because: #"\tmp\ws doesn't exist in file system"#) + let sandbox = AbsolutePath("/tmp/ws/") let fs = InMemoryFileSystem() @@ -10827,6 +10913,8 @@ final class WorkspaceTests: XCTestCase { } func testDuplicateTransitiveIdentitySimilarURLs1() async throws { + try skipOnWindowsAsTestCurrentlyFails(because: #"\tmp\ws doesn't exist in file system"#) + let sandbox = AbsolutePath("/tmp/ws/") let fs = InMemoryFileSystem() @@ -10902,6 +10990,8 @@ final class WorkspaceTests: XCTestCase { } func testDuplicateTransitiveIdentitySimilarURLs2() async throws { + try skipOnWindowsAsTestCurrentlyFails(because: #"\tmp\ws doesn't exist in file system"#) + let sandbox = AbsolutePath("/tmp/ws/") let fs = InMemoryFileSystem() @@ -10977,6 +11067,8 @@ final class WorkspaceTests: XCTestCase { } func testDuplicateTransitiveIdentityGitHubURLs1() async throws { + try skipOnWindowsAsTestCurrentlyFails(because: #"\tmp\ws doesn't exist in file system"#) + let sandbox = AbsolutePath("/tmp/ws/") let fs = InMemoryFileSystem() @@ -11052,6 +11144,8 @@ final class WorkspaceTests: XCTestCase { } func testDuplicateTransitiveIdentityGitHubURLs2() async throws { + try skipOnWindowsAsTestCurrentlyFails(because: #"\tmp\ws doesn't exist in file system"#) + let sandbox = AbsolutePath("/tmp/ws/") let fs = InMemoryFileSystem() @@ -11130,6 +11224,8 @@ final class WorkspaceTests: XCTestCase { } func testDuplicateTransitiveIdentityUnfamiliarURLs() async throws { + try skipOnWindowsAsTestCurrentlyFails(because: #"\tmp\ws doesn't exist in file system"#) + let sandbox = AbsolutePath("/tmp/ws/") let fs = InMemoryFileSystem() @@ -11215,6 +11311,8 @@ final class WorkspaceTests: XCTestCase { } func testDuplicateTransitiveIdentityWithSimilarURLs() async throws { + try skipOnWindowsAsTestCurrentlyFails(because: #"\tmp\ws doesn't exist in file system"#) + let sandbox = AbsolutePath("/tmp/ws/") let fs = InMemoryFileSystem() @@ -11337,6 +11435,8 @@ final class WorkspaceTests: XCTestCase { } func testDuplicateNestedTransitiveIdentityWithNames() async throws { + try skipOnWindowsAsTestCurrentlyFails(because: #"\tmp\ws doesn't exist in file system"#) + let sandbox = AbsolutePath("/tmp/ws/") let fs = InMemoryFileSystem() @@ -11431,6 +11531,8 @@ final class WorkspaceTests: XCTestCase { } func testDuplicateNestedTransitiveIdentityWithoutNames() async throws { + try skipOnWindowsAsTestCurrentlyFails(because: #"\tmp\ws doesn't exist in file system"#) + let sandbox = AbsolutePath("/tmp/ws/") let fs = InMemoryFileSystem() @@ -11515,6 +11617,8 @@ final class WorkspaceTests: XCTestCase { } func testRootPathConflictsWithTransitiveIdentity() async throws { + try skipOnWindowsAsTestCurrentlyFails(because: #"\tmp\ws doesn't exist in file system"#) + let sandbox = AbsolutePath("/tmp/ws/") let fs = InMemoryFileSystem() @@ -11590,6 +11694,8 @@ final class WorkspaceTests: XCTestCase { } func testDeterministicURLPreference() async throws { + try skipOnWindowsAsTestCurrentlyFails(because: #"\tmp\ws doesn't exist in file system"#) + let sandbox = AbsolutePath("/tmp/ws/") let fs = InMemoryFileSystem() @@ -11751,6 +11857,8 @@ final class WorkspaceTests: XCTestCase { } func testDeterministicURLPreferenceWithRoot() async throws { + try skipOnWindowsAsTestCurrentlyFails(because: #"\tmp\ws doesn't exist in file system"#) + let sandbox = AbsolutePath("/tmp/ws/") let fs = InMemoryFileSystem() @@ -11890,6 +11998,8 @@ final class WorkspaceTests: XCTestCase { } func testCanonicalURLWithPreviousManagedState() async throws { + try skipOnWindowsAsTestCurrentlyFails(because: #"\tmp\ws doesn't exist in file system"#) + let sandbox = AbsolutePath("/tmp/ws/") let fs = InMemoryFileSystem() @@ -12052,6 +12162,8 @@ final class WorkspaceTests: XCTestCase { } func testCanonicalURLChanges() async throws { + try skipOnWindowsAsTestCurrentlyFails(because: #"\tmp\ws doesn't exist in file system"#) + let sandbox = AbsolutePath("/tmp/ws/") let fs = InMemoryFileSystem() @@ -12165,6 +12277,8 @@ final class WorkspaceTests: XCTestCase { } func testCanonicalURLChangesWithTransitiveDependencies() async throws { + try skipOnWindowsAsTestCurrentlyFails(because: #"\tmp\ws doesn't exist in file system"#) + let sandbox = AbsolutePath("/tmp/ws/") let fs = InMemoryFileSystem() @@ -12331,6 +12445,8 @@ final class WorkspaceTests: XCTestCase { } func testCycleRoot() async throws { + try skipOnWindowsAsTestCurrentlyFails(because: #"\tmp\ws doesn't exist in file system"#) + let sandbox = AbsolutePath("/tmp/ws/") let fs = InMemoryFileSystem() @@ -12447,6 +12563,8 @@ final class WorkspaceTests: XCTestCase { } func testResolutionBranchAndVersion() async throws { + try skipOnWindowsAsTestCurrentlyFails(because: #"\tmp\ws doesn't exist in file system"#) + let sandbox = AbsolutePath("/tmp/ws/") let fs = InMemoryFileSystem() @@ -15750,6 +15868,8 @@ final class WorkspaceTests: XCTestCase { } func testTraitConfigurationExists_NoDefaultTraits() async throws { + try skipOnWindowsAsTestCurrentlyFails(because: #"\tmp\ws doesn't exist in file system"#) + let sandbox = AbsolutePath("/tmp/ws/") let fs = InMemoryFileSystem() @@ -15838,6 +15958,8 @@ final class WorkspaceTests: XCTestCase { } func testTraitConfigurationExists_WithDefaultTraits() async throws { + try skipOnWindowsAsTestCurrentlyFails(because: #"\tmp\ws doesn't exist in file system"#) + let sandbox = AbsolutePath("/tmp/ws/") let fs = InMemoryFileSystem() @@ -15926,6 +16048,8 @@ final class WorkspaceTests: XCTestCase { } func testTraitConfiguration_WithPrunedDependencies() async throws { + try skipOnWindowsAsTestCurrentlyFails(because: #"\tmp\ws doesn't exist in file system"#) + let sandbox = AbsolutePath("/tmp/ws/") let fs = InMemoryFileSystem() @@ -16004,6 +16128,8 @@ final class WorkspaceTests: XCTestCase { } func testNoTraitConfiguration_WithDefaultTraits() async throws { + try skipOnWindowsAsTestCurrentlyFails(because: #"\tmp\ws doesn't exist in file system"#) + let sandbox = AbsolutePath("/tmp/ws/") let fs = InMemoryFileSystem() diff --git a/Utilities/README.md b/Utilities/README.md index c8096af25fe..1111c397b32 100644 --- a/Utilities/README.md +++ b/Utilities/README.md @@ -14,7 +14,7 @@ Here are some steps the worked running on Windows. cd C:\source git clone https://github.com/swiftlang/swift-package-manager . # Assign the PR ID to a variable - $PR_ID = "8288" + $PR_ID = "8210" git fetch origin pull/$PR_ID/merge:ci_merge_$PR_ID git checkout ci_merge_$PR_ID ``` From 562eb67274a676c41dc646cf87bbc526810b623a Mon Sep 17 00:00:00 2001 From: Sam Khouri Date: Mon, 17 Mar 2025 16:45:41 -0400 Subject: [PATCH 11/20] Update build-using-self to properly convert Windows paths --- Utilities/build-using-self | 1 + 1 file changed, 1 insertion(+) diff --git a/Utilities/build-using-self b/Utilities/build-using-self index fb49f6452b9..52fdb5b2488 100755 --- a/Utilities/build-using-self +++ b/Utilities/build-using-self @@ -167,6 +167,7 @@ def main() -> None: call( shlex.split( f"{swiftpm_bin_dir / 'swift-test'} --parallel", + posix=(os.name == "posix"), # must be set correctly, otherwhsie shlex.split("C:\\Foo\\bar") become ['CFoobar'] ), ) From 293fc93b511f55c6a462a93068c9ae339941d6b8 Mon Sep 17 00:00:00 2001 From: Sam Khouri Date: Tue, 18 Mar 2025 09:49:01 -0400 Subject: [PATCH 12/20] some changes, including executing tests sequentially --- Sources/_InternalTestSupport/misc.swift | 2 +- Utilities/README.md | 4 ++-- Utilities/build-using-self | 4 ++-- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/Sources/_InternalTestSupport/misc.swift b/Sources/_InternalTestSupport/misc.swift index a9fb6a16cf8..0ee99cbd7d8 100644 --- a/Sources/_InternalTestSupport/misc.swift +++ b/Sources/_InternalTestSupport/misc.swift @@ -11,7 +11,6 @@ //===----------------------------------------------------------------------===// import Foundation -import XCTest import Basics import struct Foundation.URL #if os(macOS) @@ -30,6 +29,7 @@ import struct SPMBuildCore.BuildParameters import TSCTestSupport import Workspace import func XCTest.XCTFail +import func XCTest.XCTSkip import struct TSCBasic.ByteString import struct Basics.AsyncProcessResult diff --git a/Utilities/README.md b/Utilities/README.md index 1111c397b32..d8555a0f43d 100644 --- a/Utilities/README.md +++ b/Utilities/README.md @@ -6,7 +6,7 @@ Here are some steps the worked running on Windows. 2. Launch a `Powershell.exe` session 3. Run the following in power shell to start a container running the nightly toolchain ``` - docker run --rm --interactive --tty swiftlang/swift:nightly-main-windowsservercore-1809 powershell.exe + docker run --pull always --rm --interactive --tty swiftlang/swift:nightly-main-windowsservercore-1809 powershell.exe ``` 4. When the container start, clone the "merged" PR to `C:\source` ``` @@ -20,5 +20,5 @@ Here are some steps the worked running on Windows. ``` 5. Run the CI pipeline script ``` - python C:\source\Utilities\build-using-self + python C:\source\Utilities\build-using-self --enable-swift-testing --enable-xctest ``` diff --git a/Utilities/build-using-self b/Utilities/build-using-self index 52fdb5b2488..598912ee48d 100755 --- a/Utilities/build-using-self +++ b/Utilities/build-using-self @@ -157,7 +157,7 @@ def main() -> None: swift_testing_arg= "--enable-swift-testing" if args.enable_swift_testing else "" xctest_arg= "--enable-xctest" if args.enable_swift_testing else "" call( - shlex.split(f"swift test --configuration {args.config} --parallel {swift_testing_arg} {xctest_arg}"), + shlex.split(f"swift test --configuration {args.config} --no-parallel {swift_testing_arg} {xctest_arg}"), ) with change_directory(REPO_ROOT_PATH / "IntegrationTests"): @@ -166,7 +166,7 @@ def main() -> None: ) call( shlex.split( - f"{swiftpm_bin_dir / 'swift-test'} --parallel", + f"{swiftpm_bin_dir / 'swift-test'} --no-parallel", posix=(os.name == "posix"), # must be set correctly, otherwhsie shlex.split("C:\\Foo\\bar") become ['CFoobar'] ), ) From 409fd5983939f6472dfc73bc1f67105d7bd2fe74 Mon Sep 17 00:00:00 2001 From: Sam Khouri Date: Tue, 18 Mar 2025 12:06:49 -0400 Subject: [PATCH 13/20] properly import XCTest.XCTSkip in misc.swift --- Sources/_InternalTestSupport/misc.swift | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Sources/_InternalTestSupport/misc.swift b/Sources/_InternalTestSupport/misc.swift index 0ee99cbd7d8..2e81968bfe8 100644 --- a/Sources/_InternalTestSupport/misc.swift +++ b/Sources/_InternalTestSupport/misc.swift @@ -29,7 +29,7 @@ import struct SPMBuildCore.BuildParameters import TSCTestSupport import Workspace import func XCTest.XCTFail -import func XCTest.XCTSkip +import struct XCTest.XCTSkip import struct TSCBasic.ByteString import struct Basics.AsyncProcessResult From ff6f573a1b0c51835d99c77139ae958d2d0cb385 Mon Sep 17 00:00:00 2001 From: Sam Khouri Date: Wed, 19 Mar 2025 11:54:39 -0400 Subject: [PATCH 14/20] Skip some IntegrationTests on Windows and fix one to work on Windows --- .../Tests/IntegrationTests/BasicTests.swift | 13 ++++++++++++- .../Tests/IntegrationTests/Helpers.swift | 12 ++++++++++++ .../Tests/IntegrationTests/SwiftPMTests.swift | 2 ++ Tests/SourceControlTests/GitRepositoryTests.swift | 5 ++--- 4 files changed, 28 insertions(+), 4 deletions(-) diff --git a/IntegrationTests/Tests/IntegrationTests/BasicTests.swift b/IntegrationTests/Tests/IntegrationTests/BasicTests.swift index dbfb3cf6d9a..0f42ad3765e 100644 --- a/IntegrationTests/Tests/IntegrationTests/BasicTests.swift +++ b/IntegrationTests/Tests/IntegrationTests/BasicTests.swift @@ -14,6 +14,8 @@ import TSCTestSupport final class BasicTests: XCTestCase { func testVersion() throws { + try skipOnWindowsAsTestCurrentlyFails(because: "'try!' expression unexpectedly raised an error: TSCBasic.Process.Error.missingExecutableProgram(program: \"which\")") + XCTAssertMatch(try sh(swift, "--version").stdout, .contains("Swift version")) } @@ -70,11 +72,14 @@ final class BasicTests: XCTestCase { // Verify that the tool exists and works. let toolOutput = try sh(packagePath.appending(components: ".build", "debug", "tool")).stdout - XCTAssertEqual(toolOutput, "HI\n") + XCTAssert(toolOutput.contains("HI")) + XCTAssert(toolOutput.contains("\n")) } } func testSwiftCompiler() throws { + try skipOnWindowsAsTestCurrentlyFails(because: "'try!' expression unexpectedly raised an error: TSCBasic.Process.Error.missingExecutableProgram(program: \"which\")") + try withTemporaryDirectory { tempDir in let helloSourcePath = tempDir.appending(component: "hello.swift") try localFileSystem.writeFileContents( @@ -93,6 +98,8 @@ final class BasicTests: XCTestCase { } func testSwiftPackageInitExec() throws { + try skipOnWindowsAsTestCurrentlyFails(because: "failed to build package") + try withTemporaryDirectory { tempDir in // Create a new package with an executable target. let packagePath = tempDir.appending(component: "Project") @@ -182,6 +189,8 @@ final class BasicTests: XCTestCase { } func testSwiftPackageWithSpaces() throws { + try skipOnWindowsAsTestCurrentlyFails(because: "unexpected failure matching") + try withTemporaryDirectory { tempDir in let packagePath = tempDir.appending(components: "more spaces", "special tool") try localFileSystem.createDirectory(packagePath, recursive: true) @@ -217,6 +226,8 @@ final class BasicTests: XCTestCase { } func testSwiftRun() throws { + try skipOnWindowsAsTestCurrentlyFails(because: "package fails to build") + try withTemporaryDirectory { tempDir in let packagePath = tempDir.appending(component: "secho") try localFileSystem.createDirectory(packagePath) diff --git a/IntegrationTests/Tests/IntegrationTests/Helpers.swift b/IntegrationTests/Tests/IntegrationTests/Helpers.swift index 0fb77e8eabe..710ae62de67 100644 --- a/IntegrationTests/Tests/IntegrationTests/Helpers.swift +++ b/IntegrationTests/Tests/IntegrationTests/Helpers.swift @@ -344,6 +344,18 @@ func XCTSkip(_ message: String? = nil) throws { throw XCTSkip(message) } +public func skipOnWindowsAsTestCurrentlyFails(because reason: String? = nil) throws { + #if os(Windows) + let failureCause: String + if let reason { + failureCause = " because \(reason.description)" + } else { + failureCause = "" + } + throw XCTSkip("Test fails on windows\(failureCause)") + #endif +} + extension ProcessResult { var integrationTests_debugDescription: String { return """ diff --git a/IntegrationTests/Tests/IntegrationTests/SwiftPMTests.swift b/IntegrationTests/Tests/IntegrationTests/SwiftPMTests.swift index e34bc16fc25..88d06037c61 100644 --- a/IntegrationTests/Tests/IntegrationTests/SwiftPMTests.swift +++ b/IntegrationTests/Tests/IntegrationTests/SwiftPMTests.swift @@ -50,6 +50,8 @@ final class SwiftPMTests: XCTestCase { } func testSwiftBuild() throws { + try skipOnWindowsAsTestCurrentlyFails(because: "SWBINTTODO: swift-build command failed") + #if os(Linux) if FileManager.default.contents(atPath: "/etc/system-release").map { String(decoding: $0, as: UTF8.self) == "Amazon Linux release 2 (Karoo)\n" } ?? false { throw XCTSkip("Skipping SwiftBuild testing on Amazon Linux because of platform issues.") diff --git a/Tests/SourceControlTests/GitRepositoryTests.swift b/Tests/SourceControlTests/GitRepositoryTests.swift index bdf69ce2a11..8ac832ae543 100644 --- a/Tests/SourceControlTests/GitRepositoryTests.swift +++ b/Tests/SourceControlTests/GitRepositoryTests.swift @@ -130,9 +130,8 @@ class GitRepositoryTests: XCTestCase { /// `Inputs`, which has known commit hashes. See the `construct.sh` script /// contained within it for more information. func testRawRepository() throws { -#if os(Windows) - try XCTSkipIf(true, "test repository has non-portable file names") -#endif + try skipOnWindowsAsTestCurrentlyFails(because: "https://github.com/swiftlang/swift-package-manager/issues/8385: test repository has non-portable file names") + try testWithTemporaryDirectory { path in // Unarchive the static test repository. let inputArchivePath = AbsolutePath(#file).parentDirectory.appending(components: "Inputs", "TestRepo.tgz") From d44947c9051060782b6519e6eead2ff53ff35d77 Mon Sep 17 00:00:00 2001 From: Sam Khouri Date: Wed, 19 Mar 2025 12:00:25 -0400 Subject: [PATCH 15/20] Run all tests in parallel --- Utilities/build-using-self | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Utilities/build-using-self b/Utilities/build-using-self index 598912ee48d..52fdb5b2488 100755 --- a/Utilities/build-using-self +++ b/Utilities/build-using-self @@ -157,7 +157,7 @@ def main() -> None: swift_testing_arg= "--enable-swift-testing" if args.enable_swift_testing else "" xctest_arg= "--enable-xctest" if args.enable_swift_testing else "" call( - shlex.split(f"swift test --configuration {args.config} --no-parallel {swift_testing_arg} {xctest_arg}"), + shlex.split(f"swift test --configuration {args.config} --parallel {swift_testing_arg} {xctest_arg}"), ) with change_directory(REPO_ROOT_PATH / "IntegrationTests"): @@ -166,7 +166,7 @@ def main() -> None: ) call( shlex.split( - f"{swiftpm_bin_dir / 'swift-test'} --no-parallel", + f"{swiftpm_bin_dir / 'swift-test'} --parallel", posix=(os.name == "posix"), # must be set correctly, otherwhsie shlex.split("C:\\Foo\\bar") become ['CFoobar'] ), ) From 35650b94f4912d20bc1dc65433767be72fd37c90 Mon Sep 17 00:00:00 2001 From: Sam Khouri Date: Wed, 19 Mar 2025 13:01:32 -0400 Subject: [PATCH 16/20] emit a log message at the end indicating we are done and move the is_on_darwin logic outside the run_bootstrap call --- Utilities/build-using-self | 35 ++++++++++++++++++----------------- 1 file changed, 18 insertions(+), 17 deletions(-) diff --git a/Utilities/build-using-self b/Utilities/build-using-self index 52fdb5b2488..d36ee00535c 100755 --- a/Utilities/build-using-self +++ b/Utilities/build-using-self @@ -114,22 +114,21 @@ def set_environment(*, swiftpm_bin_dir: pathlib.Path,) -> None: def run_bootstrap(swiftpm_bin_dir: pathlib.Path) -> None: - if is_on_darwin(): - logging.info("Current working directory is %s", pathlib.Path.cwd()) - logging.info("Bootstrapping with the XCBuild codepath...") - call( - [ - REPO_ROOT_PATH / "Utilities" / "bootstrap", - "build", - "--release", - "--verbose", - "--cross-compile-hosts", - "macosx-arm64", - "--skip-cmake-bootstrap", - "--swift-build-path", - (swiftpm_bin_dir / "swift-build").resolve(), - ], - ) + logging.info("Current working directory is %s", pathlib.Path.cwd()) + logging.info("Bootstrapping with the XCBuild codepath...") + call( + [ + REPO_ROOT_PATH / "Utilities" / "bootstrap", + "build", + "--release", + "--verbose", + "--cross-compile-hosts", + "macosx-arm64", + "--skip-cmake-bootstrap", + "--swift-build-path", + (swiftpm_bin_dir / "swift-build").resolve(), + ], + ) def main() -> None: @@ -171,7 +170,9 @@ def main() -> None: ), ) - run_bootstrap(swiftpm_bin_dir=swiftpm_bin_dir) + if is_on_darwin(): + run_bootstrap(swiftpm_bin_dir=swiftpm_bin_dir) + logging.info("Done") if __name__ == "__main__": From cac064546886adbedd486055807b6ee78329952e Mon Sep 17 00:00:00 2001 From: Sam Khouri Date: Wed, 19 Mar 2025 13:43:43 -0400 Subject: [PATCH 17/20] Skip test that might hang in CI --- Tests/SourceControlTests/GitRepositoryTests.swift | 2 ++ 1 file changed, 2 insertions(+) diff --git a/Tests/SourceControlTests/GitRepositoryTests.swift b/Tests/SourceControlTests/GitRepositoryTests.swift index 8ac832ae543..dc214b629ad 100644 --- a/Tests/SourceControlTests/GitRepositoryTests.swift +++ b/Tests/SourceControlTests/GitRepositoryTests.swift @@ -690,6 +690,8 @@ class GitRepositoryTests: XCTestCase { } func testAlternativeObjectStoreValidation() throws { + try skipOnWindowsAsTestCurrentlyFails(because: "test might hang in CI") + try testWithTemporaryDirectory { path in // Create a repo. let testRepoPath = path.appending("test-repo") From 9e67e58375565e3928d05ea3c7ad9ab5b8f59e38 Mon Sep 17 00:00:00 2001 From: Sam Khouri Date: Mon, 24 Mar 2025 09:43:01 -0400 Subject: [PATCH 18/20] fix compilation error --- IntegrationTests/Tests/IntegrationTests/BasicTests.swift | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/IntegrationTests/Tests/IntegrationTests/BasicTests.swift b/IntegrationTests/Tests/IntegrationTests/BasicTests.swift index 2fae3344dda..b01bc3e07ca 100644 --- a/IntegrationTests/Tests/IntegrationTests/BasicTests.swift +++ b/IntegrationTests/Tests/IntegrationTests/BasicTests.swift @@ -15,7 +15,7 @@ import TSCTestSupport @Suite private struct BasicTests { @Test( - .skipHostOs(.windows, "'try!' expression unexpectedly raised an error: TSCBasic.Process.Error.missingExecutableProgram(program: \"which\")") + .skipHostOS(.windows, "'try!' expression unexpectedly raised an error: TSCBasic.Process.Error.missingExecutableProgram(program: \"which\")") ) func testVersion() throws { #expect(try sh(swift, "--version").stdout.contains("Swift version")) @@ -112,7 +112,7 @@ private struct BasicTests { } @Test( - .skipHostOs(.windows, "failed to build package") + .skipHostOS(.windows, "failed to build package") ) func testSwiftPackageInitExec() throws { try withTemporaryDirectory { tempDir in @@ -201,7 +201,7 @@ private struct BasicTests { } @Test( - .skipHostOs(.windows, "unexpected failure matching") + .skipHostOS(.windows, "unexpected failure matching") ) func testSwiftPackageWithSpaces() throws { try withTemporaryDirectory { tempDir in @@ -249,7 +249,7 @@ private struct BasicTests { } @Test( - .skipHostOs(.windows, "package fails to build") + .skipHostOS(.windows, "package fails to build") ) func testSwiftRun() throws { try withTemporaryDirectory { tempDir in From 64a73e79c2eb139fb408cccb3602d7698118c224 Mon Sep 17 00:00:00 2001 From: Sam Khouri Date: Thu, 27 Mar 2025 12:08:04 -0400 Subject: [PATCH 19/20] disable more tests on windows --- Tests/BasicsTests/Environment/EnvironmentTests.swift | 2 ++ Tests/WorkspaceTests/ManifestSourceGenerationTests.swift | 4 ++++ Tests/WorkspaceTests/WorkspaceTests.swift | 7 +++++++ 3 files changed, 13 insertions(+) diff --git a/Tests/BasicsTests/Environment/EnvironmentTests.swift b/Tests/BasicsTests/Environment/EnvironmentTests.swift index 1e4eec949b7..f03bdbf8fa3 100644 --- a/Tests/BasicsTests/Environment/EnvironmentTests.swift +++ b/Tests/BasicsTests/Environment/EnvironmentTests.swift @@ -103,6 +103,8 @@ final class EnvironmentTests: XCTestCase { /// Important: This test is inherently race-prone, if it is proven to be /// flaky, it should run in a singled threaded environment/removed entirely. func test_current() throws { + try skipOnWindowsAsTestCurrentlyFails(because: "ProcessInfo.processInfo.environment[pathEnvVarName] return nil in the docker container") + #if os(Windows) let pathEnvVarName = "Path" #else diff --git a/Tests/WorkspaceTests/ManifestSourceGenerationTests.swift b/Tests/WorkspaceTests/ManifestSourceGenerationTests.swift index 309ddf8bbb1..2d82cd0fc33 100644 --- a/Tests/WorkspaceTests/ManifestSourceGenerationTests.swift +++ b/Tests/WorkspaceTests/ManifestSourceGenerationTests.swift @@ -795,6 +795,8 @@ final class ManifestSourceGenerationTests: XCTestCase { } func testStrictMemorySafety() async throws { + try skipOnWindowsAsTestCurrentlyFails(because: "compilation error: type 'SwiftSetting' has no member 'strictMemorySafety'") + let manifestContents = """ // swift-tools-version:6.2 import PackageDescription @@ -862,6 +864,8 @@ final class ManifestSourceGenerationTests: XCTestCase { } func testDefaultIsolation() async throws { + try skipOnWindowsAsTestCurrentlyFails(because: "there are compilation errors") + let manifest = Manifest.createRootManifest( displayName: "pkg", path: "/pkg", diff --git a/Tests/WorkspaceTests/WorkspaceTests.swift b/Tests/WorkspaceTests/WorkspaceTests.swift index 321366bc3a7..bea7211e8f1 100644 --- a/Tests/WorkspaceTests/WorkspaceTests.swift +++ b/Tests/WorkspaceTests/WorkspaceTests.swift @@ -10826,6 +10826,9 @@ final class WorkspaceTests: XCTestCase { } func testDuplicateTransitiveIdentityMultiplePossibleChains() async throws { + try skipOnWindowsAsTestCurrentlyFails(because: """ + threw error "\tmp\ws doesn't exist in file system" + """) let sandbox = AbsolutePath("/tmp/ws/") let fs = InMemoryFileSystem() @@ -10993,6 +10996,10 @@ final class WorkspaceTests: XCTestCase { } func testDuplicateIdentityDependenciesMultipleRoots() async throws { + try skipOnWindowsAsTestCurrentlyFails(because: """ + threw error "\tmp\ws doesn't exist in file system" + """) + let sandbox = AbsolutePath("/tmp/ws/") let fs = InMemoryFileSystem() From 9e8b4236260e9ddce4c1be25cc09dd1d41214df3 Mon Sep 17 00:00:00 2001 From: Sam Khouri Date: Thu, 27 Mar 2025 15:19:40 -0400 Subject: [PATCH 20/20] fix compilation error --- Tests/WorkspaceTests/WorkspaceTests.swift | 8 ++++---- Utilities/build-using-self | 6 +++--- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/Tests/WorkspaceTests/WorkspaceTests.swift b/Tests/WorkspaceTests/WorkspaceTests.swift index bea7211e8f1..a6948417aac 100644 --- a/Tests/WorkspaceTests/WorkspaceTests.swift +++ b/Tests/WorkspaceTests/WorkspaceTests.swift @@ -10826,9 +10826,9 @@ final class WorkspaceTests: XCTestCase { } func testDuplicateTransitiveIdentityMultiplePossibleChains() async throws { - try skipOnWindowsAsTestCurrentlyFails(because: """ + try skipOnWindowsAsTestCurrentlyFails(because: #""" threw error "\tmp\ws doesn't exist in file system" - """) + """#) let sandbox = AbsolutePath("/tmp/ws/") let fs = InMemoryFileSystem() @@ -10996,9 +10996,9 @@ final class WorkspaceTests: XCTestCase { } func testDuplicateIdentityDependenciesMultipleRoots() async throws { - try skipOnWindowsAsTestCurrentlyFails(because: """ + try skipOnWindowsAsTestCurrentlyFails(because: #""" threw error "\tmp\ws doesn't exist in file system" - """) + """#) let sandbox = AbsolutePath("/tmp/ws/") let fs = InMemoryFileSystem() diff --git a/Utilities/build-using-self b/Utilities/build-using-self index d36ee00535c..9ccf8706792 100755 --- a/Utilities/build-using-self +++ b/Utilities/build-using-self @@ -144,9 +144,9 @@ def main() -> None: shlex.split("swift --version"), ) - call( - shlex.split("swift package reset"), - ) + # call( + # shlex.split("swift package reset"), + # ) call( shlex.split("swift package update"), )