chore: add daemon package-lock, gitignore test-results
This commit is contained in:
parent
3383334821
commit
84324f9ae3
3 changed files with 5480 additions and 67 deletions
1
.gitignore
vendored
1
.gitignore
vendored
|
|
@ -42,3 +42,4 @@ projects/
|
||||||
.local/
|
.local/
|
||||||
debug/
|
debug/
|
||||||
*.tar.gz
|
*.tar.gz
|
||||||
|
tests/test-results/
|
||||||
|
|
|
||||||
|
|
@ -3,62 +3,23 @@
|
||||||
// and query the test daemon programmatically.
|
// and query the test daemon programmatically.
|
||||||
|
|
||||||
import { createInterface } from 'node:readline';
|
import { createInterface } from 'node:readline';
|
||||||
import type { Dashboard, TestEntry } from './dashboard.ts';
|
import type { Dashboard } from './dashboard.ts';
|
||||||
import { runSpecs, clearCache, type RunOptions } from './runner.ts';
|
import { clearCache, type RunOptions } from './runner.ts';
|
||||||
|
|
||||||
// ── Query/Response types ──
|
// ── Query/Response types ──
|
||||||
|
|
||||||
interface StatusQuery {
|
type Query =
|
||||||
type: 'status';
|
| { type: 'status' }
|
||||||
}
|
| { type: 'rerun'; pattern?: string }
|
||||||
|
| { type: 'failures' }
|
||||||
|
| { type: 'reset-cache' };
|
||||||
|
|
||||||
interface RerunQuery {
|
type Response =
|
||||||
type: 'rerun';
|
| { type: 'status'; running: boolean; passed: number; failed: number; skipped: number; pending: number; total: number; failures: Array<{ name: string; error?: string }> }
|
||||||
pattern?: string;
|
| { type: 'rerun'; specsQueued: number }
|
||||||
}
|
| { type: 'failures'; failures: Array<{ name: string; specFile: string; error?: string }> }
|
||||||
|
| { type: 'reset-cache'; ok: true }
|
||||||
interface FailuresQuery {
|
| { type: 'error'; message: string };
|
||||||
type: 'failures';
|
|
||||||
}
|
|
||||||
|
|
||||||
interface ResetCacheQuery {
|
|
||||||
type: 'reset-cache';
|
|
||||||
}
|
|
||||||
|
|
||||||
type Query = StatusQuery | RerunQuery | FailuresQuery | ResetCacheQuery;
|
|
||||||
|
|
||||||
interface StatusResponse {
|
|
||||||
type: 'status';
|
|
||||||
running: boolean;
|
|
||||||
passed: number;
|
|
||||||
failed: number;
|
|
||||||
skipped: number;
|
|
||||||
pending: number;
|
|
||||||
total: number;
|
|
||||||
failures: Array<{ name: string; error?: string }>;
|
|
||||||
}
|
|
||||||
|
|
||||||
interface RerunResponse {
|
|
||||||
type: 'rerun';
|
|
||||||
specsQueued: number;
|
|
||||||
}
|
|
||||||
|
|
||||||
interface FailuresResponse {
|
|
||||||
type: 'failures';
|
|
||||||
failures: Array<{ name: string; specFile: string; error?: string }>;
|
|
||||||
}
|
|
||||||
|
|
||||||
interface ResetCacheResponse {
|
|
||||||
type: 'reset-cache';
|
|
||||||
ok: true;
|
|
||||||
}
|
|
||||||
|
|
||||||
interface ErrorResponse {
|
|
||||||
type: 'error';
|
|
||||||
message: string;
|
|
||||||
}
|
|
||||||
|
|
||||||
type Response = StatusResponse | RerunResponse | FailuresResponse | ResetCacheResponse | ErrorResponse;
|
|
||||||
|
|
||||||
// ── Bridge ──
|
// ── Bridge ──
|
||||||
|
|
||||||
|
|
@ -135,7 +96,7 @@ export class AgentBridge {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private handleStatus(): StatusResponse {
|
private handleStatus(): Response {
|
||||||
const tests = this.dashboard.getTests();
|
const tests = this.dashboard.getTests();
|
||||||
const passed = tests.filter((t) => t.status === 'passed').length;
|
const passed = tests.filter((t) => t.status === 'passed').length;
|
||||||
const failed = tests.filter((t) => t.status === 'failed').length;
|
const failed = tests.filter((t) => t.status === 'failed').length;
|
||||||
|
|
@ -157,23 +118,15 @@ export class AgentBridge {
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
private handleRerun(query: RerunQuery): RerunResponse {
|
private handleRerun(query: Extract<Query, { type: 'rerun' }>): Response {
|
||||||
if (this.running) {
|
if (this.running) return { type: 'rerun', specsQueued: 0 };
|
||||||
return { type: 'rerun', specsQueued: 0 };
|
const opts: RunOptions = { full: true };
|
||||||
}
|
|
||||||
|
|
||||||
const opts: RunOptions = {};
|
|
||||||
if (query.pattern) opts.pattern = query.pattern;
|
if (query.pattern) opts.pattern = query.pattern;
|
||||||
opts.full = true; // rerun ignores cache
|
this.triggerRerun?.(opts);
|
||||||
|
|
||||||
if (this.triggerRerun) {
|
|
||||||
this.triggerRerun(opts);
|
|
||||||
}
|
|
||||||
|
|
||||||
return { type: 'rerun', specsQueued: 1 };
|
return { type: 'rerun', specsQueued: 1 };
|
||||||
}
|
}
|
||||||
|
|
||||||
private handleFailures(): FailuresResponse {
|
private handleFailures(): Response {
|
||||||
const tests = this.dashboard.getTests();
|
const tests = this.dashboard.getTests();
|
||||||
const failures = tests
|
const failures = tests
|
||||||
.filter((t) => t.status === 'failed')
|
.filter((t) => t.status === 'failed')
|
||||||
|
|
@ -186,7 +139,7 @@ export class AgentBridge {
|
||||||
return { type: 'failures', failures };
|
return { type: 'failures', failures };
|
||||||
}
|
}
|
||||||
|
|
||||||
private handleResetCache(): ResetCacheResponse {
|
private handleResetCache(): Response {
|
||||||
clearCache();
|
clearCache();
|
||||||
return { type: 'reset-cache', ok: true };
|
return { type: 'reset-cache', ok: true };
|
||||||
}
|
}
|
||||||
|
|
|
||||||
5459
tests/e2e/daemon/package-lock.json
generated
Normal file
5459
tests/e2e/daemon/package-lock.json
generated
Normal file
File diff suppressed because it is too large
Load diff
Loading…
Add table
Add a link
Reference in a new issue