Skip to content

Commit fcf3c12

Browse files
authored
Add tags to swift-testing tests that have withKnownIssue calls. (#9312)
* Add tags for tracking to tests that have withKnownIssue invocations, for bucketing and tracking purposes. * Fix spelling mistake for "Component"
1 parent 36c3549 commit fcf3c12

File tree

11 files changed

+220
-16
lines changed

11 files changed

+220
-16
lines changed

Sources/_InternalTestSupport/SwiftTesting+Tags.swift

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@ extension Tag.Feature {
2929
public enum PackageType {}
3030
public enum ProductType {}
3131
public enum TargetType {}
32+
public enum Product {}
3233

3334
@Tag public static var BuildCache: Tag
3435
@Tag public static var CodeCoverage: Tag
@@ -38,6 +39,7 @@ extension Tag.Feature {
3839
@Tag public static var SpecialCharacters: Tag
3940
@Tag public static var Snippets: Tag
4041
@Tag public static var Traits: Tag
42+
@Tag public static var TargetSettings: Tag
4143

4244
}
4345

@@ -77,6 +79,17 @@ extension Tag.Feature.CommandLineArguments {
7779
@Tag public static var Xcxx: Tag
7880
@Tag public static var SWIFT_ORIGINAL_PATH: Tag
7981
@Tag public static var Xswiftc: Tag
82+
@Tag public static var TestParallel: Tag
83+
@Tag public static var TestNoParallel: Tag
84+
@Tag public static var TestOutputXunit: Tag
85+
@Tag public static var TestEnableSwiftTesting: Tag
86+
@Tag public static var TestDisableSwiftTesting: Tag
87+
@Tag public static var TestEnableXCTest: Tag
88+
@Tag public static var TestDisableXCTest: Tag
89+
@Tag public static var TestFilter: Tag
90+
@Tag public static var TestSkip: Tag
91+
@Tag public static var SkipBuild: Tag
92+
@Tag public static var EnableCodeCoverage: Tag
8093
}
8194

8295
extension Tag.Feature.CommandLineArguments.Experimental {
@@ -151,3 +164,8 @@ extension Tag.Feature.PackageType {
151164
@Tag public static var CommandPlugin: Tag
152165
@Tag public static var Macro: Tag
153166
}
167+
168+
extension Tag.Feature.Product {
169+
@Tag public static var Execute: Tag
170+
@Tag public static var Link: Tag
171+
}

Sources/_InternalTestSupport/SwiftTesting+TraitsBug.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ extension Trait where Self == Testing.Bug {
3838
)
3939
}
4040

41-
public static var IssueWindowsPathLastConponent: Self {
41+
public static var IssueWindowsPathLastComponent: Self {
4242
// $0.path.lastComponent in test code returns fullpaths on Windows
4343
issue(
4444
"https://github.com/swiftlang/swift-package-manager/issues/8554",

Tests/CommandsTests/APIDiffTests.swift

Lines changed: 23 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -197,6 +197,9 @@ struct APIDiffTests {
197197
}
198198

199199
@Test(
200+
.tags(
201+
.Feature.Command.Run,
202+
),
200203
.requiresAPIDigester,
201204
.issue("https://github.com/swiftlang/swift-package-manager/issues/8926", relationship: .defect),
202205
arguments: SupportedBuildSystemOnAllPlatforms,
@@ -272,7 +275,13 @@ struct APIDiffTests {
272275
}
273276
}
274277

275-
@Test(.requiresAPIDigester, arguments: SupportedBuildSystemOnAllPlatforms)
278+
@Test(
279+
.tags(
280+
.Feature.Command.Run,
281+
),
282+
.requiresAPIDigester,
283+
arguments: SupportedBuildSystemOnAllPlatforms
284+
)
276285
func testAPIDiffOfModuleWithCDependency(buildSystem: BuildSystemProvider.Kind) async throws {
277286
try await withKnownIssue("https://github.com/swiftlang/swift/issues/82394") {
278287
try await fixture(name: "Miscellaneous/APIDiff/") { fixturePath in
@@ -303,7 +312,13 @@ struct APIDiffTests {
303312
}
304313
}
305314

306-
@Test(.requiresAPIDigester, arguments: SupportedBuildSystemOnAllPlatforms)
315+
@Test(
316+
.tags(
317+
.Feature.Command.Run,
318+
),
319+
.requiresAPIDigester,
320+
arguments: SupportedBuildSystemOnAllPlatforms
321+
)
307322
func testAPIDiffOfVendoredCDependency(buildSystem: BuildSystemProvider.Kind) async throws {
308323
try await withKnownIssue("https://github.com/swiftlang/swift/issues/82394") {
309324
try await fixture(name: "Miscellaneous/APIDiff/") { fixturePath in
@@ -318,6 +333,9 @@ struct APIDiffTests {
318333
}
319334

320335
@Test(
336+
.tags(
337+
.Feature.Command.Run,
338+
),
321339
.requiresAPIDigester,
322340
.issue("https://github.com/swiftlang/swift-package-manager/issues/8926", relationship: .defect),
323341
arguments: SupportedBuildSystemOnAllPlatforms,
@@ -341,6 +359,9 @@ struct APIDiffTests {
341359
}
342360

343361
@Test(
362+
.tags(
363+
.Feature.Command.Run,
364+
),
344365
.requiresAPIDigester,
345366
.issue("https://github.com/swiftlang/swift-package-manager/issues/8926", relationship: .defect),
346367
arguments: SupportedBuildSystemOnAllPlatforms,

Tests/CommandsTests/BuildCommandTests.swift

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -354,6 +354,10 @@ struct BuildCommandTestCases {
354354
}
355355

356356
@Test(
357+
.tags(
358+
.Feature.Command.Build,
359+
.Feature.TargetType.Executable
360+
),
357361
.IssueWindowsLongPath,
358362
buildDataUsingAllBuildSystemWithTags.tags,
359363
arguments: buildDataUsingAllBuildSystemWithTags.buildData,

Tests/CommandsTests/CoverageTests.swift

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -24,14 +24,16 @@ import Testing
2424
.tags(
2525
.TestSize.large,
2626
.Feature.CodeCoverage,
27+
.Feature.CommandLineArguments.EnableCodeCoverage
2728
)
2829
)
2930
struct CoverageTests {
3031
@Test(
3132
.SWBINTTODO("Test failed because of missing plugin support in the PIF builder. This can be reinvestigated after the support is there."),
3233
.tags(
33-
Tag.Feature.CodeCoverage,
34-
Tag.Feature.Command.Test,
34+
.Feature.Command.Build,
35+
.Feature.Command.Test,
36+
.Feature.CommandLineArguments.BuildTests,
3537
),
3638
arguments: SupportedBuildSystemOnAllPlatforms,
3739
)
@@ -69,8 +71,8 @@ struct CoverageTests {
6971
.SWBINTTODO("Test failed because of missing plugin support in the PIF builder. This can be reinvestigated after the support is there."),
7072
.IssueWindowsCannotSaveAttachment,
7173
.tags(
72-
Tag.Feature.CodeCoverage,
73-
Tag.Feature.Command.Test,
74+
.Feature.Command.Test,
75+
.Feature.CommandLineArguments.BuildTests,
7476
),
7577
arguments: SupportedBuildSystemOnAllPlatforms,
7678
)
@@ -129,6 +131,9 @@ struct CoverageTests {
129131
}
130132

131133
@Test(
134+
.tags(
135+
.Feature.Command.Test,
136+
),
132137
arguments: getBuildData(for: SupportedBuildSystemOnAllPlatforms), [
133138
"Coverage/Simple",
134139
"Miscellaneous/TestDiscovery/Simple",

Tests/CommandsTests/PackageCommandTests.swift

Lines changed: 46 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -911,6 +911,9 @@ struct PackageCommandTests {
911911
}
912912

913913
@Test(
914+
.tags(
915+
.Feature.Command.Package.Describe
916+
),
914917
.IssueWindowsRelativePathAssert,
915918
arguments: getBuildData(for: SupportedBuildSystemOnAllPlatforms),
916919
)
@@ -4393,6 +4396,10 @@ struct PackageCommandTests {
43934396
}
43944397

43954398
@Test(
4399+
.tags(
4400+
.Feature.Command.Build,
4401+
.Feature.PackageType.BuildToolPlugin
4402+
),
43964403
.requiresSwiftConcurrencySupport,
43974404
arguments: getBuildData(for: SupportedBuildSystemOnAllPlatforms),
43984405
)
@@ -5131,6 +5138,10 @@ struct PackageCommandTests {
51315138

51325139
// Test reporting of plugin diagnostic messages at different verbosity levels
51335140
@Test(
5141+
.tags(
5142+
.Feature.Command.Build,
5143+
.Feature.PackageType.CommandPlugin
5144+
),
51345145
.requiresSwiftConcurrencySupport,
51355146
.issue(
51365147
"https://github.com/swiftlang/swift-package-manager/issues/8180",
@@ -5322,6 +5333,10 @@ struct PackageCommandTests {
53225333

53235334
// Test target builds requested by a command plugin
53245335
@Test(
5336+
.tags(
5337+
.Feature.Command.Run,
5338+
.Feature.PackageType.CommandPlugin
5339+
),
53255340
.IssueWindowsRelativePathAssert,
53265341
.requiresSwiftConcurrencySupport,
53275342
arguments: getBuildData(for: SupportedBuildSystemOnAllPlatforms),
@@ -5353,6 +5368,10 @@ struct PackageCommandTests {
53535368

53545369
// Test target builds requested by a command plugin
53555370
@Test(
5371+
.tags(
5372+
.Feature.Command.Run,
5373+
.Feature.PackageType.CommandPlugin
5374+
),
53565375
.IssueWindowsRelativePathAssert,
53575376
.requiresSwiftConcurrencySupport,
53585377
arguments: getBuildData(for: SupportedBuildSystemOnAllPlatforms),
@@ -5388,6 +5407,10 @@ struct PackageCommandTests {
53885407

53895408
// Test target builds requested by a command plugin
53905409
@Test(
5410+
.tags(
5411+
.Feature.Command.Run,
5412+
.Feature.PackageType.CommandPlugin
5413+
),
53915414
.IssueWindowsRelativePathAssert,
53925415
.requiresSwiftConcurrencySupport,
53935416
arguments: getBuildData(for: SupportedBuildSystemOnAllPlatforms),
@@ -5422,6 +5445,10 @@ struct PackageCommandTests {
54225445

54235446
// Test target builds requested by a command plugin
54245447
@Test(
5448+
.tags(
5449+
.Feature.Command.Run,
5450+
.Feature.PackageType.CommandPlugin
5451+
),
54255452
.IssueWindowsRelativePathAssert,
54265453
.requiresSwiftConcurrencySupport,
54275454
arguments: getBuildData(for: SupportedBuildSystemOnAllPlatforms),
@@ -5459,6 +5486,10 @@ struct PackageCommandTests {
54595486
}
54605487

54615488
@Test(
5489+
.tags(
5490+
.Feature.Command.Run,
5491+
.Feature.PackageType.CommandPlugin
5492+
),
54625493
.IssueWindowsRelativePathAssert,
54635494
arguments: getBuildData(for: SupportedBuildSystemOnAllPlatforms),
54645495
)
@@ -5484,6 +5515,10 @@ struct PackageCommandTests {
54845515
}
54855516

54865517
@Test(
5518+
.tags(
5519+
.Feature.Command.Run,
5520+
.Feature.PackageType.CommandPlugin
5521+
),
54875522
.IssueWindowsRelativePathAssert,
54885523
arguments: getBuildData(for: SupportedBuildSystemOnAllPlatforms),
54895524
)
@@ -5508,6 +5543,10 @@ struct PackageCommandTests {
55085543
}
55095544

55105545
@Test(
5546+
.tags(
5547+
.Feature.Command.Run,
5548+
.Feature.PackageType.CommandPlugin
5549+
),
55115550
.IssueWindowsRelativePathAssert,
55125551
.tags(
55135552
.Feature.Command.Package.CommandPlugin,
@@ -5537,6 +5576,10 @@ struct PackageCommandTests {
55375576

55385577
// Test logging of builds initiated by a command plugin
55395578
@Test(
5579+
.tags(
5580+
.Feature.Command.Build,
5581+
.Feature.PackageType.CommandPlugin
5582+
),
55405583
.IssueWindowsRelativePathAssert,
55415584
.requiresSwiftConcurrencySupport,
55425585
.tags(
@@ -5774,11 +5817,12 @@ struct PackageCommandTests {
57745817
@Test(
57755818
.requiresSwiftConcurrencySupport,
57765819
.tags(
5820+
.Feature.Command.Run,
57775821
.Feature.Command.Package.CommandPlugin,
57785822
),
57795823
.IssueWindowsRelativePathAssert,
57805824
.IssueWindowsLongPath,
5781-
.IssueWindowsPathLastConponent,
5825+
.IssueWindowsPathLastComponent,
57825826
.issue(
57835827
"https://github.com/swiftlang/swift-package-manager/issues/9083",
57845828
relationship: .defect,
@@ -6747,7 +6791,7 @@ struct PackageCommandTests {
67476791
}
67486792

67496793
@Test(
6750-
.IssueWindowsPathLastConponent,
6794+
.IssueWindowsPathLastComponent,
67516795
// Only run the test if the environment in which we're running actually supports Swift concurrency (which the plugin APIs require).
67526796
.requiresSwiftConcurrencySupport,
67536797
.tags(

Tests/CommandsTests/RunCommandTests.swift

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -142,6 +142,9 @@ struct RunCommandTests {
142142
}
143143

144144
@Test(
145+
.tags(
146+
.Feature.TargetType.Executable,
147+
),
145148
.IssueWindowsPathTestsFailures,
146149
.IssueWindowsRelativePathAssert,
147150
arguments: SupportedBuildSystemOnPlatform,
@@ -207,6 +210,9 @@ struct RunCommandTests {
207210

208211

209212
@Test(
213+
.tags(
214+
.Feature.TargetType.Executable,
215+
),
210216
.SWBINTTODO("Swift run using Swift Build does not output executable content to the terminal"),
211217
.bug("https://github.com/swiftlang/swift-package-manager/issues/8279"),
212218
arguments: SupportedBuildSystemOnPlatform,
@@ -244,6 +250,9 @@ struct RunCommandTests {
244250

245251

246252
@Test(
253+
.tags(
254+
.Feature.TargetType.Executable,
255+
),
247256
.IssueWindowsPathTestsFailures,
248257
.IssueWindowsRelativePathAssert,
249258
arguments: SupportedBuildSystemOnPlatform,
@@ -263,6 +272,9 @@ struct RunCommandTests {
263272
}
264273

265274
@Test(
275+
.tags(
276+
.Feature.TargetType.Executable,
277+
),
266278
arguments: SupportedBuildSystemOnPlatform,
267279
)
268280
func fileDeprecation(
@@ -282,6 +294,11 @@ struct RunCommandTests {
282294
}
283295

284296
@Test(
297+
.tags(
298+
.Feature.TargetType.Executable,
299+
.Feature.CommandLineArguments.BuildTests,
300+
.Feature.CommandLineArguments.SkipBuild
301+
),
285302
arguments: SupportedBuildSystemOnPlatform,
286303
)
287304
func mutualExclusiveFlags(
@@ -304,6 +321,9 @@ struct RunCommandTests {
304321
}
305322

306323
@Test(
324+
.tags(
325+
.Feature.TargetType.Executable,
326+
),
307327
arguments: SupportedBuildSystemOnPlatform,
308328
)
309329
func swiftRunSIGINT(
@@ -404,6 +424,10 @@ struct RunCommandTests {
404424
}
405425

406426
@Test(
427+
.tags(
428+
.Feature.TargetType.Executable,
429+
.Feature.CommandLineArguments.Quiet
430+
),
407431
.issue("https://github.com/swiftlang/swift-package-manager/issues/8844", relationship: .verifies),
408432
.issue("https://github.com/swiftlang/swift-package-manager/issues/8911", relationship: .defect),
409433
.issue("https://github.com/swiftlang/swift-package-manager/issues/8912", relationship: .defect),

0 commit comments

Comments
 (0)