426e9eeabd
Voice Workbench / headless workbench (mocked backends) (push) Has been cancelled
Voice Workbench / real acoustic lane (nightly, provisioned only) (push) Has been cancelled
ci / test (push) Has been cancelled
ci / lint-and-format (push) Has been cancelled
ci / build (push) Has been cancelled
ci / dev-startup (push) Has been cancelled
gitleaks / gitleaks (push) Has been cancelled
Markdown Links / Relative Markdown Links (push) Has been cancelled
Quality (Extended) / Homepage Build (PR smoke) (push) Has been cancelled
Quality (Extended) / Comment-only diff guard (push) Has been cancelled
Quality (Extended) / Format + Type Safety Ratchet (push) Has been cancelled
Quality (Extended) / Develop Gate (secret scan + UI determinism) (push) Has been cancelled
Quality (Extended) / Develop Gate (lint) (push) Has been cancelled
Chat shell gestures / Chat shell gesture + parity e2e (push) Has been cancelled
Cloud Gateway Discord / Test (push) Has been cancelled
Benchmark Bridge Tests / benchmark (bunx @biomejs/biome check packages/lifeops-bench/src, benchmark-lint) (push) Has been cancelled
Benchmark Bridge Tests / benchmark (bunx vitest run --config packages/lifeops-bench/vitest.config.ts --root packages/lifeops-bench --passWithNoTests, benchmark-tests) (push) Has been cancelled
Build Agent Image / build-and-push (push) Has been cancelled
Dev Smoke / bun run dev onboarding chat (push) Has been cancelled
Dev Smoke / Vite HMR dependency-level smoke (push) Has been cancelled
Electrobun Submodule Guard / electrobun gitlink is fetchable (push) Has been cancelled
Publish @elizaos/example-code / check_npm (push) Has been cancelled
Publish @elizaos/example-code / publish_npm (push) Has been cancelled
Publish @elizaos/plugin-elizacloud / verify_version (push) Has been cancelled
Publish @elizaos/plugin-elizacloud / publish_npm (push) Has been cancelled
Sandbox Live Smoke / Sandbox live smoke (push) Has been cancelled
Snap Build & Test / Build Snap (amd64) (push) Has been cancelled
Snap Build & Test / Build Snap (arm64) (push) Has been cancelled
Test Packaging / elizaos CLI global-install smoke (node + bun) (push) Has been cancelled
Cloud Gateway Webhook / Test (push) Has been cancelled
Cloud Tests / lint-and-types (push) Has been cancelled
Cloud Tests / unit-tests (push) Has been cancelled
Cloud Tests / integration-tests (push) Has been cancelled
Cloud Tests / e2e-tests (push) Has been cancelled
CodeQL Advanced / Analyze (javascript-typescript) (push) Has been cancelled
Deploy Apps Worker (Product 2) / Determine environment (push) Has been cancelled
Deploy Apps Worker (Product 2) / Deploy apps worker to apps-control host (${{ needs.determine-env.outputs.environment }}) (push) Has been cancelled
Deploy Eliza Provisioning Worker / Determine environment (push) Has been cancelled
Deploy Eliza Provisioning Worker / Deploy worker to Hetzner host (${{ needs.determine-env.outputs.environment }} @ ${{ needs.determine-env.outputs.deployment_sha }}) (push) Has been cancelled
Dev Smoke / Classify changed paths (push) Has been cancelled
supply-chain / sbom (push) Has been cancelled
supply-chain / vulnerability-scan (push) Has been cancelled
Build, Push & Deploy to Phala Cloud / build-and-push (push) Has been cancelled
Test Packaging / Validate Packaging Configs (push) Has been cancelled
Test Packaging / Build & Test PyPI Package (push) Has been cancelled
Test Packaging / PyPI on Python ${{ matrix.python }} (push) Has been cancelled
Test Packaging / Pack & Test JS Tarballs (push) Has been cancelled
UI Fixture E2E / ui-fixture-e2e (push) Has been cancelled
UI Fixture E2E / fixture-e2e (push) Has been cancelled
UI Story Gate / story-gate (push) Has been cancelled
vault-ci / test (macos-latest) (push) Has been cancelled
vault-ci / test (ubuntu-latest) (push) Has been cancelled
vault-ci / test (windows-latest) (push) Has been cancelled
vault-ci / app-core wiring tests (push) Has been cancelled
verify-patches / verify patches/CHECKSUMS.sha256 (push) Has been cancelled
Voice Benchmark Smoke / voice-emotion fixture smoke (push) Has been cancelled
Voice Benchmark Smoke / voiceagentbench fixture smoke (push) Has been cancelled
Voice Benchmark Smoke / voicebench-quality unit smoke (push) Has been cancelled
Voice Benchmark Smoke / voicebench TypeScript unit (no audio) (push) Has been cancelled
Voice Benchmark Smoke / voice bench smoke summary (push) Has been cancelled
Windows CI / windows ([bun run --cwd packages/app-core test bun run --cwd packages/elizaos test bun run --cwd packages/cloud/shared test], app-and-cli) (push) Has been cancelled
Windows CI / windows ([bun run --cwd packages/scenario-runner test bun run --cwd packages/vault test bun run --cwd packages/security test bun run --cwd plugins/plugin-coding-tools test], framework-packages) (push) Has been cancelled
Windows CI / windows ([bun run --cwd plugins/plugin-elizacloud test bun run --cwd plugins/plugin-discord test bun run --cwd plugins/plugin-anthropic test bun run --cwd plugins/plugin-openai test bun run --cwd plugins/plugin-app-control test bun run --cwd plugins/pl… (push) Has been cancelled
Windows CI / windows ([node packages/scripts/run-turbo.mjs run build --filter=@elizaos/core --filter=@elizaos/shared --filter=@elizaos/agent --concurrency=4 node packages/scripts/run-bash-linux-only.mjs scripts/verify-riscv64-buildpaths.sh node packages/scripts/run… (push) Has been cancelled
Windows CI / windows ([node packages/scripts/run-turbo.mjs run typecheck --filter=@elizaos/core --filter=@elizaos/shared --filter=@elizaos/cloud-shared --concurrency=4 bun run --cwd packages/core test bun run --cwd packages/shared test], core-runtime, 75) (push) Has been cancelled
433 lines
12 KiB
JavaScript
433 lines
12 KiB
JavaScript
#!/usr/bin/env node
|
|
// Runs launch QA launch qa run automation for release-readiness checks.
|
|
import { spawn } from "node:child_process";
|
|
import fs from "node:fs";
|
|
import os from "node:os";
|
|
import path from "node:path";
|
|
import { fileURLToPath } from "node:url";
|
|
|
|
const scriptDir = path.dirname(fileURLToPath(import.meta.url));
|
|
const repoRoot = path.resolve(scriptDir, "..", "..", "..");
|
|
|
|
const QUICK_TASK_IDS = new Set([
|
|
"mobile-artifacts",
|
|
"app-core-focused",
|
|
"agent-focused",
|
|
"lifeops-focused",
|
|
"training-focused",
|
|
"cloud-api-key-client",
|
|
"model-data",
|
|
]);
|
|
|
|
const TASKS = [
|
|
{
|
|
id: "docs",
|
|
tier: 2,
|
|
optionalScript: "packages/scripts/launch-qa/check-docs.mjs",
|
|
command: "node",
|
|
args: [
|
|
"packages/scripts/launch-qa/check-docs.mjs",
|
|
"--scope=launchdocs",
|
|
"--json",
|
|
],
|
|
description: "Launchdocs links and documented command references",
|
|
},
|
|
{
|
|
id: "mobile-artifacts",
|
|
tier: 1,
|
|
optionalScript: "packages/scripts/launch-qa/check-mobile-artifacts.mjs",
|
|
command: "node",
|
|
args: ["packages/scripts/launch-qa/check-mobile-artifacts.mjs", "--json"],
|
|
description: "Static iOS/Android artifact and script validation",
|
|
},
|
|
{
|
|
id: "model-data",
|
|
tier: 0,
|
|
optionalScript: "packages/scripts/launch-qa/check-model-data.mjs",
|
|
command: "node",
|
|
args: ["packages/scripts/launch-qa/check-model-data.mjs", "--json"],
|
|
description:
|
|
"Offline model dataset schema, redaction, and budget validation",
|
|
},
|
|
{
|
|
id: "app-core-focused",
|
|
tier: 0,
|
|
command: "bunx",
|
|
args: [
|
|
"vitest",
|
|
"run",
|
|
"--config",
|
|
"packages/app-core/vitest.config.ts",
|
|
"packages/app-core/scripts/startup-integration-script-drift.test.ts",
|
|
],
|
|
requiredFiles: [
|
|
"packages/app-core/scripts/startup-integration-script-drift.test.ts",
|
|
],
|
|
description: "Focused app-core startup script drift tests",
|
|
},
|
|
{
|
|
id: "agent-focused",
|
|
tier: 0,
|
|
command: "bunx",
|
|
args: [
|
|
"vitest",
|
|
"run",
|
|
"--config",
|
|
"packages/agent/vitest.config.ts",
|
|
"packages/agent/test/runtime/operations/vault-integration.test.ts",
|
|
],
|
|
requiredFiles: [
|
|
"packages/agent/test/runtime/operations/vault-integration.test.ts",
|
|
],
|
|
description: "Focused agent vault runtime tests",
|
|
},
|
|
{
|
|
id: "lifeops-focused",
|
|
tier: 0,
|
|
command: "bunx",
|
|
args: [
|
|
"vitest",
|
|
"run",
|
|
"--config",
|
|
"plugins/plugin-personal-assistant/vitest.config.ts",
|
|
"plugins/plugin-personal-assistant/src/website-blocker/chat-integration/__tests__/actions.test.ts",
|
|
"plugins/plugin-personal-assistant/src/website-blocker/chat-integration/__tests__/block-rule-service.test.ts",
|
|
],
|
|
requiredFiles: [
|
|
"plugins/plugin-personal-assistant/src/website-blocker/chat-integration/__tests__/actions.test.ts",
|
|
"plugins/plugin-personal-assistant/src/website-blocker/chat-integration/__tests__/block-rule-service.test.ts",
|
|
],
|
|
description: "Focused LifeOps website blocker chat-integration tests",
|
|
},
|
|
{
|
|
id: "training-focused",
|
|
tier: 0,
|
|
command: "bun",
|
|
args: ["run", "--cwd", "plugins/plugin-training", "test"],
|
|
description: "App-training dataset, privacy, optimizer, and trigger tests",
|
|
},
|
|
{
|
|
id: "app-typecheck",
|
|
tier: 1,
|
|
command: "bun",
|
|
args: ["run", "--cwd", "packages/app", "typecheck"],
|
|
description: "Host app typecheck",
|
|
},
|
|
{
|
|
id: "app-core-typecheck",
|
|
tier: 1,
|
|
command: "bun",
|
|
args: ["run", "--cwd", "packages/app-core", "typecheck"],
|
|
description: "App-core typecheck",
|
|
},
|
|
{
|
|
id: "agent-typecheck",
|
|
tier: 1,
|
|
command: "bun",
|
|
args: ["run", "--cwd", "packages/agent", "typecheck"],
|
|
description: "Agent package typecheck",
|
|
},
|
|
{
|
|
id: "cloud-typecheck",
|
|
tier: 1,
|
|
command: "bun",
|
|
args: ["run", "typecheck:cloud"],
|
|
description: "Cloud package split typecheck",
|
|
},
|
|
{
|
|
id: "ui-smoke",
|
|
tier: 2,
|
|
command: "node",
|
|
args: ["packages/scripts/launch-qa/run-ui-smoke-offline.mjs"],
|
|
description: "Deterministic offline Playwright UI smoke suite",
|
|
},
|
|
{
|
|
id: "cloud-api-key-redaction",
|
|
tier: 1,
|
|
command: "bun",
|
|
args: [
|
|
"test",
|
|
"--preload",
|
|
"packages/cloud/api/test/e2e/preload.ts",
|
|
"packages/cloud/api/test/e2e/agent-token-flow.test.ts",
|
|
"--timeout",
|
|
"120000",
|
|
],
|
|
description: "Cloud API-key create/list redaction e2e",
|
|
},
|
|
{
|
|
id: "cloud-api-key-client",
|
|
tier: 0,
|
|
command: "bun",
|
|
args: ["test", "packages/cloud/shared/src/lib/client/api-keys.test.ts"],
|
|
env: {
|
|
SKIP_DB_DEPENDENT: "1",
|
|
SKIP_SERVER_CHECK: "true",
|
|
},
|
|
description: "Cloud API-key client helper redaction contract",
|
|
},
|
|
];
|
|
|
|
function parseArgs(argv) {
|
|
const args = {
|
|
suite: "quick",
|
|
only: null,
|
|
skip: new Set(),
|
|
dryRun: false,
|
|
json: false,
|
|
list: false,
|
|
/** Set via `--artifacts-dir`; default is allocated under os.tmpdir() when running (never under launchdocs/). */
|
|
artifactsDir: undefined,
|
|
continueOnFailure: false,
|
|
};
|
|
|
|
for (let i = 0; i < argv.length; i += 1) {
|
|
const arg = argv[i];
|
|
if (arg === "--suite") {
|
|
args.suite = argv[++i] ?? "";
|
|
} else if (arg.startsWith("--suite=")) {
|
|
args.suite = arg.slice("--suite=".length);
|
|
} else if (arg === "--only") {
|
|
args.only = new Set((argv[++i] ?? "").split(",").filter(Boolean));
|
|
} else if (arg.startsWith("--only=")) {
|
|
args.only = new Set(
|
|
arg.slice("--only=".length).split(",").filter(Boolean),
|
|
);
|
|
} else if (arg === "--skip") {
|
|
for (const id of (argv[++i] ?? "").split(",")) {
|
|
if (id) args.skip.add(id);
|
|
}
|
|
} else if (arg.startsWith("--skip=")) {
|
|
for (const id of arg.slice("--skip=".length).split(",")) {
|
|
if (id) args.skip.add(id);
|
|
}
|
|
} else if (arg === "--artifacts-dir") {
|
|
args.artifactsDir = path.resolve(argv[++i] ?? "");
|
|
} else if (arg.startsWith("--artifacts-dir=")) {
|
|
args.artifactsDir = path.resolve(arg.slice("--artifacts-dir=".length));
|
|
} else if (arg === "--dry-run") {
|
|
args.dryRun = true;
|
|
} else if (arg === "--json") {
|
|
args.json = true;
|
|
} else if (arg === "--list") {
|
|
args.list = true;
|
|
} else if (arg === "--continue-on-failure") {
|
|
args.continueOnFailure = true;
|
|
} else if (arg === "-h" || arg === "--help") {
|
|
args.help = true;
|
|
} else {
|
|
throw new Error(`Unknown argument: ${arg}`);
|
|
}
|
|
}
|
|
if (!["quick", "release", "nightly", "all"].includes(args.suite)) {
|
|
throw new Error(
|
|
`Unknown suite "${args.suite}". Use quick, release, nightly, or all.`,
|
|
);
|
|
}
|
|
return args;
|
|
}
|
|
|
|
function taskExists(task) {
|
|
return (
|
|
(!task.optionalScript ||
|
|
fs.existsSync(path.join(repoRoot, task.optionalScript))) &&
|
|
(!task.requiredFiles ||
|
|
task.requiredFiles.every((file) =>
|
|
fs.existsSync(path.join(repoRoot, task.cwd ?? "", file)),
|
|
))
|
|
);
|
|
}
|
|
|
|
function tasksForSuite(suite) {
|
|
if (suite === "quick") {
|
|
return TASKS.filter((task) => QUICK_TASK_IDS.has(task.id));
|
|
}
|
|
if (suite === "release") {
|
|
return TASKS.filter((task) => task.tier <= 1);
|
|
}
|
|
if (suite === "nightly" || suite === "all") {
|
|
return [...TASKS];
|
|
}
|
|
return [];
|
|
}
|
|
|
|
export function selectTasks(options) {
|
|
let selected = tasksForSuite(options.suite);
|
|
if (options.only) {
|
|
selected = TASKS.filter((task) => options.only.has(task.id));
|
|
}
|
|
return selected.filter((task) => !options.skip.has(task.id));
|
|
}
|
|
|
|
function usage() {
|
|
return `Usage: node packages/scripts/launch-qa/run.mjs [--suite quick|release|nightly|all] [--only a,b] [--skip a,b] [--artifacts-dir <path>] [--dry-run] [--json] [--list] [--continue-on-failure]
|
|
|
|
Logs and summary.json are written under a fresh directory in ${os.tmpdir()} unless --artifacts-dir is set.
|
|
|
|
Suites:
|
|
quick Fast launch gates intended for local iteration.
|
|
release Quick gates plus typechecks and cloud API redaction.
|
|
nightly Release gates plus browser/cloud smoke where configured.
|
|
all Alias for nightly.
|
|
`;
|
|
}
|
|
|
|
async function runTask(task, options) {
|
|
if (!taskExists(task)) {
|
|
return {
|
|
id: task.id,
|
|
status: "skipped",
|
|
reason: `optional script missing: ${task.optionalScript}`,
|
|
};
|
|
}
|
|
|
|
if (options.dryRun) {
|
|
return {
|
|
id: task.id,
|
|
status: "dry-run",
|
|
command: [task.command, ...task.args].join(" "),
|
|
cwd: task.cwd ?? ".",
|
|
};
|
|
}
|
|
|
|
fs.mkdirSync(options.artifactsDir, { recursive: true });
|
|
const logPath = path.join(options.artifactsDir, `${task.id}.log`);
|
|
const startedAt = Date.now();
|
|
|
|
return await new Promise((resolve) => {
|
|
const child = spawn(task.command, task.args, {
|
|
cwd: task.cwd ? path.join(repoRoot, task.cwd) : repoRoot,
|
|
env: { ...process.env, ...(task.env ?? {}) },
|
|
shell: process.platform === "win32",
|
|
});
|
|
const chunks = [];
|
|
const record = (chunk) => {
|
|
chunks.push(Buffer.from(chunk));
|
|
process.stdout.write(chunk);
|
|
};
|
|
const recordErr = (chunk) => {
|
|
chunks.push(Buffer.from(chunk));
|
|
process.stderr.write(chunk);
|
|
};
|
|
child.stdout.on("data", record);
|
|
child.stderr.on("data", recordErr);
|
|
child.on("error", (error) => {
|
|
const output = Buffer.concat(chunks).toString("utf8");
|
|
fs.writeFileSync(
|
|
logPath,
|
|
`${output}\n[launch-qa] ${error.stack ?? error.message}\n`,
|
|
);
|
|
resolve({
|
|
id: task.id,
|
|
status: "failed",
|
|
exitCode: null,
|
|
durationMs: Date.now() - startedAt,
|
|
logPath,
|
|
error: error.message,
|
|
});
|
|
});
|
|
child.on("exit", (code, signal) => {
|
|
const output = Buffer.concat(chunks).toString("utf8");
|
|
fs.writeFileSync(logPath, output);
|
|
resolve({
|
|
id: task.id,
|
|
status: code === 0 ? "passed" : "failed",
|
|
exitCode: code,
|
|
signal,
|
|
durationMs: Date.now() - startedAt,
|
|
logPath,
|
|
});
|
|
});
|
|
});
|
|
}
|
|
|
|
export async function runLaunchQa(argv = process.argv.slice(2)) {
|
|
const options = parseArgs(argv);
|
|
if (options.help) {
|
|
console.log(usage());
|
|
return { ok: true, results: [] };
|
|
}
|
|
|
|
const tasks = selectTasks(options);
|
|
if (options.list || options.dryRun) {
|
|
const listed = tasks.map((task) => ({
|
|
id: task.id,
|
|
tier: task.tier,
|
|
description: task.description,
|
|
command: [task.command, ...task.args].join(" "),
|
|
cwd: task.cwd ?? ".",
|
|
available: taskExists(task),
|
|
}));
|
|
if (options.json) {
|
|
console.log(JSON.stringify({ tasks: listed }, null, 2));
|
|
} else {
|
|
for (const task of listed) {
|
|
const availability = task.available ? "" : " (missing optional script)";
|
|
console.log(
|
|
`${task.id.padEnd(26)} tier=${task.tier} ${task.command}${availability}`,
|
|
);
|
|
}
|
|
}
|
|
return { ok: true, tasks: listed, results: [] };
|
|
}
|
|
|
|
const artifactsDir =
|
|
options.artifactsDir ??
|
|
fs.mkdtempSync(path.join(os.tmpdir(), "launch-qa-"));
|
|
const runOptions = { ...options, artifactsDir };
|
|
|
|
const results = [];
|
|
for (const task of tasks) {
|
|
console.log(`\n[launch-qa] ${task.id}: ${task.description}`);
|
|
const result = await runTask(task, runOptions);
|
|
results.push(result);
|
|
if (result.status === "failed" && !runOptions.continueOnFailure) {
|
|
break;
|
|
}
|
|
}
|
|
|
|
const summary = {
|
|
ok: results.every(
|
|
(result) => result.status === "passed" || result.status === "skipped",
|
|
),
|
|
suite: runOptions.suite,
|
|
artifactsDir: runOptions.artifactsDir,
|
|
results,
|
|
};
|
|
fs.mkdirSync(runOptions.artifactsDir, { recursive: true });
|
|
fs.writeFileSync(
|
|
path.join(runOptions.artifactsDir, "summary.json"),
|
|
JSON.stringify(summary, null, 2),
|
|
);
|
|
if (runOptions.json) {
|
|
console.log(JSON.stringify(summary, null, 2));
|
|
} else {
|
|
const passed = results.filter(
|
|
(result) => result.status === "passed",
|
|
).length;
|
|
const skipped = results.filter(
|
|
(result) => result.status === "skipped",
|
|
).length;
|
|
const failed = results.filter(
|
|
(result) => result.status === "failed",
|
|
).length;
|
|
console.log(
|
|
`\n[launch-qa] passed=${passed} skipped=${skipped} failed=${failed}`,
|
|
);
|
|
console.log(`[launch-qa] artifacts: ${runOptions.artifactsDir}`);
|
|
}
|
|
return summary;
|
|
}
|
|
|
|
if (import.meta.url === `file://${process.argv[1]}`) {
|
|
try {
|
|
const summary = await runLaunchQa();
|
|
process.exit(summary.ok ? 0 : 1);
|
|
} catch (error) {
|
|
console.error(
|
|
`[launch-qa] ${error instanceof Error ? error.message : String(error)}`,
|
|
);
|
|
process.exit(1);
|
|
}
|
|
}
|