Skip to content

Commit e3c27e3

Browse files
committed
Use console launch mode for iOS CI tests
1 parent c4ce983 commit e3c27e3

File tree

2 files changed

+10
-4
lines changed

2 files changed

+10
-4
lines changed

.github/workflows/ci.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,4 +48,5 @@ jobs:
4848
env:
4949
IOS_BUILD_TIMEOUT_MS: "600000"
5050
IOS_TEST_INACTIVITY_TIMEOUT_MS: "180000"
51+
IOS_TEST_LOG_STREAM: "0"
5152
run: npm run test:ios

scripts/run-tests-ios.js

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
// - IOS_LOG_JUNIT=0 disables streaming TKUnit/JUnit lines to console.
1818
// - IOS_TESTS filters test modules (comma-separated substrings passed to app as -tests).
1919
// - IOS_TEST_INACTIVITY_TIMEOUT_MS overrides max no-log interval (default: 2 minutes).
20-
// - IOS_TEST_LOG_STREAM=0 disables parallel simulator log stream (enabled by default).
20+
// - IOS_TEST_LOG_STREAM=1 enables parallel simulator log stream (disabled by default).
2121
// - IOS_SIM_LOG_LOOKBACK sets log-show window used for post-failure diagnostics (default: 45s).
2222

2323
const fs = require("fs");
@@ -95,7 +95,7 @@ const testTimeoutMs = Number(process.env.IOS_TEST_TIMEOUT_MS || 2 * 60 * 1000);
9595
const inactivityTimeoutMs = Number(process.env.IOS_TEST_INACTIVITY_TIMEOUT_MS || 2 * 60 * 1000);
9696
const emitJunitLogs = process.env.IOS_LOG_JUNIT !== "0";
9797
const requestedTests = (process.env.IOS_TESTS || "").trim();
98-
const enableLiveLogStream = process.env.IOS_TEST_LOG_STREAM !== "0";
98+
const enableLiveLogStream = process.env.IOS_TEST_LOG_STREAM === "1";
9999
const simulatorLogLookback = process.env.IOS_SIM_LOG_LOOKBACK || "45s";
100100
const consoleLogMarker = "CONSOLE LOG:";
101101

@@ -803,7 +803,7 @@ function waitForLaunchProcessClose(launchProcess, timeoutMs) {
803803
});
804804
}
805805

806-
async function waitForCompletedJunitOrLaunchExit(udid, launchProcess, timeoutMs, state) {
806+
async function waitForCompletedJunitOrLaunchExit(udid, launchProcess, timeoutMs, state, launchRepresentsAppLifetime) {
807807
let launchResult = null;
808808
launchProcess.on("close", (code, signal) => {
809809
launchResult = { code: code ?? 0, signal: signal || null };
@@ -823,6 +823,10 @@ async function waitForCompletedJunitOrLaunchExit(udid, launchProcess, timeoutMs,
823823
return { junitResult, launchResult, timedOut: false };
824824
}
825825

826+
if (launchRepresentsAppLifetime && launchResult) {
827+
return { junitResult: null, launchResult, timedOut: false };
828+
}
829+
826830
if (Date.now() - state.lastActivityAt >= inactivityTimeoutMs) {
827831
return { junitResult: null, launchResult, timedOut: true, inactive: true };
828832
}
@@ -1023,7 +1027,8 @@ async function main() {
10231027
udid,
10241028
launchProcess,
10251029
testTimeoutMs,
1026-
launchState
1030+
launchState,
1031+
!enableLiveLogStream
10271032
);
10281033
if (junitResult) {
10291034
fs.writeFileSync(junitOutPath, junitResult.xml);

0 commit comments

Comments
 (0)