mirror of
https://github.com/openclaw/openclaw.git
synced 2026-05-06 21:30:44 +00:00
refactor: simplify parallels smoke helpers
This commit is contained in:
18
scripts/e2e/parallels/lane-runner.ts
Normal file
18
scripts/e2e/parallels/lane-runner.ts
Normal file
@@ -0,0 +1,18 @@
|
||||
import { warn } from "./host-command.ts";
|
||||
|
||||
export type SmokeLane = "fresh" | "upgrade";
|
||||
export type SmokeLaneStatus = "pass" | "fail";
|
||||
|
||||
export async function runSmokeLane(
|
||||
name: SmokeLane,
|
||||
fn: () => Promise<void>,
|
||||
setStatus: (name: SmokeLane, status: SmokeLaneStatus) => void,
|
||||
): Promise<void> {
|
||||
try {
|
||||
await fn();
|
||||
setStatus(name, "pass");
|
||||
} catch (error) {
|
||||
setStatus(name, "fail");
|
||||
warn(`${name} lane failed: ${error instanceof Error ? error.message : String(error)}`);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user