mirror of
https://github.com/stablyai/orca.git
synced 2026-09-22 00:02:31 +00:00
test(perf): reveal visibility control only on isolated CI display
This commit is contained in:
@@ -102,9 +102,9 @@ jobs:
|
||||
mkdir -p "$RUNNER_TEMP/perf-evidence"
|
||||
for mode in hidden visible; do
|
||||
export ORCA_PERF_DIAGNOSTIC_RENDERER=swiftshader
|
||||
export ORCA_E2E_FORCE_HEADFUL=0
|
||||
export ORCA_PERF_DIAGNOSTIC_XVFB_VISIBLE=0
|
||||
if [ "$mode" = visible ]; then
|
||||
export ORCA_E2E_FORCE_HEADFUL=1
|
||||
export ORCA_PERF_DIAGNOSTIC_XVFB_VISIBLE=1
|
||||
fi
|
||||
export ORCA_PERF_DIAGNOSTIC_DIR="$RUNNER_TEMP/perf-evidence/mode-$mode"
|
||||
mkdir -p "$ORCA_PERF_DIAGNOSTIC_DIR"
|
||||
|
||||
@@ -11,6 +11,17 @@ export function configureTerminalPerfDiagnostics(): void {
|
||||
}
|
||||
const visibility = await orcaPage.evaluate(() => document.visibilityState)
|
||||
const unthrottle = process.env.ORCA_PERF_DIAGNOSTIC_UNTHROTTLE === '1'
|
||||
const visibleOnXvfb = process.env.ORCA_PERF_DIAGNOSTIC_XVFB_VISIBLE === '1'
|
||||
if (visibleOnXvfb) {
|
||||
if (process.platform !== 'linux' || !process.env.GITHUB_ACTIONS || !process.env.DISPLAY) {
|
||||
throw new Error('Visible diagnostic requires an isolated GitHub Actions Xvfb display')
|
||||
}
|
||||
await electronApp.evaluate(({ BrowserWindow }) => {
|
||||
for (const window of BrowserWindow.getAllWindows()) {
|
||||
window.showInactive()
|
||||
}
|
||||
})
|
||||
}
|
||||
const windows = await electronApp.evaluate(({ BrowserWindow }, unthrottle) => {
|
||||
return BrowserWindow.getAllWindows().map((window) => {
|
||||
if (unthrottle) {
|
||||
|
||||
Reference in New Issue
Block a user