Skip to content

Commit 22761c9

Browse files
committed
ci: Disable GPU for CI ui-tests
1 parent 5527a63 commit 22761c9

File tree

3 files changed

+12
-2
lines changed

3 files changed

+12
-2
lines changed

.agents/codebase-insights.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,3 +38,4 @@
3838
- `!tup_preserve` only mirrors files relative to the directory containing the Tupfile; after moving Tupfiles into `src/build` we copy assets with the new `!cp_preserve` helper so files can originate from the original `src/` tree without confusing tup.
3939
- `!cp_preserve` replaces symlink sources with fresh links pointing at the original target (using `readlink -f`) so mirrored assets stay valid when their relative paths shift.
4040
- `ct_wrapper` resolves `ct_paths.json` by honouring `CODETRACER_CT_PATHS` and otherwise searching upward from both the binary location and the current working directory, so it no longer assumes the wrapper lives at a specific depth in the checkout.
41+
- The posix `wrapElectron` path (used when `CODETRACER_WRAP_ELECTRON=1`) now forwards `CODETRACER_ELECTRON_ARGS`, so CI overrides like `--no-sandbox` reach Electron even when we re-exec the wrapper. The Playwright launcher preserves any existing value and only appends `--no-sandbox` if it is missing, so CI scripts can layer additional flags (e.g. `--disable-gpu`).

ci/test/ui-tests.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ CODETRACER_E2E_CT_PATH="$(pwd)/src/build/bin/ct"
2727
LINKS_PATH_DIR="$(pwd)/src/build"
2828
NIX_CODETRACER_EXE_DIR="$(pwd)/src/build"
2929
CODETRACER_LINKS_PATH="$(pwd)/src/build"
30-
CODETRACER_ELECTRON_ARGS="--no-sandbox"
30+
CODETRACER_ELECTRON_ARGS="--no-sandbox --disable-gpu"
3131

3232
export CODETRACER_E2E_CT_PATH
3333
export LINKS_PATH_DIR

ui-tests/Helpers/PlayrwightLauncher.cs

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
using System;
12
using System.Diagnostics;
23
using Microsoft.Playwright;
34
using UiTests.Helpers;
@@ -55,6 +56,14 @@ public static async Task<IBrowser> LaunchAsync(string programRelativePath)
5556
info.EnvironmentVariables.Add("CODETRACER_TEST", "1");
5657
info.EnvironmentVariables.Add("CODETRACER_WRAP_ELECTRON", "1");
5758
info.EnvironmentVariables.Add("CODETRACER_START_INDEX", "1");
59+
const string electronArgsKey = "CODETRACER_ELECTRON_ARGS";
60+
var existingElectronArgs = info.EnvironmentVariables[electronArgsKey];
61+
var sanitizedElectronArgs = string.IsNullOrWhiteSpace(existingElectronArgs)
62+
? "--no-sandbox"
63+
: existingElectronArgs.Contains("--no-sandbox", StringComparison.Ordinal)
64+
? existingElectronArgs
65+
: $"{existingElectronArgs} --no-sandbox";
66+
info.EnvironmentVariables[electronArgsKey] = sanitizedElectronArgs;
5867
// info.EnvironmentVariables.Add("CODETRACER_DEV_TOOLS", "");
5968

6069
var process = Process.Start(info)!;
@@ -103,4 +112,4 @@ public static async Task<IPage> GetAppPageAsync(IBrowser browser, string? titleC
103112
throw new TimeoutException("Could not find app page (non-DevTools) after connecting playwright.");
104113
}
105114
}
106-
}
115+
}

0 commit comments

Comments
 (0)