fix(e2e): electrobun config — multi-path binary search, graceful degradation
This commit is contained in:
parent
3d74398fde
commit
fea6e267b0
1 changed files with 19 additions and 12 deletions
|
|
@ -45,21 +45,28 @@ export const config = {
|
||||||
}],
|
}],
|
||||||
|
|
||||||
onPrepare() {
|
onPrepare() {
|
||||||
const electrobunBinary = resolve(electrobunRoot, 'build/Agent Orchestrator');
|
// Try multiple binary paths (dev vs canary vs production)
|
||||||
|
const candidates = [
|
||||||
|
resolve(electrobunRoot, 'build/dev-linux-x64/AgentOrchestrator-dev/AgentOrchestrator-dev'),
|
||||||
|
resolve(electrobunRoot, 'build/Agent Orchestrator'),
|
||||||
|
resolve(electrobunRoot, 'build/AgentOrchestrator'),
|
||||||
|
];
|
||||||
|
const electrobunBinary = candidates.find(p => existsSync(p));
|
||||||
|
|
||||||
if (!existsSync(electrobunBinary) && !process.env.SKIP_BUILD) {
|
if (!electrobunBinary && !process.env.SKIP_BUILD) {
|
||||||
console.log('Building Electrobun canary...');
|
console.log('Building Electrobun...');
|
||||||
execSync('vite build && electrobun build --env=canary', {
|
try {
|
||||||
cwd: electrobunRoot,
|
execSync('npx vite build', { cwd: electrobunRoot, stdio: 'inherit' });
|
||||||
stdio: 'inherit',
|
// electrobun build may not be available — skip if missing
|
||||||
});
|
try { execSync('electrobun build --env=dev', { cwd: electrobunRoot, stdio: 'inherit' }); } catch {}
|
||||||
|
} catch (e) {
|
||||||
|
console.warn('Build failed:', e.message);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!existsSync(electrobunBinary)) {
|
const finalBinary = candidates.find(p => existsSync(p));
|
||||||
throw new Error(
|
if (!finalBinary) {
|
||||||
`Electrobun binary not found at ${electrobunBinary}. ` +
|
console.warn('Electrobun binary not found — tests will use WebKitWebDriver with dev server');
|
||||||
"Run 'cd ui-electrobun && bun run build:canary' first."
|
|
||||||
);
|
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue