From 238be129335c1ef7ace0a0011e50a57a77c81c19 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?David=20R=C3=B6nnqvist?= Date: Wed, 21 Aug 2024 13:10:58 +0200 Subject: [PATCH 1/2] Disable integration tests that fail because of rdar://134406349 --- .../Tests/Utility/XCTestCase+swiftPackage.swift | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/IntegrationTests/Tests/Utility/XCTestCase+swiftPackage.swift b/IntegrationTests/Tests/Utility/XCTestCase+swiftPackage.swift index 65460db..a88cea9 100644 --- a/IntegrationTests/Tests/Utility/XCTestCase+swiftPackage.swift +++ b/IntegrationTests/Tests/Utility/XCTestCase+swiftPackage.swift @@ -96,15 +96,20 @@ extension XCTestCase { } return try processQueue.sync { - let standardOutputString = String(data: standardOutputData, encoding: .utf8) - let standardErrorString = String(data: standardErrorData, encoding: .utf8) + let standardOutputString = String(data: standardOutputData, encoding: .utf8) ?? "" + let standardErrorString = String(data: standardErrorData, encoding: .utf8) ?? "" + + if process.terminationStatus != 0, standardErrorString.contains(":0: error: unknown argument: ") { + throw XCTSkip("Skipping integration tests due to rdar://134406349") + } + return SwiftInvocationResult( workingDirectory: directoryURL, swiftExecutable: try swiftExecutableURL, arguments: arguments.map(\.description), - standardOutput: standardOutputString ?? "", - standardError: standardErrorString ?? "", + standardOutput: standardOutputString , + standardError: standardErrorString, exitStatus: Int(process.terminationStatus) ) } From a76423fd65ac3e97baf95ffefefa112a465f54e9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?David=20R=C3=B6nnqvist?= Date: Wed, 21 Aug 2024 18:46:39 +0200 Subject: [PATCH 2/2] Skip both preview tests on macOS --- .../Tests/SnippetDocumentationGenerationTests.swift | 4 ++++ IntegrationTests/Tests/SwiftDocCPreviewTests.swift | 4 ++++ 2 files changed, 8 insertions(+) diff --git a/IntegrationTests/Tests/SnippetDocumentationGenerationTests.swift b/IntegrationTests/Tests/SnippetDocumentationGenerationTests.swift index d93c1b2..9714a2b 100644 --- a/IntegrationTests/Tests/SnippetDocumentationGenerationTests.swift +++ b/IntegrationTests/Tests/SnippetDocumentationGenerationTests.swift @@ -44,6 +44,9 @@ final class SnippetDocumentationGenerationTests: ConcurrencyRequiringTestCase { } func testPreviewDocumentationWithSnippets() throws { +#if os(macOS) + throw XCTSkip("Skipping integration tests due to rdar://134406349") +#else let outputDirectory = try temporaryDirectory().appendingPathComponent("output") let port = try getAvailablePort() @@ -102,5 +105,6 @@ final class SnippetDocumentationGenerationTests: ConcurrencyRequiringTestCase { // Send an interrupt to the SwiftPM parent process process.interrupt() +#endif } } diff --git a/IntegrationTests/Tests/SwiftDocCPreviewTests.swift b/IntegrationTests/Tests/SwiftDocCPreviewTests.swift index 5611b4d..4141d27 100644 --- a/IntegrationTests/Tests/SwiftDocCPreviewTests.swift +++ b/IntegrationTests/Tests/SwiftDocCPreviewTests.swift @@ -11,6 +11,9 @@ import XCTest final class SwiftDocCPreview: ConcurrencyRequiringTestCase { func testRunPreviewServerOnSamePortRepeatedly() throws { +#if os(macOS) + throw XCTSkip("Skipping integration tests due to rdar://134406349") +#else // Because only a single server can bind to a given port at a time, // this test ensures that the preview server running in the `docc` // process exits when the an interrupt is sent to the `SwiftPM` process. @@ -110,5 +113,6 @@ final class SwiftDocCPreview: ConcurrencyRequiringTestCase { // Send an interrupt to the SwiftPM parent process process.interrupt() } +#endif } }