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.
|
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
|
## 1.9.0 - 2026-09-15
|
||||||
|
|
||||||
Changes since 1.8.0:
|
Changes since 1.8.0:
|
||||||
|
|||||||
+1
-1
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "liqa",
|
"name": "liqa",
|
||||||
"version": "1.9.0",
|
"version": "1.9.1",
|
||||||
"private": true,
|
"private": true,
|
||||||
"workspaces": [
|
"workspaces": [
|
||||||
"server",
|
"server",
|
||||||
|
|||||||
@@ -345,6 +345,12 @@ export class ScenarioSchedulerService implements OnModuleInit {
|
|||||||
this.logger.log(
|
this.logger.log(
|
||||||
`StepRun #${stepRun.id} (run #${stepRun.runId}, step #${step.id} order=${step.order}) → in_progress`,
|
`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 {
|
try {
|
||||||
if (!step.execCode) throw new Error("step has no execCode");
|
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;
|
output !== null && output !== undefined ? JSON.stringify(output) : null;
|
||||||
await this.runStepRepo.save(stepRun);
|
await this.runStepRepo.save(stepRun);
|
||||||
this.logger.log(`StepRun #${stepRun.id} → pass`);
|
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)
|
// Find the next waiting step in this run (next by order)
|
||||||
const nextStep = await this.runStepRepo.findOne({
|
const nextStep = await this.runStepRepo.findOne({
|
||||||
@@ -489,6 +501,12 @@ export class ScenarioSchedulerService implements OnModuleInit {
|
|||||||
stepRun.description = description;
|
stepRun.description = description;
|
||||||
await this.runStepRepo.save(stepRun);
|
await this.runStepRepo.save(stepRun);
|
||||||
this.logger.log(`StepRun #${stepRun.id} → fail: ${description}`);
|
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
|
// Cancel all remaining waiting/pending step runs in this run
|
||||||
await this.runStepRepo
|
await this.runStepRepo
|
||||||
|
|||||||
Reference in New Issue
Block a user