From 0856fdc146bf7cb77fb5d650aa0772cd135e1fe3 Mon Sep 17 00:00:00 2001 From: Stefan Ceriu Date: Mon, 10 Aug 2026 12:26:13 +0300 Subject: [PATCH] Improve integration test diagnostics in an attempt to catch run crashes --- .github/workflows/integration-tests.yml | 4 +++- IntegrationTests/SupportingFiles/IntegrationTests.xctestplan | 1 + Tools/Sources/Commands/CI/IntegrationTests.swift | 4 ++++ 3 files changed, 8 insertions(+), 1 deletion(-) diff --git a/.github/workflows/integration-tests.yml b/.github/workflows/integration-tests.yml index 987256ac8..9c06b1455 100644 --- a/.github/workflows/integration-tests.yml +++ b/.github/workflows/integration-tests.yml @@ -40,7 +40,9 @@ jobs: if: failure() with: name: Results - path: test_output/IntegrationTests.xcresult.zip + path: | + test_output/IntegrationTests.xcresult.zip + test_output/console* retention-days: 7 if-no-files-found: ignore diff --git a/IntegrationTests/SupportingFiles/IntegrationTests.xctestplan b/IntegrationTests/SupportingFiles/IntegrationTests.xctestplan index 8a3dfdefc..cbc3d5b8f 100644 --- a/IntegrationTests/SupportingFiles/IntegrationTests.xctestplan +++ b/IntegrationTests/SupportingFiles/IntegrationTests.xctestplan @@ -18,6 +18,7 @@ } ] }, + "diagnosticCollectionPolicy" : "Always", "environmentVariableEntries" : [ { "key" : "INTEGRATION_TESTS_HOST", diff --git a/Tools/Sources/Commands/CI/IntegrationTests.swift b/Tools/Sources/Commands/CI/IntegrationTests.swift index fbac77dfd..852d0eadc 100644 --- a/Tools/Sources/Commands/CI/IntegrationTests.swift +++ b/Tools/Sources/Commands/CI/IntegrationTests.swift @@ -32,6 +32,10 @@ struct IntegrationTests: AsyncParsableCommand { } catch { testsFailed = true logger.error("\n❌ Integration tests failed.\n") + + // Preserve the app's logs alongside the results so that they can be uploaded as artifacts. + logger.info("🗂️ Collecting log files…") + _ = try? await CI.run(.path("/bin/zsh"), ["-cu", "cp /Users/Shared/console* \(CI.testOutputDirectory)"]) } // Validate logs only when tests passed — log files won't be meaningful otherwise