TestRunsFactory
Run test suites and read results. Access via judgeval.testRuns.
const run = await judgeval.testRuns.start(testSuiteId, { candidate: process.env.GIT_SHA });
await Promise.all(
run.cases.map((c) => Tracer.testCase(run.run_id, c.case_id, () => agent(c.input))),
);
const { results } = await judgeval.testRuns.results(run.run_id);
start()
Start a run of the test suite’s latest published version.
async function start(testSuiteId: string, options: { case_filter?, candidate?, candidate_meta?, trigger? } = {}): Promise<StartedRun>
Parameters
PropType
testSuiteIdstring
Type
stringoptions.case_filter?CaseFilter
Type
CaseFilteroptions.candidate?string
Type
stringoptions.candidate_meta?Record<string, unknown>
Type
Record<string, unknown>options.trigger?"manual" | "schedule" | "ci" | "api"
Type
"manual" | "schedule" | "ci" | "api"Returns
Promise<StartedRun>
score()
Trigger scoring of an existing run’s traces with the latest published
version. Returns the new run right away; its cases are scored in the
background, so poll get.
async function score(runId: string): Promise<{ run_id: string }>
Parameters
PropType
runIdstring
Type
stringReturns
Promise<{ run_id: string }>