feat(scenario): add automatic step boundary logging to run logs
- step start, pass, and fail events logged automatically - step boundaries visible in run logs without explicit context.log calls - version bumped from 1.9.0 to 1.9.1
This commit is contained in:
@@ -2,6 +2,14 @@
|
||||
|
||||
All notable changes to this project will be documented in this file.
|
||||
|
||||
## 1.9.1 - 2026-09-15
|
||||
|
||||
Changes since 1.9.0:
|
||||
|
||||
### Added
|
||||
|
||||
- Scenario run logs now include an automatic entry when a step starts and when it finishes (pass or fail), so step boundaries are visible in run logs even for steps that don't call `context.log`/`context.assert` themselves.
|
||||
|
||||
## 1.9.0 - 2026-09-15
|
||||
|
||||
Changes since 1.8.0:
|
||||
|
||||
+1
-1
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "liqa",
|
||||
"version": "1.9.0",
|
||||
"version": "1.9.1",
|
||||
"private": true,
|
||||
"workspaces": [
|
||||
"server",
|
||||
|
||||
@@ -345,6 +345,12 @@ export class ScenarioSchedulerService implements OnModuleInit {
|
||||
this.logger.log(
|
||||
`StepRun #${stepRun.id} (run #${stepRun.runId}, step #${step.id} order=${step.order}) → in_progress`,
|
||||
);
|
||||
this.persistLog(
|
||||
stepRun.runId,
|
||||
stepRun.id,
|
||||
"log",
|
||||
`Step ${step.order} started${step.title ? `: ${step.title}` : ""}`,
|
||||
);
|
||||
|
||||
try {
|
||||
if (!step.execCode) throw new Error("step has no execCode");
|
||||
@@ -453,6 +459,12 @@ export class ScenarioSchedulerService implements OnModuleInit {
|
||||
output !== null && output !== undefined ? JSON.stringify(output) : null;
|
||||
await this.runStepRepo.save(stepRun);
|
||||
this.logger.log(`StepRun #${stepRun.id} → pass`);
|
||||
this.persistLog(
|
||||
stepRun.runId,
|
||||
stepRun.id,
|
||||
"log",
|
||||
`Step ${(stepRun.scenarioStep as ScenarioStepEntity | undefined)?.order ?? "?"} passed`,
|
||||
);
|
||||
|
||||
// Find the next waiting step in this run (next by order)
|
||||
const nextStep = await this.runStepRepo.findOne({
|
||||
@@ -489,6 +501,12 @@ export class ScenarioSchedulerService implements OnModuleInit {
|
||||
stepRun.description = description;
|
||||
await this.runStepRepo.save(stepRun);
|
||||
this.logger.log(`StepRun #${stepRun.id} → fail: ${description}`);
|
||||
this.persistLog(
|
||||
stepRun.runId,
|
||||
stepRun.id,
|
||||
"error",
|
||||
`Step ${(stepRun.scenarioStep as ScenarioStepEntity | undefined)?.order ?? "?"} failed: ${description}`,
|
||||
);
|
||||
|
||||
// Cancel all remaining waiting/pending step runs in this run
|
||||
await this.runStepRepo
|
||||
|
||||
Reference in New Issue
Block a user