Skip to content

Commit d6ee90f

Browse files
committed
Disable some tests when running on Windows platform smoke test
1 parent fab8843 commit d6ee90f

File tree

7 files changed

+168
-19
lines changed

7 files changed

+168
-19
lines changed

Fixtures/Traits/Example/Tests/ExampleTests/Tests.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
#if Package1
1+
T#if Package1
22
import Package1Library1
33
#endif
44
#if Package2

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: 15 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,14 @@ 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+
error: exec error: No such file or directory (2): T:\tmp\Miscellaneous_PluginGeneratedResources.VGUM4E\Miscellaneous_PluginGeneratedResources\.build\x86_64-unknown-windows-msvc\debug\PluginGeneratedResources ..\..\..\..\..\..\..\T:\tmp\Miscellaneous_PluginGeneratedResources.VGUM4E\Miscellaneous_PluginGeneratedResources\.build\x86_64-unknown-windows-msvc\debug\PluginGeneratedResources
607+
608+
Invalid path. Possibly related to https://github.com/swiftlang/swift-package-manager/issues/8511 or https://github.com/swiftlang/swift-package-manager/issues/8602
609+
""",
610+
skipPlatformCi: true,
611+
)
600612
601613
try await fixture(name: "Miscellaneous/PluginGeneratedResources") { path in
602614
let result = try await SwiftPM.Run.execute(packagePath: path)
@@ -610,7 +622,7 @@ final class MiscellaneousTestCase: XCTestCase {
610622
await XCTAssertBuilds(fixturePath)
611623
}
612624
}
613-
625+
614626
func testNoJSONOutputWithFlatPackageStructure() async throws {
615627
try await fixture(name: "Miscellaneous/FlatPackage") { package in
616628
// 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: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,15 @@ import XCTest
1717

1818
final class ResourcesTests: XCTestCase {
1919
func testSimpleResources() async throws {
20+
try XCTSkipOnWindows(
21+
because: """
22+
error: exec error: No such file or directory (2): T:\tmp\Resources_Simple.9ch6d9\Resources_Simple\.build\x86_64-unknown-windows-msvc\debug\SwiftyResource ..\..\..\..\..\..\..\T:\tmp\Resources_Simple.9ch6d9\Resources_Simple\.build\x86_64-unknown-windows-msvc\debug\SwiftyResource
23+
24+
Invalid path. Possibly related to https://github.com/swiftlang/swift-package-manager/issues/8511 or https://github.com/swiftlang/swift-package-manager/issues/8602
25+
""",
26+
skipPlatformCi: true,
27+
)
28+
2029
try await fixture(name: "Resources/Simple") { fixturePath in
2130
var executables = ["SwiftyResource"]
2231

Tests/FunctionalTests/TraitTests.swift

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

4242
func testTraits_whenTraitUnification() async throws {
43+
try XCTSkipOnWindows(
44+
because: """
45+
error: exec error: No such file or directory (2): T:\tmp\Traits.ZtsuZL\Example\.build\x86_64-unknown-windows-msvc\debug\Example ..\..\..\..\..\..\..\T:\tmp\Traits.ZtsuZL\Example\.build\x86_64-unknown-windows-msvc\debug\Example
46+
47+
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
48+
""",
49+
skipPlatformCi: true,
50+
)
4351
try await fixture(name: "Traits") { fixturePath in
4452
let (stdout, stderr) = try await executeSwiftRun(
4553
fixturePath.appending("Example"),
@@ -66,6 +74,14 @@ final class TraitTests: XCTestCase {
6674
}
6775

6876
func testTraits_whenTraitUnification_whenSecondTraitNotEnabled() async throws {
77+
try XCTSkipOnWindows(
78+
because: """
79+
error: exec error: No such file or directory (2): T:\tmp\Traits.ZtsuZL\Example\.build\x86_64-unknown-windows-msvc\debug\Example ..\..\..\..\..\..\..\T:\tmp\Traits.ZtsuZL\Example\.build\x86_64-unknown-windows-msvc\debug\Example
80+
81+
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
82+
""",
83+
skipPlatformCi: true,
84+
)
6985
try await fixture(name: "Traits") { fixturePath in
7086
let (stdout, stderr) = try await executeSwiftRun(
7187
fixturePath.appending("Example"),
@@ -90,6 +106,14 @@ final class TraitTests: XCTestCase {
90106
}
91107
92108
func testTraits_whenIndividualTraitsEnabled_andDefaultTraits() async throws {
109+
try XCTSkipOnWindows(
110+
because: """
111+
error: exec error: No such file or directory (2): T:\tmp\Traits.ZtsuZL\Example\.build\x86_64-unknown-windows-msvc\debug\Example ..\..\..\..\..\..\..\T:\tmp\Traits.ZtsuZL\Example\.build\x86_64-unknown-windows-msvc\debug\Example
112+
113+
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
114+
""",
115+
skipPlatformCi: true,
116+
)
93117
try await fixture(name: "Traits") { fixturePath in
94118
let (stdout, stderr) = try await executeSwiftRun(
95119
fixturePath.appending("Example"),
@@ -119,6 +143,15 @@ final class TraitTests: XCTestCase {
119143
}
120144
121145
func testTraits_whenDefaultTraitsDisabled() async throws {
146+
try XCTSkipOnWindows(
147+
because: """
148+
error: exec error: No such file or directory (2): T:\tmp\Traits.ZtsuZL\Example\.build\x86_64-unknown-windows-msvc\debug\Example ..\..\..\..\..\..\..\T:\tmp\Traits.ZtsuZL\Example\.build\x86_64-unknown-windows-msvc\debug\Example
149+
150+
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
151+
""",
152+
skipPlatformCi: true,
153+
)
154+
122155
try await fixture(name: "Traits") { fixturePath in
123156
let (stdout, stderr) = try await executeSwiftRun(
124157
fixturePath.appending("Example"),
@@ -137,6 +170,14 @@ final class TraitTests: XCTestCase {
137170
}
138171
139172
func testTraits_whenIndividualTraitsEnabled_andDefaultTraitsDisabled() async throws {
173+
try XCTSkipOnWindows(
174+
because: """
175+
error: exec error: No such file or directory (2): T:\tmp\Traits.ZtsuZL\Example\.build\x86_64-unknown-windows-msvc\debug\Example ..\..\..\..\..\..\..\T:\tmp\Traits.ZtsuZL\Example\.build\x86_64-unknown-windows-msvc\debug\Example
176+
177+
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
178+
""",
179+
skipPlatformCi: true,
180+
)
140181
try await fixture(name: "Traits") { fixturePath in
141182
let (stdout, stderr) = try await executeSwiftRun(
142183
fixturePath.appending("Example"),
@@ -158,6 +199,15 @@ final class TraitTests: XCTestCase {
158199
}
159200
160201
func testTraits_whenAllTraitsEnabled() async throws {
202+
try XCTSkipOnWindows(
203+
because: """
204+
error: exec error: No such file or directory (2): T:\tmp\Traits.ZtsuZL\Example\.build\x86_64-unknown-windows-msvc\debug\Example ..\..\..\..\..\..\..\T:\tmp\Traits.ZtsuZL\Example\.build\x86_64-unknown-windows-msvc\debug\Example
205+
206+
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
207+
""",
208+
skipPlatformCi: true,
209+
)
210+
161211
try await fixture(name: "Traits") { fixturePath in
162212
let (stdout, stderr) = try await executeSwiftRun(
163213
fixturePath.appending("Example"),
@@ -187,6 +237,15 @@ final class TraitTests: XCTestCase {
187237
}
188238
189239
func testTraits_whenAllTraitsEnabled_andDefaultTraitsDisabled() async throws {
240+
try XCTSkipOnWindows(
241+
because: """
242+
error: exec error: No such file or directory (2): T:\tmp\Traits.ZtsuZL\Example\.build\x86_64-unknown-windows-msvc\debug\Example ..\..\..\..\..\..\..\T:\tmp\Traits.ZtsuZL\Example\.build\x86_64-unknown-windows-msvc\debug\Example
243+
244+
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
245+
""",
246+
skipPlatformCi: true,
247+
)
248+
190249
try await fixture(name: "Traits") { fixturePath in
191250
let (stdout, stderr) = try await executeSwiftRun(
192251
fixturePath.appending("Example"),
@@ -231,6 +290,14 @@ final class TraitTests: XCTestCase {
231290
}
232291
233292
func testTests_whenNoFlagPassed() async throws {
293+
try XCTSkipOnWindows(
294+
because: """
295+
error: exec error: No such file or directory (2): T:\tmp\Traits.ZtsuZL\Example\.build\x86_64-unknown-windows-msvc\debug\Example ..\..\..\..\..\..\..\T:\tmp\Traits.ZtsuZL\Example\.build\x86_64-unknown-windows-msvc\debug\Example
296+
297+
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
298+
""",
299+
skipPlatformCi: true,
300+
)
234301
try await fixture(name: "Traits") { fixturePath in
235302
let (stdout, _) = try await executeSwiftTest(
236303
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)