From 87149623cabcdf6667586b61eed94a0d1c965502 Mon Sep 17 00:00:00 2001 From: Kris Cieplak Date: Thu, 30 Oct 2025 11:35:24 -0400 Subject: [PATCH 1/2] Add tags to swift-testing tests that have withKnownIssue calls. * Add tags for tracking to tests that have withKnownIssue invocations, for bucketing and tracking purposes. * Fix spelling mistake for "Component" --- .../SwiftTesting+Tags.swift | 17 +++ .../SwiftTesting+TraitsBug.swift | 2 +- Tests/CommandsTests/APIDiffTests.swift | 25 ++++- Tests/CommandsTests/BuildCommandTests.swift | 4 + Tests/CommandsTests/CoverageTests.swift | 12 ++- Tests/CommandsTests/PackageCommandTests.swift | 48 ++++++++- Tests/CommandsTests/RunCommandTests.swift | 31 ++++++ Tests/CommandsTests/TestCommandTests.swift | 100 ++++++++++++++++++ .../FunctionalTests/CFamilyTargetTests.swift | 8 +- .../PD_6_2_LoadingTests.swift | 6 +- .../PackageBuilderTests.swift | 8 +- 11 files changed, 245 insertions(+), 16 deletions(-) diff --git a/Sources/_InternalTestSupport/SwiftTesting+Tags.swift b/Sources/_InternalTestSupport/SwiftTesting+Tags.swift index 9ad7716164f..edf7d0d9bea 100644 --- a/Sources/_InternalTestSupport/SwiftTesting+Tags.swift +++ b/Sources/_InternalTestSupport/SwiftTesting+Tags.swift @@ -29,6 +29,7 @@ extension Tag.Feature { public enum PackageType {} public enum ProductType {} public enum TargetType {} + public enum Product {} @Tag public static var BuildCache: Tag @Tag public static var CodeCoverage: Tag @@ -38,6 +39,7 @@ extension Tag.Feature { @Tag public static var SpecialCharacters: Tag @Tag public static var Snippets: Tag @Tag public static var Traits: Tag + @Tag public static var TargetSettings: Tag } @@ -77,6 +79,16 @@ extension Tag.Feature.CommandLineArguments { @Tag public static var Xcxx: Tag @Tag public static var SWIFT_ORIGINAL_PATH: Tag @Tag public static var Xswiftc: Tag + @Tag public static var TestParallel: Tag + @Tag public static var TestNoParallel: Tag + @Tag public static var TestOutputXunit: Tag + @Tag public static var TestEnableSwiftTesting: Tag + @Tag public static var TestDisableSwiftTesting: Tag + @Tag public static var TestEnableXCTest: Tag + @Tag public static var TestDisableXCTest: Tag + @Tag public static var TestFilter: Tag + @Tag public static var TestSkip: Tag + @Tag public static var SkipBuild: Tag } extension Tag.Feature.CommandLineArguments.Experimental { @@ -151,3 +163,8 @@ extension Tag.Feature.PackageType { @Tag public static var CommandPlugin: Tag @Tag public static var Macro: Tag } + +extension Tag.Feature.Product { + @Tag public static var Execute: Tag + @Tag public static var Link: Tag +} diff --git a/Sources/_InternalTestSupport/SwiftTesting+TraitsBug.swift b/Sources/_InternalTestSupport/SwiftTesting+TraitsBug.swift index c90b6eab3cc..a08104d793a 100644 --- a/Sources/_InternalTestSupport/SwiftTesting+TraitsBug.swift +++ b/Sources/_InternalTestSupport/SwiftTesting+TraitsBug.swift @@ -38,7 +38,7 @@ extension Trait where Self == Testing.Bug { ) } - public static var IssueWindowsPathLastConponent: Self { + public static var IssueWindowsPathLastComponent: Self { // $0.path.lastComponent in test code returns fullpaths on Windows issue( "https://github.com/swiftlang/swift-package-manager/issues/8554", diff --git a/Tests/CommandsTests/APIDiffTests.swift b/Tests/CommandsTests/APIDiffTests.swift index 27306499256..6b492beceb5 100644 --- a/Tests/CommandsTests/APIDiffTests.swift +++ b/Tests/CommandsTests/APIDiffTests.swift @@ -197,6 +197,9 @@ struct APIDiffTests { } @Test( + .tags( + .Feature.Command.Run + ), .requiresAPIDigester, .issue("https://github.com/swiftlang/swift-package-manager/issues/8926", relationship: .defect), arguments: SupportedBuildSystemOnAllPlatforms, @@ -272,7 +275,13 @@ struct APIDiffTests { } } - @Test(.requiresAPIDigester, arguments: SupportedBuildSystemOnAllPlatforms) + @Test( + .tags( + .Feature.Command.Run + ), + .requiresAPIDigester, + arguments: SupportedBuildSystemOnAllPlatforms + ) func testAPIDiffOfModuleWithCDependency(buildSystem: BuildSystemProvider.Kind) async throws { try await withKnownIssue("https://github.com/swiftlang/swift/issues/82394") { try await fixture(name: "Miscellaneous/APIDiff/") { fixturePath in @@ -303,7 +312,13 @@ struct APIDiffTests { } } - @Test(.requiresAPIDigester, arguments: SupportedBuildSystemOnAllPlatforms) + @Test( + .tags( + .Feature.Command.Run + ), + .requiresAPIDigester, + arguments: SupportedBuildSystemOnAllPlatforms + ) func testAPIDiffOfVendoredCDependency(buildSystem: BuildSystemProvider.Kind) async throws { try await withKnownIssue("https://github.com/swiftlang/swift/issues/82394") { try await fixture(name: "Miscellaneous/APIDiff/") { fixturePath in @@ -318,6 +333,9 @@ struct APIDiffTests { } @Test( + .tags( + .Feature.Command.Run + ), .requiresAPIDigester, .issue("https://github.com/swiftlang/swift-package-manager/issues/8926", relationship: .defect), arguments: SupportedBuildSystemOnAllPlatforms, @@ -341,6 +359,9 @@ struct APIDiffTests { } @Test( + .tags( + .Feature.Command.Run + ), .requiresAPIDigester, .issue("https://github.com/swiftlang/swift-package-manager/issues/8926", relationship: .defect), arguments: SupportedBuildSystemOnAllPlatforms, diff --git a/Tests/CommandsTests/BuildCommandTests.swift b/Tests/CommandsTests/BuildCommandTests.swift index de7e1a84ebd..59cef0466b2 100644 --- a/Tests/CommandsTests/BuildCommandTests.swift +++ b/Tests/CommandsTests/BuildCommandTests.swift @@ -354,6 +354,10 @@ struct BuildCommandTestCases { } @Test( + .tags( + .Feature.Command.Build, + .Feature.TargetType.Executable + ), .IssueWindowsLongPath, buildDataUsingAllBuildSystemWithTags.tags, arguments: buildDataUsingAllBuildSystemWithTags.buildData, diff --git a/Tests/CommandsTests/CoverageTests.swift b/Tests/CommandsTests/CoverageTests.swift index 958bb90ce5b..3af17062fb2 100644 --- a/Tests/CommandsTests/CoverageTests.swift +++ b/Tests/CommandsTests/CoverageTests.swift @@ -30,8 +30,8 @@ struct CoverageTests { @Test( .SWBINTTODO("Test failed because of missing plugin support in the PIF builder. This can be reinvestigated after the support is there."), .tags( - Tag.Feature.CodeCoverage, - Tag.Feature.Command.Test, + .Feature.CodeCoverage, + .Feature.Command.Test, ), arguments: SupportedBuildSystemOnAllPlatforms, ) @@ -69,8 +69,8 @@ struct CoverageTests { .SWBINTTODO("Test failed because of missing plugin support in the PIF builder. This can be reinvestigated after the support is there."), .IssueWindowsCannotSaveAttachment, .tags( - Tag.Feature.CodeCoverage, - Tag.Feature.Command.Test, + .Feature.CodeCoverage, + .Feature.Command.Test, ), arguments: SupportedBuildSystemOnAllPlatforms, ) @@ -129,6 +129,10 @@ struct CoverageTests { } @Test( + .tags( + .Feature.CodeCoverage, + .Feature.Command.Test, + ), arguments: getBuildData(for: SupportedBuildSystemOnAllPlatforms), [ "Coverage/Simple", "Miscellaneous/TestDiscovery/Simple", diff --git a/Tests/CommandsTests/PackageCommandTests.swift b/Tests/CommandsTests/PackageCommandTests.swift index e7b1936c4b5..529426e4398 100644 --- a/Tests/CommandsTests/PackageCommandTests.swift +++ b/Tests/CommandsTests/PackageCommandTests.swift @@ -911,6 +911,9 @@ struct PackageCommandTests { } @Test( + .tags( + .Feature.Command.Package.Describe + ), .IssueWindowsRelativePathAssert, arguments: getBuildData(for: SupportedBuildSystemOnAllPlatforms), ) @@ -4393,6 +4396,10 @@ struct PackageCommandTests { } @Test( + .tags( + .Feature.Command.Build, + .Feature.PackageType.BuildToolPlugin + ), .requiresSwiftConcurrencySupport, arguments: getBuildData(for: SupportedBuildSystemOnAllPlatforms), ) @@ -5131,6 +5138,10 @@ struct PackageCommandTests { // Test reporting of plugin diagnostic messages at different verbosity levels @Test( + .tags( + .Feature.Command.Build, + .Feature.PackageType.CommandPlugin + ), .requiresSwiftConcurrencySupport, .issue( "https://github.com/swiftlang/swift-package-manager/issues/8180", @@ -5322,6 +5333,10 @@ struct PackageCommandTests { // Test target builds requested by a command plugin @Test( + .tags( + .Feature.Command.Run, + .Feature.PackageType.CommandPlugin + ), .IssueWindowsRelativePathAssert, .requiresSwiftConcurrencySupport, arguments: getBuildData(for: SupportedBuildSystemOnAllPlatforms), @@ -5353,6 +5368,10 @@ struct PackageCommandTests { // Test target builds requested by a command plugin @Test( + .tags( + .Feature.Command.Run, + .Feature.PackageType.CommandPlugin + ), .IssueWindowsRelativePathAssert, .requiresSwiftConcurrencySupport, arguments: getBuildData(for: SupportedBuildSystemOnAllPlatforms), @@ -5388,6 +5407,10 @@ struct PackageCommandTests { // Test target builds requested by a command plugin @Test( + .tags( + .Feature.Command.Run, + .Feature.PackageType.CommandPlugin + ), .IssueWindowsRelativePathAssert, .requiresSwiftConcurrencySupport, arguments: getBuildData(for: SupportedBuildSystemOnAllPlatforms), @@ -5422,6 +5445,10 @@ struct PackageCommandTests { // Test target builds requested by a command plugin @Test( + .tags( + .Feature.Command.Run, + .Feature.PackageType.CommandPlugin + ), .IssueWindowsRelativePathAssert, .requiresSwiftConcurrencySupport, arguments: getBuildData(for: SupportedBuildSystemOnAllPlatforms), @@ -5459,6 +5486,10 @@ struct PackageCommandTests { } @Test( + .tags( + .Feature.Command.Run, + .Feature.PackageType.CommandPlugin + ), .IssueWindowsRelativePathAssert, arguments: getBuildData(for: SupportedBuildSystemOnAllPlatforms), ) @@ -5484,6 +5515,10 @@ struct PackageCommandTests { } @Test( + .tags( + .Feature.Command.Run, + .Feature.PackageType.CommandPlugin + ), .IssueWindowsRelativePathAssert, arguments: getBuildData(for: SupportedBuildSystemOnAllPlatforms), ) @@ -5508,6 +5543,10 @@ struct PackageCommandTests { } @Test( + .tags( + .Feature.Command.Run, + .Feature.PackageType.CommandPlugin + ), .IssueWindowsRelativePathAssert, .tags( .Feature.Command.Package.CommandPlugin, @@ -5537,6 +5576,10 @@ struct PackageCommandTests { // Test logging of builds initiated by a command plugin @Test( + .tags( + .Feature.Command.Build, + .Feature.PackageType.CommandPlugin + ), .IssueWindowsRelativePathAssert, .requiresSwiftConcurrencySupport, .tags( @@ -5774,11 +5817,12 @@ struct PackageCommandTests { @Test( .requiresSwiftConcurrencySupport, .tags( + .Feature.Command.Run, .Feature.Command.Package.CommandPlugin, ), .IssueWindowsRelativePathAssert, .IssueWindowsLongPath, - .IssueWindowsPathLastConponent, + .IssueWindowsPathLastComponent, .issue( "https://github.com/swiftlang/swift-package-manager/issues/9083", relationship: .defect, @@ -6747,7 +6791,7 @@ struct PackageCommandTests { } @Test( - .IssueWindowsPathLastConponent, + .IssueWindowsPathLastComponent, // Only run the test if the environment in which we're running actually supports Swift concurrency (which the plugin APIs require). .requiresSwiftConcurrencySupport, .tags( diff --git a/Tests/CommandsTests/RunCommandTests.swift b/Tests/CommandsTests/RunCommandTests.swift index 544e9cd298c..45af73db839 100644 --- a/Tests/CommandsTests/RunCommandTests.swift +++ b/Tests/CommandsTests/RunCommandTests.swift @@ -142,6 +142,10 @@ struct RunCommandTests { } @Test( + .tags( + .Feature.Command.Run, + .Feature.TargetType.Executable, + ), .IssueWindowsPathTestsFailures, .IssueWindowsRelativePathAssert, arguments: SupportedBuildSystemOnPlatform, @@ -207,6 +211,10 @@ struct RunCommandTests { @Test( + .tags( + .Feature.Command.Run, + .Feature.TargetType.Executable, + ), .SWBINTTODO("Swift run using Swift Build does not output executable content to the terminal"), .bug("https://github.com/swiftlang/swift-package-manager/issues/8279"), arguments: SupportedBuildSystemOnPlatform, @@ -244,6 +252,10 @@ struct RunCommandTests { @Test( + .tags( + .Feature.Command.Run, + .Feature.TargetType.Executable, + ), .IssueWindowsPathTestsFailures, .IssueWindowsRelativePathAssert, arguments: SupportedBuildSystemOnPlatform, @@ -263,6 +275,10 @@ struct RunCommandTests { } @Test( + .tags( + .Feature.Command.Run, + .Feature.TargetType.Executable, + ), arguments: SupportedBuildSystemOnPlatform, ) func fileDeprecation( @@ -282,6 +298,12 @@ struct RunCommandTests { } @Test( + .tags( + .Feature.Command.Run, + .Feature.TargetType.Executable, + .Feature.CommandLineArguments.BuildTests, + .Feature.CommandLineArguments.SkipBuild + ), arguments: SupportedBuildSystemOnPlatform, ) func mutualExclusiveFlags( @@ -304,6 +326,10 @@ struct RunCommandTests { } @Test( + .tags( + .Feature.Command.Run, + .Feature.TargetType.Executable, + ), arguments: SupportedBuildSystemOnPlatform, ) func swiftRunSIGINT( @@ -404,6 +430,11 @@ struct RunCommandTests { } @Test( + .tags( + .Feature.Command.Run, + .Feature.TargetType.Executable, + .Feature.CommandLineArguments.Quiet + ), .issue("https://github.com/swiftlang/swift-package-manager/issues/8844", relationship: .verifies), .issue("https://github.com/swiftlang/swift-package-manager/issues/8911", relationship: .defect), .issue("https://github.com/swiftlang/swift-package-manager/issues/8912", relationship: .defect), diff --git a/Tests/CommandsTests/TestCommandTests.swift b/Tests/CommandsTests/TestCommandTests.swift index 9c452d206ae..8977187f6af 100644 --- a/Tests/CommandsTests/TestCommandTests.swift +++ b/Tests/CommandsTests/TestCommandTests.swift @@ -226,6 +226,10 @@ struct TestCommandTests { } @Test( + .tags( + .Feature.Command.Test, + .Feature.TargetType.Executable + ), arguments: SupportedBuildSystemOnAllPlatforms, BuildConfiguration.allCases, ) func enableDisableTestabilityDefaultShouldRunWithTestability( @@ -253,6 +257,10 @@ struct TestCommandTests { } @Test( + .tags( + .Feature.Command.Test, + .Feature.TargetType.Executable, + ), .SWBINTTODO("Test currently fails due to 'error: build failed'"), arguments: SupportedBuildSystemOnAllPlatforms, BuildConfiguration.allCases, ) @@ -287,6 +295,10 @@ struct TestCommandTests { } @Test( + .tags( + .Feature.Command.Test, + .Feature.TargetType.Executable + ), arguments: SupportedBuildSystemOnAllPlatforms, BuildConfiguration.allCases, ) func enableDisableTestabilityEnabled( @@ -309,6 +321,10 @@ struct TestCommandTests { } @Test( + .tags( + .Feature.Command.Test, + .Feature.TargetType.Executable + ), .issue("https://github.com/swiftlang/swift-package-manager/issues/8479", relationship: .defect), .SWBINTTODO("Result XML could not be found. The build fails because of missing test helper generation logic for non-macOS platforms"), arguments: SupportedBuildSystemOnAllPlatforms, BuildConfiguration.allCases, @@ -342,6 +358,11 @@ struct TestCommandTests { } @Test( + .tags( + .Feature.Command.Run, + .Feature.TargetType.Executable, + .Feature.CommandLineArguments.TestNoParallel + ), .issue("https://github.com/swiftlang/swift-package-manager/issues/8479", relationship: .defect), .SWBINTTODO("Result XML could not be found. The build fails because of missing test helper generation logic for non-macOS platforms"), arguments: SupportedBuildSystemOnAllPlatforms, BuildConfiguration.allCases, @@ -374,6 +395,11 @@ struct TestCommandTests { } @Test( + .tags( + .Feature.Command.Test, + .Feature.TargetType.Executable, + .Feature.CommandLineArguments.TestParallel + ), .issue("https://github.com/swiftlang/swift-package-manager/issues/8479", relationship: .defect), .SWBINTTODO("Result XML could not be found. The build fails because of missing test helper generation logic for non-macOS platforms"), arguments: SupportedBuildSystemOnAllPlatforms, BuildConfiguration.allCases, @@ -408,6 +434,12 @@ struct TestCommandTests { } @Test( + .tags( + .Feature.Command.Test, + .Feature.TargetType.Executable, + .Feature.CommandLineArguments.TestParallel, + .Feature.CommandLineArguments.TestOutputXunit + ), .issue("https://github.com/swiftlang/swift-package-manager/issues/8479", relationship: .defect), .SWBINTTODO("Result XML could not be found. The build fails because of missing test helper generation logic for non-macOS platforms"), arguments: SupportedBuildSystemOnAllPlatforms, BuildConfiguration.allCases, @@ -457,6 +489,12 @@ struct TestCommandTests { } @Test( + .tags( + .Feature.Command.Test, + .Feature.TargetType.Executable, + .Feature.CommandLineArguments.TestParallel, + .Feature.CommandLineArguments.TestOutputXunit + ), .issue("https://github.com/swiftlang/swift-package-manager/issues/8479", relationship: .defect), .SWBINTTODO("Result XML could not be found. The build fails because of missing test helper generation logic for non-macOS platforms"), arguments: SupportedBuildSystemOnAllPlatforms, BuildConfiguration.allCases, @@ -508,6 +546,14 @@ struct TestCommandTests { ) @Test( + .tags( + .Feature.Command.Test, + .Feature.TargetType.Executable, + .Feature.CommandLineArguments.TestParallel, + .Feature.CommandLineArguments.TestOutputXunit, + .Feature.CommandLineArguments.TestEnableXCTest, + .Feature.CommandLineArguments.TestEnableSwiftTesting + ), .issue("https://github.com/swiftlang/swift-package-manager/issues/8479", relationship: .defect), .SWBINTTODO("Result XML could not be found. The build fails because of missing test helper generation logic for non-macOS platforms"), arguments: SupportedBuildSystemOnAllPlatforms.filter { $0 != .xcode }, BuildConfiguration.allCases.map { config in @@ -673,6 +719,11 @@ struct TestCommandTests { } @Test( + .tags( + .Feature.Command.Test, + .Feature.TargetType.Executable, + .Feature.CommandLineArguments.TestFilter + ), .issue("https://github.com/swiftlang/swift-package-manager/issues/8479", relationship: .defect), .SWBINTTODO("Result XML could not be found. The build fails because of missing test helper generation logic for non-macOS platforms"), arguments: SupportedBuildSystemOnAllPlatforms, BuildConfiguration.allCases, @@ -715,6 +766,11 @@ struct TestCommandTests { } @Test( + .tags( + .Feature.Command.Test, + .Feature.TargetType.Executable, + .Feature.CommandLineArguments.TestSkip + ), .issue("https://github.com/swiftlang/swift-package-manager/issues/8479", relationship: .defect), .SWBINTTODO("Result XML could not be found. The build fails because of missing test helper generation logic for non-macOS platforms"), arguments: SupportedBuildSystemOnAllPlatforms, BuildConfiguration.allCases, @@ -787,6 +843,10 @@ struct TestCommandTests { } @Test( + .tags( + .Feature.Command.Test, + .Feature.TargetType.Executable, + ), .SWBINTTODO("Fails to find test executable"), .issue("https://github.com/swiftlang/swift-package-manager/pull/8722", relationship: .fixedBy), arguments: SupportedBuildSystemOnAllPlatforms, BuildConfiguration.allCases, @@ -831,6 +891,10 @@ struct TestCommandTests { } @Test( + .tags( + .Feature.Command.Test, + .Feature.TargetType.Executable, + ), .SWBINTTODO("Fails to find test executable"), .issue("https://github.com/swiftlang/swift-package-manager/pull/8722", relationship: .fixedBy), .tags( @@ -864,6 +928,11 @@ struct TestCommandTests { } @Test( + .tags( + .Feature.Command.Test, + .Feature.TargetType.Executable, + .Feature.CommandLineArguments.BuildTests + ), .SWBINTTODO("Fails to find test executable when run in self-hosted pipeline"), .SWBINTTODO("Linux: fails to build with --build-test in Smoke Tests"), .issue("https://github.com/swiftlang/swift-package-manager/pull/8722", relationship: .fixedBy), @@ -916,6 +985,11 @@ struct TestCommandTests { } @Test( + .tags( + .Feature.Command.Test, + .Feature.TargetType.Executable, + .Feature.CommandLineArguments.BuildTests + ), .SWBINTTODO("Fails to find test executable"), .issue("https://github.com/swiftlang/swift-package-manager/pull/8722", relationship: .fixedBy), .tags( @@ -995,6 +1069,11 @@ struct TestCommandTests { } @Test( + .tags( + .Feature.Command.Test, + .Feature.TargetType.Executable, + .Feature.CommandLineArguments.TestEnableSwiftTesting + ), arguments: SupportedBuildSystemOnAllPlatforms, BuildConfiguration.allCases, ) func basicSwiftTestingIntegration( @@ -1020,6 +1099,10 @@ struct TestCommandTests { } @Test( + .tags( + .Feature.Command.Test, + .Feature.TargetType.Executable, + ), .skipHostOS(.macOS), // because this was guarded with `#if !canImport(Darwin)` .SWBINTTODO("This is a PIF builder missing GUID problem. Further investigation is needed."), arguments: SupportedBuildSystemOnAllPlatforms, BuildConfiguration.allCases, @@ -1044,6 +1127,10 @@ struct TestCommandTests { } } @Test( + .tags( + .Feature.Command.Test, + .Feature.TargetType.Executable, + ), .skipHostOS(.macOS), // because this was guarded with `#if !canImport(Darwin)` .SWBINTTODO("This is a PIF builder missing GUID problem. Further investigation is needed."), arguments: SupportedBuildSystemOnAllPlatforms, BuildConfiguration.allCases, @@ -1069,6 +1156,10 @@ struct TestCommandTests { } @Test( + .tags( + .Feature.Command.Test, + .Feature.TargetType.Executable, + ), .IssueWindowsPathTestsFailures, .issue("https://github.com/swiftlang/swift-package-manager/issues/8602", relationship: .defect), arguments: SupportedBuildSystemOnAllPlatforms, BuildConfiguration.allCases, @@ -1098,6 +1189,11 @@ struct TestCommandTests { } @Test( + .tags( + .Feature.Command.Test, + .Feature.TargetType.Executable, + .Feature.CommandLineArguments.TestDisableSwiftTesting + ), .SWBINTTODO("Fails to find test executable"), .issue("https://github.com/swiftlang/swift-package-manager/pull/8722", relationship: .fixedBy), arguments: SupportedBuildSystemOnAllPlatforms, BuildConfiguration.allCases, @@ -1122,6 +1218,10 @@ struct TestCommandTests { } @Test( + .tags( + .Feature.Command.Test, + .Feature.TargetType.Executable, + ), .issue("https://github.com/swiftlang/swift-package-manager/issues/6605", relationship: .verifies), .issue("https://github.com/swiftlang/swift-package-manager/issues/8602", relationship: .defect), arguments: SupportedBuildSystemOnAllPlatforms, BuildConfiguration.allCases, diff --git a/Tests/FunctionalTests/CFamilyTargetTests.swift b/Tests/FunctionalTests/CFamilyTargetTests.swift index ff4d024be97..ef26cd8aaf4 100644 --- a/Tests/FunctionalTests/CFamilyTargetTests.swift +++ b/Tests/FunctionalTests/CFamilyTargetTests.swift @@ -79,7 +79,7 @@ struct CFamilyTargetTestCase { .Feature.Command.Build, ), .IssueWindowsLongPath, - .IssueWindowsPathLastConponent, + .IssueWindowsPathLastComponent, .IssueWindowsRelativePathAssert, .IssueWindowsCannotSaveAttachment, arguments: getBuildData(for: SupportedBuildSystemOnAllPlatforms), @@ -114,7 +114,7 @@ struct CFamilyTargetTestCase { .Feature.Command.Build, ), .IssueWindowsLongPath, - .IssueWindowsPathLastConponent, + .IssueWindowsPathLastComponent, .IssueWindowsRelativePathAssert, .IssueWindowsCannotSaveAttachment, arguments: getBuildData(for: SupportedBuildSystemOnAllPlatforms), @@ -171,7 +171,7 @@ struct CFamilyTargetTestCase { .Feature.Command.Build, ), .IssueWindowsLongPath, - .IssueWindowsPathLastConponent, + .IssueWindowsPathLastComponent, .IssueWindowsRelativePathAssert, .IssueWindowsCannotSaveAttachment, arguments: getBuildData(for: SupportedBuildSystemOnAllPlatforms), @@ -237,7 +237,7 @@ struct CFamilyTargetTestCase { .Feature.Command.Build, ), .IssueWindowsLongPath, - .IssueWindowsPathLastConponent, + .IssueWindowsPathLastComponent, .IssueWindowsRelativePathAssert, .IssueWindowsCannotSaveAttachment, arguments: getBuildData(for: SupportedBuildSystemOnAllPlatforms), diff --git a/Tests/PackageLoadingTests/PD_6_2_LoadingTests.swift b/Tests/PackageLoadingTests/PD_6_2_LoadingTests.swift index 19ddde7e991..cd394f6a5f1 100644 --- a/Tests/PackageLoadingTests/PD_6_2_LoadingTests.swift +++ b/Tests/PackageLoadingTests/PD_6_2_LoadingTests.swift @@ -17,7 +17,11 @@ import _InternalTestSupport import Testing struct PackageDescription6_2LoadingTests { - @Test + @Test( + .tags( + Tag.Feature.TargetSettings + ) + ) func warningControlFlags() async throws { let content = """ import PackageDescription diff --git a/Tests/PackageLoadingTests/PackageBuilderTests.swift b/Tests/PackageLoadingTests/PackageBuilderTests.swift index c7c685ecab9..0dd27697125 100644 --- a/Tests/PackageLoadingTests/PackageBuilderTests.swift +++ b/Tests/PackageLoadingTests/PackageBuilderTests.swift @@ -585,8 +585,12 @@ struct PackageBuilderTests { @Test( .IssueWindowsLongPath, - .IssueWindowsPathLastConponent, - .IssueWindowsRelativePathAssert + .IssueWindowsPathLastComponent, + .IssueWindowsRelativePathAssert, + .tags( + Tag.Feature.PackageType.Executable, + Tag.Feature.PackageType.Library, + ), ) func testTestManifestSearch() throws { try withKnownIssue(isIntermittent: true) { From 7ccfd83b313a880f23e547a240a907664cb6823c Mon Sep 17 00:00:00 2001 From: Kris Cieplak Date: Thu, 30 Oct 2025 13:17:34 -0400 Subject: [PATCH 2/2] Updates from review * Do not duplicate the tags already on the suite. * Add trailing comma on test tags --- .../SwiftTesting+Tags.swift | 1 + Tests/CommandsTests/APIDiffTests.swift | 10 ++-- Tests/CommandsTests/CoverageTests.swift | 7 +-- Tests/CommandsTests/RunCommandTests.swift | 7 --- Tests/CommandsTests/TestCommandTests.swift | 48 ++++++------------- 5 files changed, 24 insertions(+), 49 deletions(-) diff --git a/Sources/_InternalTestSupport/SwiftTesting+Tags.swift b/Sources/_InternalTestSupport/SwiftTesting+Tags.swift index edf7d0d9bea..ccaf4b765a0 100644 --- a/Sources/_InternalTestSupport/SwiftTesting+Tags.swift +++ b/Sources/_InternalTestSupport/SwiftTesting+Tags.swift @@ -89,6 +89,7 @@ extension Tag.Feature.CommandLineArguments { @Tag public static var TestFilter: Tag @Tag public static var TestSkip: Tag @Tag public static var SkipBuild: Tag + @Tag public static var EnableCodeCoverage: Tag } extension Tag.Feature.CommandLineArguments.Experimental { diff --git a/Tests/CommandsTests/APIDiffTests.swift b/Tests/CommandsTests/APIDiffTests.swift index 6b492beceb5..feb94aab38c 100644 --- a/Tests/CommandsTests/APIDiffTests.swift +++ b/Tests/CommandsTests/APIDiffTests.swift @@ -198,7 +198,7 @@ struct APIDiffTests { @Test( .tags( - .Feature.Command.Run + .Feature.Command.Run, ), .requiresAPIDigester, .issue("https://github.com/swiftlang/swift-package-manager/issues/8926", relationship: .defect), @@ -277,7 +277,7 @@ struct APIDiffTests { @Test( .tags( - .Feature.Command.Run + .Feature.Command.Run, ), .requiresAPIDigester, arguments: SupportedBuildSystemOnAllPlatforms @@ -314,7 +314,7 @@ struct APIDiffTests { @Test( .tags( - .Feature.Command.Run + .Feature.Command.Run, ), .requiresAPIDigester, arguments: SupportedBuildSystemOnAllPlatforms @@ -334,7 +334,7 @@ struct APIDiffTests { @Test( .tags( - .Feature.Command.Run + .Feature.Command.Run, ), .requiresAPIDigester, .issue("https://github.com/swiftlang/swift-package-manager/issues/8926", relationship: .defect), @@ -360,7 +360,7 @@ struct APIDiffTests { @Test( .tags( - .Feature.Command.Run + .Feature.Command.Run, ), .requiresAPIDigester, .issue("https://github.com/swiftlang/swift-package-manager/issues/8926", relationship: .defect), diff --git a/Tests/CommandsTests/CoverageTests.swift b/Tests/CommandsTests/CoverageTests.swift index 3af17062fb2..4872691725e 100644 --- a/Tests/CommandsTests/CoverageTests.swift +++ b/Tests/CommandsTests/CoverageTests.swift @@ -24,14 +24,16 @@ import Testing .tags( .TestSize.large, .Feature.CodeCoverage, + .Feature.CommandLineArguments.EnableCodeCoverage ) ) struct CoverageTests { @Test( .SWBINTTODO("Test failed because of missing plugin support in the PIF builder. This can be reinvestigated after the support is there."), .tags( - .Feature.CodeCoverage, + .Feature.Command.Build, .Feature.Command.Test, + .Feature.CommandLineArguments.BuildTests, ), arguments: SupportedBuildSystemOnAllPlatforms, ) @@ -69,8 +71,8 @@ struct CoverageTests { .SWBINTTODO("Test failed because of missing plugin support in the PIF builder. This can be reinvestigated after the support is there."), .IssueWindowsCannotSaveAttachment, .tags( - .Feature.CodeCoverage, .Feature.Command.Test, + .Feature.CommandLineArguments.BuildTests, ), arguments: SupportedBuildSystemOnAllPlatforms, ) @@ -130,7 +132,6 @@ struct CoverageTests { @Test( .tags( - .Feature.CodeCoverage, .Feature.Command.Test, ), arguments: getBuildData(for: SupportedBuildSystemOnAllPlatforms), [ diff --git a/Tests/CommandsTests/RunCommandTests.swift b/Tests/CommandsTests/RunCommandTests.swift index 45af73db839..7da21d8fae7 100644 --- a/Tests/CommandsTests/RunCommandTests.swift +++ b/Tests/CommandsTests/RunCommandTests.swift @@ -143,7 +143,6 @@ struct RunCommandTests { @Test( .tags( - .Feature.Command.Run, .Feature.TargetType.Executable, ), .IssueWindowsPathTestsFailures, @@ -212,7 +211,6 @@ struct RunCommandTests { @Test( .tags( - .Feature.Command.Run, .Feature.TargetType.Executable, ), .SWBINTTODO("Swift run using Swift Build does not output executable content to the terminal"), @@ -253,7 +251,6 @@ struct RunCommandTests { @Test( .tags( - .Feature.Command.Run, .Feature.TargetType.Executable, ), .IssueWindowsPathTestsFailures, @@ -276,7 +273,6 @@ struct RunCommandTests { @Test( .tags( - .Feature.Command.Run, .Feature.TargetType.Executable, ), arguments: SupportedBuildSystemOnPlatform, @@ -299,7 +295,6 @@ struct RunCommandTests { @Test( .tags( - .Feature.Command.Run, .Feature.TargetType.Executable, .Feature.CommandLineArguments.BuildTests, .Feature.CommandLineArguments.SkipBuild @@ -327,7 +322,6 @@ struct RunCommandTests { @Test( .tags( - .Feature.Command.Run, .Feature.TargetType.Executable, ), arguments: SupportedBuildSystemOnPlatform, @@ -431,7 +425,6 @@ struct RunCommandTests { @Test( .tags( - .Feature.Command.Run, .Feature.TargetType.Executable, .Feature.CommandLineArguments.Quiet ), diff --git a/Tests/CommandsTests/TestCommandTests.swift b/Tests/CommandsTests/TestCommandTests.swift index 8977187f6af..38961e48428 100644 --- a/Tests/CommandsTests/TestCommandTests.swift +++ b/Tests/CommandsTests/TestCommandTests.swift @@ -227,8 +227,7 @@ struct TestCommandTests { @Test( .tags( - .Feature.Command.Test, - .Feature.TargetType.Executable + .Feature.TargetType.Executable, ), arguments: SupportedBuildSystemOnAllPlatforms, BuildConfiguration.allCases, ) @@ -258,7 +257,6 @@ struct TestCommandTests { @Test( .tags( - .Feature.Command.Test, .Feature.TargetType.Executable, ), .SWBINTTODO("Test currently fails due to 'error: build failed'"), @@ -296,8 +294,7 @@ struct TestCommandTests { @Test( .tags( - .Feature.Command.Test, - .Feature.TargetType.Executable + .Feature.TargetType.Executable, ), arguments: SupportedBuildSystemOnAllPlatforms, BuildConfiguration.allCases, ) @@ -322,8 +319,7 @@ struct TestCommandTests { @Test( .tags( - .Feature.Command.Test, - .Feature.TargetType.Executable + .Feature.TargetType.Executable, ), .issue("https://github.com/swiftlang/swift-package-manager/issues/8479", relationship: .defect), .SWBINTTODO("Result XML could not be found. The build fails because of missing test helper generation logic for non-macOS platforms"), @@ -361,7 +357,7 @@ struct TestCommandTests { .tags( .Feature.Command.Run, .Feature.TargetType.Executable, - .Feature.CommandLineArguments.TestNoParallel + .Feature.CommandLineArguments.TestNoParallel, ), .issue("https://github.com/swiftlang/swift-package-manager/issues/8479", relationship: .defect), .SWBINTTODO("Result XML could not be found. The build fails because of missing test helper generation logic for non-macOS platforms"), @@ -396,9 +392,8 @@ struct TestCommandTests { @Test( .tags( - .Feature.Command.Test, .Feature.TargetType.Executable, - .Feature.CommandLineArguments.TestParallel + .Feature.CommandLineArguments.TestParallel, ), .issue("https://github.com/swiftlang/swift-package-manager/issues/8479", relationship: .defect), .SWBINTTODO("Result XML could not be found. The build fails because of missing test helper generation logic for non-macOS platforms"), @@ -435,10 +430,9 @@ struct TestCommandTests { @Test( .tags( - .Feature.Command.Test, .Feature.TargetType.Executable, .Feature.CommandLineArguments.TestParallel, - .Feature.CommandLineArguments.TestOutputXunit + .Feature.CommandLineArguments.TestOutputXunit, ), .issue("https://github.com/swiftlang/swift-package-manager/issues/8479", relationship: .defect), .SWBINTTODO("Result XML could not be found. The build fails because of missing test helper generation logic for non-macOS platforms"), @@ -490,10 +484,9 @@ struct TestCommandTests { @Test( .tags( - .Feature.Command.Test, .Feature.TargetType.Executable, .Feature.CommandLineArguments.TestParallel, - .Feature.CommandLineArguments.TestOutputXunit + .Feature.CommandLineArguments.TestOutputXunit, ), .issue("https://github.com/swiftlang/swift-package-manager/issues/8479", relationship: .defect), .SWBINTTODO("Result XML could not be found. The build fails because of missing test helper generation logic for non-macOS platforms"), @@ -547,12 +540,11 @@ struct TestCommandTests { @Test( .tags( - .Feature.Command.Test, .Feature.TargetType.Executable, .Feature.CommandLineArguments.TestParallel, .Feature.CommandLineArguments.TestOutputXunit, .Feature.CommandLineArguments.TestEnableXCTest, - .Feature.CommandLineArguments.TestEnableSwiftTesting + .Feature.CommandLineArguments.TestEnableSwiftTesting, ), .issue("https://github.com/swiftlang/swift-package-manager/issues/8479", relationship: .defect), .SWBINTTODO("Result XML could not be found. The build fails because of missing test helper generation logic for non-macOS platforms"), @@ -720,9 +712,8 @@ struct TestCommandTests { @Test( .tags( - .Feature.Command.Test, .Feature.TargetType.Executable, - .Feature.CommandLineArguments.TestFilter + .Feature.CommandLineArguments.TestFilter, ), .issue("https://github.com/swiftlang/swift-package-manager/issues/8479", relationship: .defect), .SWBINTTODO("Result XML could not be found. The build fails because of missing test helper generation logic for non-macOS platforms"), @@ -767,9 +758,8 @@ struct TestCommandTests { @Test( .tags( - .Feature.Command.Test, .Feature.TargetType.Executable, - .Feature.CommandLineArguments.TestSkip + .Feature.CommandLineArguments.TestSkip, ), .issue("https://github.com/swiftlang/swift-package-manager/issues/8479", relationship: .defect), .SWBINTTODO("Result XML could not be found. The build fails because of missing test helper generation logic for non-macOS platforms"), @@ -844,7 +834,6 @@ struct TestCommandTests { @Test( .tags( - .Feature.Command.Test, .Feature.TargetType.Executable, ), .SWBINTTODO("Fails to find test executable"), @@ -892,7 +881,6 @@ struct TestCommandTests { @Test( .tags( - .Feature.Command.Test, .Feature.TargetType.Executable, ), .SWBINTTODO("Fails to find test executable"), @@ -929,9 +917,8 @@ struct TestCommandTests { @Test( .tags( - .Feature.Command.Test, .Feature.TargetType.Executable, - .Feature.CommandLineArguments.BuildTests + .Feature.CommandLineArguments.BuildTests, ), .SWBINTTODO("Fails to find test executable when run in self-hosted pipeline"), .SWBINTTODO("Linux: fails to build with --build-test in Smoke Tests"), @@ -986,9 +973,8 @@ struct TestCommandTests { @Test( .tags( - .Feature.Command.Test, .Feature.TargetType.Executable, - .Feature.CommandLineArguments.BuildTests + .Feature.CommandLineArguments.BuildTests, ), .SWBINTTODO("Fails to find test executable"), .issue("https://github.com/swiftlang/swift-package-manager/pull/8722", relationship: .fixedBy), @@ -1070,9 +1056,8 @@ struct TestCommandTests { @Test( .tags( - .Feature.Command.Test, .Feature.TargetType.Executable, - .Feature.CommandLineArguments.TestEnableSwiftTesting + .Feature.CommandLineArguments.TestEnableSwiftTesting, ), arguments: SupportedBuildSystemOnAllPlatforms, BuildConfiguration.allCases, ) @@ -1100,7 +1085,6 @@ struct TestCommandTests { @Test( .tags( - .Feature.Command.Test, .Feature.TargetType.Executable, ), .skipHostOS(.macOS), // because this was guarded with `#if !canImport(Darwin)` @@ -1128,7 +1112,6 @@ struct TestCommandTests { } @Test( .tags( - .Feature.Command.Test, .Feature.TargetType.Executable, ), .skipHostOS(.macOS), // because this was guarded with `#if !canImport(Darwin)` @@ -1157,7 +1140,6 @@ struct TestCommandTests { @Test( .tags( - .Feature.Command.Test, .Feature.TargetType.Executable, ), .IssueWindowsPathTestsFailures, @@ -1190,9 +1172,8 @@ struct TestCommandTests { @Test( .tags( - .Feature.Command.Test, .Feature.TargetType.Executable, - .Feature.CommandLineArguments.TestDisableSwiftTesting + .Feature.CommandLineArguments.TestDisableSwiftTesting, ), .SWBINTTODO("Fails to find test executable"), .issue("https://github.com/swiftlang/swift-package-manager/pull/8722", relationship: .fixedBy), @@ -1219,7 +1200,6 @@ struct TestCommandTests { @Test( .tags( - .Feature.Command.Test, .Feature.TargetType.Executable, ), .issue("https://github.com/swiftlang/swift-package-manager/issues/6605", relationship: .verifies),