Skip to content

Commit 8be34b4

Browse files
committed
ci: keep windows android emulator alive for tests
1 parent 1aa9c5e commit 8be34b4

2 files changed

Lines changed: 16 additions & 11 deletions

File tree

.github/workflows/ci.yml

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -346,7 +346,7 @@ jobs:
346346
SIMDECK_INTEGRATION_REQUIRE_RUNNING_ANDROID: "1"
347347
SIMDECK_INTEGRATION_VERBOSE: "1"
348348

349-
- name: Create and boot Android emulator (Windows)
349+
- name: Create, boot, and test Android emulator (Windows)
350350
if: runner.os == 'Windows'
351351
shell: pwsh
352352
timeout-minutes: 45
@@ -486,14 +486,14 @@ jobs:
486486
& $adb -s $serial shell settings put global window_animation_scale 0
487487
& $adb -s $serial shell settings put global transition_animation_scale 0
488488
& $adb -s $serial shell settings put global animator_duration_scale 0
489-
490-
- name: Android emulator integration tests (Windows)
491-
if: runner.os == 'Windows'
492-
run: npm run test:integration:android
493-
env:
494-
SIMDECK_INTEGRATION_ANDROID_AVD: SimDeck_Pixel_CI
495-
SIMDECK_INTEGRATION_REQUIRE_RUNNING_ANDROID: "1"
496-
SIMDECK_INTEGRATION_VERBOSE: "1"
489+
$env:SIMDECK_INTEGRATION_ANDROID_AVD = "SimDeck_Pixel_CI"
490+
$env:SIMDECK_INTEGRATION_REQUIRE_RUNNING_ANDROID = "1"
491+
$env:SIMDECK_INTEGRATION_VERBOSE = "1"
492+
npm run test:integration:android
493+
if ($LASTEXITCODE -ne 0) {
494+
Write-EmulatorDiagnostics
495+
throw "Android integration tests failed with exit code $LASTEXITCODE."
496+
}
497497
498498
- name: Stop Android emulator (Windows)
499499
if: always() && runner.os == 'Windows'

scripts/github-actions.test.mjs

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -76,8 +76,8 @@ test("CI runs Android emulator integration on Linux and Windows", () => {
7676
test("Windows Android CI boot path is bounded and diagnostic", () => {
7777
const windowsBootStep = stepSlice(
7878
ciWorkflow,
79-
"Create and boot Android emulator (Windows)",
80-
"Android emulator integration tests (Windows)",
79+
"Create, boot, and test Android emulator (Windows)",
80+
"Stop Android emulator (Windows)",
8181
);
8282

8383
assert.match(windowsBootStep, /\$accelSupported = \$LASTEXITCODE -eq 0/);
@@ -95,6 +95,11 @@ test("Windows Android CI boot path is bounded and diagnostic", () => {
9595
windowsBootStep,
9696
/deviceDeadline = \(Get-Date\)\.AddMinutes\(10\)/,
9797
);
98+
assert.match(
99+
windowsBootStep,
100+
/\$env:SIMDECK_INTEGRATION_REQUIRE_RUNNING_ANDROID = "1"/,
101+
);
102+
assert.match(windowsBootStep, /npm run test:integration:android/);
98103
assert.doesNotMatch(windowsBootStep, /wait-for-device/);
99104
});
100105

0 commit comments

Comments
 (0)