ui/server/src/testRuns
running a feature's tests is a Process: one plan, one step, flow test.run (src/plan.mjs), exactly like a Review-mode analysis (reviewAnalyses.mjs, #351).
Cockpit server, v0.8. Source: ui/server/src/testRuns.mjs.
Variables#
KEEP_FINISHED_RUNS#
constKEEP_FINISHED_RUNS:30=30
Defined in: ui/server/src/testRuns.mjs:26
Finished run records kept in the store (and so in the drawer); older ones are removed.
TEST_RUN_FLOW#
constTEST_RUN_FLOW:"test.run"='test.run'
Defined in: ui/server/src/testRuns.mjs:23
TEST_RUN_STEP#
constTEST_RUN_STEP:"run"='run'
Defined in: ui/server/src/testRuns.mjs:24
TEST_RUN_WORKER#
constTEST_RUN_WORKER:any
Defined in: ui/server/src/testRuns.mjs:22
Functions#
createRunResults()#
createRunResults():
object
Defined in: ui/server/src/testRuns.mjs:57
Finished runs' outcomes, by process id, bounded. Never persisted: a run is derived, so a restart simply runs again.
Returns#
object
delete
delete: (
id) =>boolean
Parameters
id
any
Returns
boolean
get
get: (
id) =>any
Parameters
id
any
Returns
any
set()
set(
id,value):void
Parameters
id
any
value
any
Returns
void
createTestRunExecutor()#
createTestRunExecutor(
opts?):object
Defined in: ui/server/src/testRuns.mjs:77
Parameters#
opts?
run(job, {signal, onProgress}) is the test seam; the default forks the worker.
results?
{ delete: (id) => boolean; get: (id) => any; set: void; } = ...
results.delete
(id) => boolean = ...
results.get
(id) => any = ...
results.set
run?
Function = forkTestRun
runOptions?
any = {}
Returns#
object
executeStep
executeStep: (
__namedParameters) =>Promise<{artifacts:any[];error:any;llm:any;ok:boolean; } | {artifacts:any[];llm:any;ok:boolean; }>
Parameters
__namedParameters
log
any
process
any
signal
any
step
any
Returns
Promise<{ artifacts: any[]; error: any; llm: any; ok: boolean; } | { artifacts: any[]; llm: any; ok: boolean; }>
results
results:
object
results.delete
delete: (
id) =>boolean
Parameters
id
any
Returns
boolean
results.get
get: (
id) =>any
Parameters
id
any
Returns
any
results.set()
set(
id,value):void
Parameters
id
any
value
any
Returns
void
createTestRunJobs()#
createTestRunJobs(
__namedParameters):object
Defined in: ui/server/src/testRuns.mjs:155
Which runs belong to which feature: the one that is live, the newest problem and the latest outcome of every file.
Parameters#
__namedParameters
runs
any
Returns#
cancel()
cancel(
root,feature):any
Cancel the feature's live run with the machine's own CANCEL. -> {status, body} | null when none is live.
Parameters
root
any
feature
any
Returns
any
enqueue()
enqueue(
root,feature,target,origin): {error?:undefined;live: {processId:any;state:any;target:any; };processId?:undefined;started:boolean; } | {error:any;live?:undefined;processId?:undefined;started:boolean; } | {error?:undefined;live?:undefined;processId:any;started:boolean; }
Start a run unless this feature already has a live one. -> {started:true, processId} | {started:false, live} | {started:false, error}
Parameters
root
any
feature
any
target
any
origin
any
Returns
{ error?: undefined; live: { processId: any; state: any; target: any; }; processId?: undefined; started: boolean; } | { error: any; live?: undefined; processId?: undefined; started: boolean; } | { error?: undefined; live?: undefined; processId: any; started: boolean; }
last()
last(
root,feature):object
Latest outcome per test file across the feature's finished runs (newest wins) and the run it came from.
Parameters
root
any
feature
any
Returns
object
lastRun
lastRun:
object
lastRun.baseUrl
baseUrl:
any=e.result.baseUrl
lastRun.counts
counts:
any=e.result.counts
lastRun.durationMs
durationMs:
any=e.result.durationMs
lastRun.processId
processId:
any=e.processId
lastRun.target
target:
any=e.target
tests
tests:
any[]
live()
live(
root,feature):object
The feature's queued/running run, or null.
Parameters
root
any
feature
any
Returns
object
processId
processId:
any=e.processId
state
state:
any=e.state
target
target:
any=e.target
pending()
pending():
number
Returns
number
problem()
problem(
root,feature):object
The newest run that did not produce a result (a refusal, a failure or a cancel), unless a newer one finished.
Parameters
root
any
feature
any
Returns
object
code
code:
any
message
message:
any
state
state:
any=newest.state
target
target:
any=newest.target
createTestRuns()#
createTestRuns(
deps):object
Defined in: ui/server/src/testRuns.mjs:112
Parameters#
deps
results
{ delete: (id) => boolean; get: (id) => any; set: void; }
results.delete
(id) => boolean = ...
results.get
(id) => any = ...
results.set
service
{ control: Function; startPlan: Function; store: Function; }
service.control
Function
service.startPlan
Function
service.store
Function
Returns#
cancel
cancel: (
processId) =>any
Parameters
processId
any
Returns
any
start()
start(
spec): {error?:undefined;ok:boolean;processId:any; } | {error:any;ok:boolean;processId?:undefined; }
Parameters
spec
any
Returns
{ error?: undefined; ok: boolean; processId: any; } | { error: any; ok: boolean; processId?: undefined; }
stateOf()
stateOf(
processId): {state:string; } | {processId:any;result:any;state:string; } | {processId:any;state:string; } | {error:any;processId:any;state:string; }
A run's state, read from the process record (the single source of truth).
Parameters
processId
any
Returns
{ state: string; } | { processId: any; result: any; state: string; } | { processId: any; state: string; } | { error: any; processId: any; state: string; }
forkTestRun()#
forkTestRun(
job,options?):Promise<any>
Defined in: ui/server/src/testRuns.mjs:71
Default runner: the forked worker. The run's own debris (temp dir, a stray Playwright) is reclaimed by pid.
Parameters#
job
any
options?
Returns#
Promise<any>
isTestRunPlan()#
isTestRunPlan(
plan):boolean
Defined in: ui/server/src/testRuns.mjs:35
Is this stored plan a test run (and so not a plan Review mode may offer as an expected scope)?
Parameters#
plan
any
Returns#
boolean
testRunPlan()#
testRunPlan(
__namedParameters):object
Defined in: ui/server/src/testRuns.mjs:41
The plan a run is. origin is an already-validated app origin; name/area are an already-validated test.
Parameters#
__namedParameters
area
any
feature
any
name
any
origin
any
Returns#
object
steps
steps:
object[]
ticket
ticket:
object
ticket.source
source:
string='text'
ticket.title
title:
string
version
version:
number=1