mirror of
https://github.com/openswarm-ai/openswarm.git
synced 2026-09-12 20:57:42 +02:00
[eric] e2e+ci: addInitScript in launchApp setting __OPENSWARM_E2E__=true before bundle.js parses so the production-build store-on-window gate fires for specs that drive Redux directly, plus chain selftest-pairwise into verify-all and the e2e workflow so the covering-array math is validated on every CI push
This commit is contained in:
@@ -71,6 +71,9 @@ jobs:
|
||||
- name: Preflight race / cache (Layer 4)
|
||||
shell: bash
|
||||
run: node scripts/ci/verify-preflight-race.js
|
||||
- name: Pairwise generator selftest (covering-array math)
|
||||
shell: bash
|
||||
run: node scripts/ci/selftest-pairwise.js
|
||||
|
||||
# Preflight Layer 5: hostile-env scenarios. Each leg asserts the verdict
|
||||
# matches the expected envelope for that scenario; network=blocked
|
||||
|
||||
@@ -79,7 +79,14 @@ export function hasAnyProviderKey(): boolean {
|
||||
|
||||
export async function launchApp(): Promise<ElectronApplication> {
|
||||
seedTestUserIfClean();
|
||||
return electron.launch({ executablePath: packagedAppPath(), args: [] });
|
||||
const app = await electron.launch({ executablePath: packagedAppPath(), args: [] });
|
||||
// The frontend bundle gates `__OPENSWARM_STORE__` exposure on
|
||||
// `__OPENSWARM_E2E__` being truthy at module-load time. Adding an init
|
||||
// script BEFORE the main page navigates guarantees the flag is set before
|
||||
// bundle.js parses, so specs that read the Redux store directly work
|
||||
// against the production build.
|
||||
try { await app.context().addInitScript({ content: '(window).__OPENSWARM_E2E__ = true;' }); } catch { /* best effort */ }
|
||||
return app;
|
||||
}
|
||||
|
||||
// The app opens a splash window first, then the main window that loads the React
|
||||
|
||||
@@ -31,6 +31,7 @@ function main() {
|
||||
['preflight rigs (Layer 3: failure simulators)', 'verify-preflight-rigs.js', []],
|
||||
['preflight race (Layer 4: parallel + cache)', 'verify-preflight-race.js', []],
|
||||
['preflight matrix (Layer 5: hostile-env scenario)', 'verify-preflight.js', []],
|
||||
['pairwise generator selftest (covering array math)', 'selftest-pairwise.js', []],
|
||||
['packaging parity (Win+Mac stage the same dirs)', 'verify-packaging-parity.js', []],
|
||||
['deps fully pinned (reproducible backend builds)', 'verify-deps-pinned.js', []],
|
||||
['no build-host paths leaked into the artifact', 'verify-host-leakage.js', appArg],
|
||||
|
||||
Reference in New Issue
Block a user