Skip to content

Commit b6bd50a

Browse files
committed
Re-enable disabled tests
This re-enables a bunch of disabled tests, the hope is that they should now work that we have a newer superior Xcode installed on CI. If that happens to not be the case, we have `SWIFTCI_DISABLE_SDK_DEPENDENT_TESTS` to disable these tests specifically for the macOS CI if needed. This change introduces the variable where expected to be needed, but doesn't set it. rdar://96920453
1 parent 5d7314a commit b6bd50a

File tree

10 files changed

+27
-33
lines changed

10 files changed

+27
-33
lines changed

Examples/package-info/Sources/package-info/example.swift

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,4 @@
1-
#if swift(>=5.7)
2-
@preconcurrency import Basics
3-
#else
41
import Basics
5-
#endif
62
import TSCBasic
73
import Workspace
84

Package.swift

Lines changed: 16 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -688,18 +688,6 @@ package.targets.append(contentsOf: [
688688
]
689689
),
690690

691-
// rdar://101868275 "error: cannot find 'XCTAssertEqual' in scope" can affect almost any functional test, so we flat out disable them all until we know what is going on
692-
/*.testTarget(
693-
name: "FunctionalTests",
694-
dependencies: [
695-
"swift-build",
696-
"swift-package",
697-
"swift-test",
698-
"PackageModel",
699-
"SPMTestSupport"
700-
]
701-
),*/
702-
703691
.testTarget(
704692
name: "FunctionalPerformanceTests",
705693
dependencies: [
@@ -710,6 +698,22 @@ package.targets.append(contentsOf: [
710698
]
711699
),
712700
])
701+
702+
// rdar://101868275 "error: cannot find 'XCTAssertEqual' in scope" can affect almost any functional test, so we flat out disable them all until we know what is going on
703+
if ProcessInfo.processInfo.environment["SWIFTCI_DISABLE_SDK_DEPENDENT_TESTS"] == nil {
704+
package.targets.append(contentsOf: [
705+
.testTarget(
706+
name: "FunctionalTests",
707+
dependencies: [
708+
"swift-build",
709+
"swift-package",
710+
"swift-test",
711+
"PackageModel",
712+
"SPMTestSupport"
713+
]
714+
),
715+
])
716+
}
713717
#endif
714718

715719
// Add package dependency on llbuild when not bootstrapping.

Sources/Build/BuildPlan.swift

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -770,10 +770,6 @@ public class BuildPlan: SPMBuildCore.BuildPlan {
770770
case.unknown:
771771
throw InternalError("unknown binary target '\(target.name)' type")
772772
}
773-
case .macro:
774-
if product.type == .macro {
775-
staticTargets.append(target)
776-
}
777773
case .plugin:
778774
continue
779775
}

Sources/PackageDescription/PackageDescriptionSerialization.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -201,7 +201,7 @@ enum Serialization {
201201

202202
struct Target: Codable {
203203
let name: String
204-
let group: TargetGroup
204+
let group: TargetGroup?
205205
let path: String?
206206
let url: String?
207207
let sources: [String]?

Sources/PackageLoading/ManifestJSONParser.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -337,7 +337,7 @@ enum ManifestJSONParser {
337337

338338
return try TargetDescription(
339339
name: target.name,
340-
group: .init(target.group),
340+
group: target.group.map { .init($0) } ?? .package,
341341
dependencies: dependencies,
342342
path: target.path,
343343
url: target.url,

Tests/FunctionalTests/DependencyResolutionTests.swift

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -78,6 +78,8 @@ class DependencyResolutionTests: XCTestCase {
7878
}
7979

8080
func testMirrors() throws {
81+
try XCTSkipIf(true, "test is broken and needs investigation rdar://107970938")
82+
8183
try fixture(name: "DependencyResolution/External/Mirror") { fixturePath in
8284
let prefix = try resolveSymlinks(fixturePath)
8385
let appPath = prefix.appending("App")

Tests/FunctionalTests/PluginTests.swift

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -463,6 +463,7 @@ class PluginTests: XCTestCase {
463463
accessibleTools: [:],
464464
writableDirectories: [pluginDir.appending("output")],
465465
readOnlyDirectories: [package.path],
466+
allowNetworkConnections: [],
466467
pkgConfigDirectories: [],
467468
fileSystem: localFileSystem,
468469
observabilityScope: observability.topScope,
@@ -729,6 +730,7 @@ class PluginTests: XCTestCase {
729730
accessibleTools: [:],
730731
writableDirectories: [pluginDir.appending("output")],
731732
readOnlyDirectories: [package.path],
733+
allowNetworkConnections: [],
732734
pkgConfigDirectories: [],
733735
fileSystem: localFileSystem,
734736
observabilityScope: observability.topScope,
@@ -1022,7 +1024,7 @@ class PluginTests: XCTestCase {
10221024
let (stdout, _) = try executeSwiftBuild(
10231025
fixturePath.appending(component: "MySourceGenPlugin"),
10241026
configuration: .Debug,
1025-
extraArgs: ["--product", "MyLocalTool", "-Xbuild-tools-swiftc", "-DUSE_CREATING"]
1027+
extraArgs: ["--product", "MyLocalTool", "-Xbuild-tools-swiftc", "-DUSE_CREATE"]
10261028
)
10271029
XCTAssert(stdout.contains("Linking MySourceGenBuildTool"), "stdout:\n\(stdout)")
10281030
XCTAssert(stdout.contains("Creating foo.swift from foo.dat"), "stdout:\n\(stdout)")

Tests/FunctionalTests/ResourcesTests.swift

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,9 @@
1313
import XCTest
1414
import SPMTestSupport
1515

16-
import TSCBasic
16+
import struct TSCBasic.AbsolutePath
17+
import var TSCBasic.localFileSystem
18+
import func TSCBasic.withTemporaryDirectory
1719

1820
class ResourcesTests: XCTestCase {
1921
func testSimpleResources() throws {

Tests/WorkspaceTests/InitTests.swift

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -238,8 +238,6 @@ class InitTests: XCTestCase {
238238
}
239239

240240
func testNonC99NameExecutablePackage() throws {
241-
throw XCTSkip("This test fails to find XCTAssertEqual; rdar://101868275")
242-
243241
try withTemporaryDirectory(removeTreeOnDeinit: true) { tempDirPath in
244242
XCTAssertDirectoryExists(tempDirPath)
245243

@@ -256,11 +254,7 @@ class InitTests: XCTestCase {
256254
)
257255
try initPackage.writePackageStructure()
258256

259-
#if os(macOS)
260-
XCTAssertSwiftTest(packageRoot)
261-
#else
262-
XCTAssertBuilds(packageRoot)
263-
#endif
257+
XCTAssertBuilds(packageRoot)
264258
}
265259
}
266260

Tests/WorkspaceTests/WorkspaceTests.swift

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4948,8 +4948,6 @@ final class WorkspaceTests: XCTestCase {
49484948

49494949
// This verifies that the simplest possible loading APIs are available for package clients.
49504950
func testSimpleAPI() throws {
4951-
throw XCTSkip("This test fails to find XCTAssertEqual; rdar://101868275")
4952-
49534951
try testWithTemporaryDirectory { path in
49544952
// Create a temporary package as a test case.
49554953
let packagePath = path.appending("MyPkg")

0 commit comments

Comments
 (0)