Skip to content

Commit 1cfbd3c

Browse files
authored
Mark Windows tests as intermittently failing (#9442)
Some tests are now failing on Windows, which may or may not have been related to the new toolchain used in the self hosted pipelines.
1 parent 5547e32 commit 1cfbd3c

File tree

5 files changed

+38
-29
lines changed

5 files changed

+38
-29
lines changed

Tests/CommandsTests/BuildCommandTests.swift

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -818,7 +818,7 @@ struct BuildCommandTestCases {
818818
data: BuildData,
819819
) async throws {
820820
let buildSystem = data.buildSystem
821-
try await withKnownIssue {
821+
try await withKnownIssue(isIntermittent: true) {
822822
try await fixture(name: "Miscellaneous/LibraryEvolution") { fixturePath in
823823
let result = try await build(
824824
[],
@@ -1469,7 +1469,7 @@ struct BuildCommandTestCases {
14691469
"""
14701470
Windows: Sometimes failed to build due to a possible path issue
14711471
All: --very-verbose causes rebuild on SwiftBuild (https://github.com/swiftlang/swift-package-manager/issues/9299)
1472-
""",
1472+
""",
14731473
isIntermittent: true) {
14741474
try await fixture(name: "ValidLayouts/SingleModule/ExecutableNew") { fixturePath in
14751475
_ = try await build(
@@ -1571,7 +1571,7 @@ struct BuildCommandTestCases {
15711571
) async throws {
15721572
let buildSystem = data.buildSystem
15731573
let configuration = data.config
1574-
try await withKnownIssue {
1574+
try await withKnownIssue(isIntermittent: true) {
15751575
// GIVEN we have a simple test package
15761576
try await fixture(name: "Miscellaneous/SwiftBuild") { fixturePath in
15771577
//WHEN we build with the --quiet option

Tests/CommandsTests/PackageCommandTests.swift

Lines changed: 16 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4136,6 +4136,7 @@ struct PackageCommandTests {
41364136
"https://github.com/swiftlang/swift-package-manager/issues/9006",
41374137
relationship: .defect
41384138
),
4139+
.IssueWindowsCannotSaveAttachment,
41394140
arguments: getBuildData(for: SupportedBuildSystemOnAllPlatforms),
41404141
[
41414142
// When updating these, make sure we keep testing both the singular and
@@ -4160,7 +4161,7 @@ struct PackageCommandTests {
41604161
) async throws {
41614162
let featureName = testData.featureName
41624163
let expectedSummary = testData.expectedSummary
4163-
4164+
try await withKnownIssue(isIntermittent: true) {
41644165
try await fixture(name: "SwiftMigrate/\(featureName)Migration") { fixturePath in
41654166
let sourcePaths: [AbsolutePath]
41664167
let fixedSourcePaths: [AbsolutePath]
@@ -4201,6 +4202,9 @@ struct PackageCommandTests {
42014202
let regexMatch = try Regex("> \(expectedSummary)" + #" \([0-9]\.[0-9]{1,3}s\)"#)
42024203
#expect(stdout.contains(regexMatch))
42034204
}
4205+
} when: {
4206+
ProcessInfo.hostOperatingSystem == .windows && buildData.buildSystem == .swiftbuild
4207+
}
42044208
}
42054209

42064210
@Test(
@@ -4214,6 +4218,7 @@ struct PackageCommandTests {
42144218
func migrateCommandWithBuildToolPlugins(
42154219
data: BuildData,
42164220
) async throws {
4221+
try await withKnownIssue(isIntermittent: true) {
42174222
try await fixture(name: "SwiftMigrate/ExistentialAnyWithPluginMigration") { fixturePath in
42184223
let (stdout, _) = try await execute(
42194224
["migrate", "--to-feature", "ExistentialAny"],
@@ -4239,6 +4244,9 @@ struct PackageCommandTests {
42394244
)
42404245
#expect(stdout.contains(regexMatch))
42414246
}
4247+
} when: {
4248+
ProcessInfo.hostOperatingSystem == .windows
4249+
}
42424250
}
42434251

42444252
@Test(
@@ -4247,11 +4255,13 @@ struct PackageCommandTests {
42474255
"https://github.com/swiftlang/swift-package-manager/issues/9006",
42484256
relationship: .defect
42494257
),
4258+
.IssueWindowsCannotSaveAttachment,
42504259
arguments: getBuildData(for: SupportedBuildSystemOnAllPlatforms),
42514260
)
42524261
func migrateCommandWhenDependencyBuildsForHostAndTarget(
42534262
data: BuildData,
42544263
) async throws {
4264+
try await withKnownIssue(isIntermittent: true) {
42554265
try await fixture(name: "SwiftMigrate/ExistentialAnyWithCommonPluginDependencyMigration") {
42564266
fixturePath in
42574267
let (stdout, _) = try await execute(
@@ -4268,6 +4278,9 @@ struct PackageCommandTests {
42684278
)
42694279
#expect(stdout.contains(regexMatch))
42704280
}
4281+
} when: {
4282+
ProcessInfo.hostOperatingSystem == .windows
4283+
}
42714284
}
42724285

42734286
@Test(
@@ -4528,7 +4541,7 @@ struct PackageCommandTests {
45284541
@Test(
45294542
.tags(
45304543
.Feature.Command.Build,
4531-
.Feature.PackageType.BuildToolPlugin
4544+
.Feature.PackageType.BuildToolPlugin
45324545
),
45334546
.requiresSwiftConcurrencySupport,
45344547
arguments: getBuildData(for: SupportedBuildSystemOnAllPlatforms),
@@ -5270,7 +5283,7 @@ struct PackageCommandTests {
52705283
@Test(
52715284
.tags(
52725285
.Feature.Command.Build,
5273-
.Feature.PackageType.CommandPlugin
5286+
.Feature.PackageType.CommandPlugin
52745287
),
52755288
.requiresSwiftConcurrencySupport,
52765289
.issue(

Tests/FunctionalTests/PluginTests.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1604,7 +1604,7 @@ struct PluginTests {
16041604
func testTransitivePluginOnlyDependency(
16051605
buildSystem: BuildSystemProvider.Kind,
16061606
) async throws {
1607-
try await withKnownIssue {
1607+
try await withKnownIssue(isIntermittent: true) {
16081608
try await fixture(name: "Miscellaneous/Plugins") { fixturePath in
16091609
let (stdout, _) = try await executeSwiftBuild(
16101610
fixturePath.appending("TransitivePluginOnlyDependency"),

Tests/IntegrationTests/SwiftPMTests.swift

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ private struct SwiftPMTests {
3434
runOutput.stdout == """
3535
SwiftFramework()
3636
Library(framework: SwiftFramework.SwiftFramework())
37-
37+
3838
"""
3939
)
4040
}
@@ -311,7 +311,7 @@ private struct SwiftPMTests {
311311
let coveragePath = try AbsolutePath(validating: expectedCoveragePath)
312312

313313
// Check the coverage path exists.
314-
try withKnownIssue {
314+
try withKnownIssue(isIntermittent: ProcessInfo.hostOperatingSystem == .windows) {
315315
// the CoveragePath file does not exists in Linux platform build
316316
expectFileExists(at: coveragePath)
317317

@@ -364,7 +364,7 @@ private struct SwiftPMTests {
364364
#expect(binarySpecificProfrawFiles.count == 3)
365365
}
366366
} when: {
367-
ProcessInfo.hostOperatingSystem == .linux && buildSystem == .swiftbuild
367+
[.linux, .windows].contains(ProcessInfo.hostOperatingSystem) && buildSystem == .swiftbuild
368368
}
369369
}
370370
}

Tests/PackageLoadingTests/PD_6_2_LoadingTests.swift

Lines changed: 15 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -72,25 +72,21 @@ struct PackageDescription6_2LoadingTests {
7272
"""
7373

7474
let observability = ObservabilitySystem.makeForTesting()
75-
try await withKnownIssue("https://github.com/swiftlang/swift-package-manager/issues/8543: there are compilation errors on Windows") {
76-
let (_, validationDiagnostics) = try await PackageDescriptionLoadingTests
77-
.loadAndValidateManifest(
78-
content,
79-
toolsVersion: .v6_2,
80-
packageKind: .fileSystem(.root),
81-
manifestLoader: ManifestLoader(
82-
toolchain: try! UserToolchain.default
83-
),
84-
observabilityScope: observability.topScope
85-
)
86-
try expectDiagnostics(validationDiagnostics) { results in
87-
results.checkIsEmpty()
88-
}
89-
try expectDiagnostics(observability.diagnostics) { results in
90-
results.checkIsEmpty()
91-
}
92-
} when: {
93-
isWindows && !CiEnvironment.runningInSmokeTestPipeline
75+
let (_, validationDiagnostics) = try await PackageDescriptionLoadingTests
76+
.loadAndValidateManifest(
77+
content,
78+
toolsVersion: .v6_2,
79+
packageKind: .fileSystem(.root),
80+
manifestLoader: ManifestLoader(
81+
toolchain: try! UserToolchain.default
82+
),
83+
observabilityScope: observability.topScope
84+
)
85+
try expectDiagnostics(validationDiagnostics) { results in
86+
results.checkIsEmpty()
87+
}
88+
try expectDiagnostics(observability.diagnostics) { results in
89+
results.checkIsEmpty()
9490
}
9591
}
9692
}

0 commit comments

Comments
 (0)