Skip to content

Commit 86705e6

Browse files
committed
Disable some tests when running on Windows platform smoke test
1 parent c1af525 commit 86705e6

File tree

6 files changed

+147
-18
lines changed

6 files changed

+147
-18
lines changed

Sources/_InternalTestSupport/XCTAssertHelpers.swift

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -67,10 +67,15 @@ public func XCTSkipOnWindows(because reason: String? = nil, skipPlatformCi: Bool
6767
} else {
6868
failureCause = ""
6969
}
70-
if (skipPlatformCi || skipSelfHostedCI) {
70+
if (skipPlatformCi) {
7171
try XCTSkipIfPlatformCI(because: "Test is run in Platform CI. Skipping\(failureCause)", file: file, line: line)
72+
}
73+
74+
if (skipSelfHostedCI) {
7275
try XCTSkipIfselfHostedCI(because: "Test is run in Self hosted CI. Skipping\(failureCause)", file: file, line: line)
73-
} else {
76+
}
77+
78+
if (!skipPlatformCi && !skipSelfHostedCI) {
7479
throw XCTSkip("Skipping test\(failureCause)", file: file, line: line)
7580
}
7681
#endif

Tests/CommandsTests/RunCommandTests.swift

Lines changed: 54 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -81,6 +81,12 @@ class RunCommandTestCase: CommandsBuildProviderTestCase {
8181
}
8282

8383
func testUnknownProductAndArgumentPassing() async throws {
84+
try XCTSkipOnWindows(
85+
because: """
86+
Invalid absolute path. Possibly related to https://github.com/swiftlang/swift-package-manager/issues/8511 or https://github.com/swiftlang/swift-package-manager/issues/8602
87+
""",
88+
skipPlatformCi: true,
89+
)
8490
try await fixture(name: "Miscellaneous/EchoExecutable") { fixturePath in
8591
let (stdout, stderr) = try await execute(
8692
["secho", "1", "--hello", "world"], packagePath: fixturePath)
@@ -115,6 +121,12 @@ class RunCommandTestCase: CommandsBuildProviderTestCase {
115121
}
116122

117123
func testUnreachableExecutable() async throws {
124+
try XCTSkipOnWindows(
125+
because: """
126+
Invalid absolute path. Possibly related to https://github.com/swiftlang/swift-package-manager/issues/8511 or https://github.com/swiftlang/swift-package-manager/issues/8602
127+
""",
128+
skipPlatformCi: true,
129+
)
118130
try await fixture(name: "Miscellaneous/UnreachableTargets") { fixturePath in
119131
let (output, _) = try await execute(["bexec"], packagePath: fixturePath.appending("A"))
120132
let outputLines = output.split(whereSeparator: { $0.isNewline })
@@ -246,6 +258,48 @@ class RunCommandNativeTests: RunCommandTestCase {
246258
override func testUsage() async throws {
247259
try await super.testUsage()
248260
}
261+
262+
override func testUnknownProductAndArgumentPassing() async throws {
263+
try XCTSkipOnWindows(
264+
because: """
265+
Invalid absolute path. Possibly related to https://github.com/swiftlang/swift-package-manager/issues/8511 or https://github.com/swiftlang/swift-package-manager/issues/8602
266+
""",
267+
skipPlatformCi: true,
268+
)
269+
try await super.testUnknownProductAndArgumentPassing()
270+
}
271+
272+
override func testToolsetDebugger() async throws {
273+
try XCTSkipOnWindows(
274+
because: """
275+
Invalid absolute path. Possibly related to https://github.com/swiftlang/swift-package-manager/issues/8511 or https://github.com/swiftlang/swift-package-manager/issues/8602
276+
""",
277+
skipPlatformCi: true,
278+
)
279+
try await super.testToolsetDebugger()
280+
}
281+
282+
283+
override func testUnreachableExecutable() async throws {
284+
try XCTSkipOnWindows(
285+
because: """
286+
Invalid absolute path. Possibly related to https://github.com/swiftlang/swift-package-manager/issues/8511 or https://github.com/swiftlang/swift-package-manager/issues/8602
287+
""",
288+
skipPlatformCi: true,
289+
)
290+
try await super.testUnreachableExecutable()
291+
}
292+
293+
override func testMultipleExecutableAndExplicitExecutable() async throws {
294+
try XCTSkipOnWindows(
295+
because: """
296+
Invalid absolute path. Possibly related to https://github.com/swiftlang/swift-package-manager/issues/8511 or https://github.com/swiftlang/swift-package-manager/issues/8602
297+
""",
298+
skipPlatformCi: true,
299+
)
300+
try await super.testMultipleExecutableAndExplicitExecutable()
301+
}
302+
249303
}
250304

251305

Tests/FunctionalTests/MiscellaneousTests.swift

Lines changed: 13 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -487,8 +487,12 @@ final class MiscellaneousTestCase: XCTestCase {
487487
// make sure it builds
488488
let output = try await executeSwiftBuild(appPath)
489489
// package resolution output goes to stderr
490-
XCTAssertMatch(output.stderr, .contains("Fetching \(prefix.appending("Foo"))"))
491-
XCTAssertMatch(output.stderr, .contains("Creating working copy for \(prefix.appending("Foo"))"))
490+
XCTAssertMatch(output.stderr, .contains("Fetching \(prefix.appending("Foo").pathString)"))
491+
XCTAssertMatch(output.stderr, .contains("Fetched \(prefix.appending("Foo").pathString)"))
492+
XCTAssertMatch(output.stderr, .contains("Creating working copy for \(prefix.appending("Foo").pathString)"))
493+
XCTAssertMatch(output.stderr, .contains("Fetching \(prefix.appending("Bar").pathString)"))
494+
XCTAssertMatch(output.stderr, .contains("Fetched \(prefix.appending("Bar").pathString)"))
495+
XCTAssertMatch(output.stderr, .contains("Creating working copy for \(prefix.appending("Bar").pathString)"))
492496
// in "swift build" build output goes to stdout
493497
XCTAssertMatch(output.stdout, .contains("Build complete!"))
494498
}
@@ -597,6 +601,12 @@ final class MiscellaneousTestCase: XCTestCase {
597601
func testPluginGeneratedResources() async throws {
598602
// Only run the test if the environment in which we're running actually supports Swift concurrency (which the plugin APIs require).
599603
try XCTSkipIf(!UserToolchain.default.supportsSwiftConcurrency(), "skipping because test environment doesn't support concurrency")
604+
try XCTSkipOnWindows(
605+
because: """
606+
Invalid path. Possibly related to https://github.com/swiftlang/swift-package-manager/issues/8511 or https://github.com/swiftlang/swift-package-manager/issues/8602
607+
""",
608+
skipPlatformCi: true,
609+
)
600610

601611
try await fixture(name: "Miscellaneous/PluginGeneratedResources") { path in
602612
let result = try await SwiftPM.Run.execute(packagePath: path)
@@ -610,7 +620,7 @@ final class MiscellaneousTestCase: XCTestCase {
610620
await XCTAssertBuilds(fixturePath)
611621
}
612622
}
613-
623+
614624
func testNoJSONOutputWithFlatPackageStructure() async throws {
615625
try await fixture(name: "Miscellaneous/FlatPackage") { package in
616626
// First build, make sure we got the `.build` directory where we expect it, and that there is no JSON output (by looking for known output).

Tests/FunctionalTests/ResourcesTests.swift

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

1818
final class ResourcesTests: XCTestCase {
1919
func testSimpleResources() async throws {
20+
try XCTSkipOnWindows(
21+
because: """
22+
Invalid path. Possibly related to https://github.com/swiftlang/swift-package-manager/issues/8511 or https://github.com/swiftlang/swift-package-manager/issues/8602
23+
""",
24+
skipPlatformCi: true,
25+
)
26+
2027
try await fixture(name: "Resources/Simple") { fixturePath in
2128
var executables = ["SwiftyResource"]
2229

Tests/FunctionalTests/TraitTests.swift

Lines changed: 51 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,12 @@ final class TraitTests: XCTestCase {
4040
}
4141

4242
func testTraits_whenTraitUnification() async throws {
43+
try XCTSkipOnWindows(
44+
because: """
45+
Error during swift Run Invalid path. Possibly related to https://github.com/swiftlang/swift-package-manager/issues/8511 or https://github.com/swiftlang/swift-package-manager/issues/8602
46+
""",
47+
skipPlatformCi: true,
48+
)
4349
try await fixture(name: "Traits") { fixturePath in
4450
let (stdout, stderr) = try await executeSwiftRun(
4551
fixturePath.appending("Example"),
@@ -66,6 +72,12 @@ final class TraitTests: XCTestCase {
6672
}
6773

6874
func testTraits_whenTraitUnification_whenSecondTraitNotEnabled() async throws {
75+
try XCTSkipOnWindows(
76+
because: """
77+
Error during swift Run Invalid path. Possibly related to https://github.com/swiftlang/swift-package-manager/issues/8511 or https://github.com/swiftlang/swift-package-manager/issues/8602
78+
""",
79+
skipPlatformCi: true,
80+
)
6981
try await fixture(name: "Traits") { fixturePath in
7082
let (stdout, stderr) = try await executeSwiftRun(
7183
fixturePath.appending("Example"),
@@ -90,6 +102,12 @@ final class TraitTests: XCTestCase {
90102
}
91103

92104
func testTraits_whenIndividualTraitsEnabled_andDefaultTraits() async throws {
105+
try XCTSkipOnWindows(
106+
because: """
107+
Error during swift Run Invalid path. Possibly related to https://github.com/swiftlang/swift-package-manager/issues/8511 or https://github.com/swiftlang/swift-package-manager/issues/8602
108+
""",
109+
skipPlatformCi: true,
110+
)
93111
try await fixture(name: "Traits") { fixturePath in
94112
let (stdout, stderr) = try await executeSwiftRun(
95113
fixturePath.appending("Example"),
@@ -119,6 +137,13 @@ final class TraitTests: XCTestCase {
119137
}
120138

121139
func testTraits_whenDefaultTraitsDisabled() async throws {
140+
try XCTSkipOnWindows(
141+
because: """
142+
Error during swift Run Invalid path. Possibly related to https://github.com/swiftlang/swift-package-manager/issues/8511 or https://github.com/swiftlang/swift-package-manager/issues/8602
143+
""",
144+
skipPlatformCi: true,
145+
)
146+
122147
try await fixture(name: "Traits") { fixturePath in
123148
let (stdout, stderr) = try await executeSwiftRun(
124149
fixturePath.appending("Example"),
@@ -137,6 +162,12 @@ final class TraitTests: XCTestCase {
137162
}
138163

139164
func testTraits_whenIndividualTraitsEnabled_andDefaultTraitsDisabled() async throws {
165+
try XCTSkipOnWindows(
166+
because: """
167+
Error during swift Run Invalid path. Possibly related to https://github.com/swiftlang/swift-package-manager/issues/8511 or https://github.com/swiftlang/swift-package-manager/issues/8602
168+
""",
169+
skipPlatformCi: true,
170+
)
140171
try await fixture(name: "Traits") { fixturePath in
141172
let (stdout, stderr) = try await executeSwiftRun(
142173
fixturePath.appending("Example"),
@@ -158,6 +189,13 @@ final class TraitTests: XCTestCase {
158189
}
159190

160191
func testTraits_whenAllTraitsEnabled() async throws {
192+
try XCTSkipOnWindows(
193+
because: """
194+
Error during swift Run Invalid path. Possibly related to https://github.com/swiftlang/swift-package-manager/issues/8511 or https://github.com/swiftlang/swift-package-manager/issues/8602
195+
""",
196+
skipPlatformCi: true,
197+
)
198+
161199
try await fixture(name: "Traits") { fixturePath in
162200
let (stdout, stderr) = try await executeSwiftRun(
163201
fixturePath.appending("Example"),
@@ -187,6 +225,13 @@ final class TraitTests: XCTestCase {
187225
}
188226

189227
func testTraits_whenAllTraitsEnabled_andDefaultTraitsDisabled() async throws {
228+
try XCTSkipOnWindows(
229+
because: """
230+
Error during swift Run Invalid path. Possibly related to https://github.com/swiftlang/swift-package-manager/issues/8511 or https://github.com/swiftlang/swift-package-manager/issues/8602
231+
""",
232+
skipPlatformCi: true,
233+
)
234+
190235
try await fixture(name: "Traits") { fixturePath in
191236
let (stdout, stderr) = try await executeSwiftRun(
192237
fixturePath.appending("Example"),
@@ -231,6 +276,12 @@ final class TraitTests: XCTestCase {
231276
}
232277

233278
func testTests_whenNoFlagPassed() async throws {
279+
try XCTSkipOnWindows(
280+
because: """
281+
Error during swift Run Invalid path. Possibly related to https://github.com/swiftlang/swift-package-manager/issues/8511 or https://github.com/swiftlang/swift-package-manager/issues/8602
282+
""",
283+
skipPlatformCi: true,
284+
)
234285
try await fixture(name: "Traits") { fixturePath in
235286
let (stdout, _) = try await executeSwiftTest(
236287
fixturePath.appending("Example"),

Tests/WorkspaceTests/ManifestSourceGenerationTests.swift

Lines changed: 15 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,9 @@ final class ManifestSourceGenerationTests: XCTestCase {
4141
toolsVersion: ToolsVersion,
4242
toolsVersionHeaderComment: String? = .none,
4343
additionalImportModuleNames: [String] = [],
44-
fs: FileSystem = localFileSystem
44+
fs: FileSystem = localFileSystem,
45+
file: StaticString = #file,
46+
line: UInt = #line,
4547
) async throws -> String {
4648
try await withTemporaryDirectory { packageDir in
4749
let observability = ObservabilitySystem.makeForTesting()
@@ -98,18 +100,18 @@ final class ManifestSourceGenerationTests: XCTestCase {
98100

99101
// Check that all the relevant properties survived.
100102
let failureDetails = "\n--- ORIGINAL MANIFEST CONTENTS ---\n" + manifestContents + "\n--- REWRITTEN MANIFEST CONTENTS ---\n" + newContents
101-
XCTAssertEqual(newManifest.toolsVersion, manifest.toolsVersion, failureDetails)
102-
XCTAssertEqual(newManifest.displayName, manifest.displayName, failureDetails)
103-
XCTAssertEqual(newManifest.defaultLocalization, manifest.defaultLocalization, failureDetails)
104-
XCTAssertEqual(newManifest.platforms, manifest.platforms, failureDetails)
105-
XCTAssertEqual(newManifest.pkgConfig, manifest.pkgConfig, failureDetails)
106-
XCTAssertEqual(newManifest.providers, manifest.providers, failureDetails)
107-
XCTAssertEqual(newManifest.products, manifest.products, failureDetails)
108-
XCTAssertEqual(newManifest.dependencies, manifest.dependencies, failureDetails)
109-
XCTAssertEqual(newManifest.targets, manifest.targets, failureDetails)
110-
XCTAssertEqual(newManifest.swiftLanguageVersions, manifest.swiftLanguageVersions, failureDetails)
111-
XCTAssertEqual(newManifest.cLanguageStandard, manifest.cLanguageStandard, failureDetails)
112-
XCTAssertEqual(newManifest.cxxLanguageStandard, manifest.cxxLanguageStandard, failureDetails)
103+
XCTAssertEqual(newManifest.toolsVersion, manifest.toolsVersion, "toolsVersion not as expected" + failureDetails, file: file, line: line)
104+
XCTAssertEqual(newManifest.displayName, manifest.displayName, "displayName not as expected" + failureDetails, file: file, line: line)
105+
XCTAssertEqual(newManifest.defaultLocalization, manifest.defaultLocalization, "defaultLocalization not as expected" + failureDetails, file: file, line: line)
106+
XCTAssertEqual(newManifest.platforms, manifest.platforms, "platforms not as expected" + failureDetails, file: file, line: line)
107+
XCTAssertEqual(newManifest.pkgConfig, manifest.pkgConfig, "pkgConfig not as expected" + failureDetails, file: file, line: line)
108+
XCTAssertEqual(newManifest.providers, manifest.providers, "providers not as expected" + failureDetails, file: file, line: line)
109+
XCTAssertEqual(newManifest.products, manifest.products, "products not as expected" + failureDetails, file: file, line: line)
110+
XCTAssertEqual(newManifest.dependencies, manifest.dependencies, "dependencies not as expected" + failureDetails, file: file, line: line)
111+
XCTAssertEqual(newManifest.targets, manifest.targets, "targets not as expected" + failureDetails, file: file, line: line)
112+
XCTAssertEqual(newManifest.swiftLanguageVersions, manifest.swiftLanguageVersions, "swiftLanguageVersions not as expected" + failureDetails, file: file, line: line)
113+
XCTAssertEqual(newManifest.cLanguageStandard, manifest.cLanguageStandard, "cLanguageStandard not as expected" + failureDetails, file: file, line: line)
114+
XCTAssertEqual(newManifest.cxxLanguageStandard, manifest.cxxLanguageStandard, "cxxLanguageStandard not as expected" + failureDetails, file: file, line: line)
113115

114116
// Return the generated manifest so that the caller can do further testing on it.
115117
return newContents

0 commit comments

Comments
 (0)