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/
|
||||
debug/
|
||||
*.tar.gz
|
||||
tests/test-results/
|
||||
|
|
|
|||
|
|
@ -3,62 +3,23 @@
|
|||
// and query the test daemon programmatically.
|
||||
|
||||
import { createInterface } from 'node:readline';
|
||||
import type { Dashboard, TestEntry } from './dashboard.ts';
|
||||
import { runSpecs, clearCache, type RunOptions } from './runner.ts';
|
||||
import type { Dashboard } from './dashboard.ts';
|
||||
import { clearCache, type RunOptions } from './runner.ts';
|
||||
|
||||
// ── Query/Response types ──
|
||||
|
||||
interface StatusQuery {
|
||||
type: 'status';
|
||||
}
|
||||
type Query =
|
||||
| { type: 'status' }
|
||||
| { type: 'rerun'; pattern?: string }
|
||||
| { type: 'failures' }
|
||||
| { type: 'reset-cache' };
|
||||
|
||||
interface RerunQuery {
|
||||
type: 'rerun';
|
||||
pattern?: string;
|
||||
}
|
||||
|
||||
interface FailuresQuery {
|
||||
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;
|
||||
type Response =
|
||||
| { type: 'status'; running: boolean; passed: number; failed: number; skipped: number; pending: number; total: number; failures: Array<{ name: string; error?: string }> }
|
||||
| { type: 'rerun'; specsQueued: number }
|
||||
| { type: 'failures'; failures: Array<{ name: string; specFile: string; error?: string }> }
|
||||
| { type: 'reset-cache'; ok: true }
|
||||
| { type: 'error'; message: string };
|
||||
|
||||
// ── Bridge ──
|
||||
|
||||
|
|
@ -135,7 +96,7 @@ export class AgentBridge {
|
|||
}
|
||||
}
|
||||
|
||||
private handleStatus(): StatusResponse {
|
||||
private handleStatus(): Response {
|
||||
const tests = this.dashboard.getTests();
|
||||
const passed = tests.filter((t) => t.status === 'passed').length;
|
||||
const failed = tests.filter((t) => t.status === 'failed').length;
|
||||
|
|
@ -157,23 +118,15 @@ export class AgentBridge {
|
|||
};
|
||||
}
|
||||
|
||||
private handleRerun(query: RerunQuery): RerunResponse {
|
||||
if (this.running) {
|
||||
return { type: 'rerun', specsQueued: 0 };
|
||||
}
|
||||
|
||||
const opts: RunOptions = {};
|
||||
private handleRerun(query: Extract<Query, { type: 'rerun' }>): Response {
|
||||
if (this.running) return { type: 'rerun', specsQueued: 0 };
|
||||
const opts: RunOptions = { full: true };
|
||||
if (query.pattern) opts.pattern = query.pattern;
|
||||
opts.full = true; // rerun ignores cache
|
||||
|
||||
if (this.triggerRerun) {
|
||||
this.triggerRerun(opts);
|
||||
}
|
||||
|
||||
this.triggerRerun?.(opts);
|
||||
return { type: 'rerun', specsQueued: 1 };
|
||||
}
|
||||
|
||||
private handleFailures(): FailuresResponse {
|
||||
private handleFailures(): Response {
|
||||
const tests = this.dashboard.getTests();
|
||||
const failures = tests
|
||||
.filter((t) => t.status === 'failed')
|
||||
|
|
@ -186,7 +139,7 @@ export class AgentBridge {
|
|||
return { type: 'failures', failures };
|
||||
}
|
||||
|
||||
private handleResetCache(): ResetCacheResponse {
|
||||
private handleResetCache(): Response {
|
||||
clearCache();
|
||||
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