Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,9 @@ project adheres to [Semantic Versioning](https://semver.org/).
- Playwright setup note in the Quick start section of `README.md`.

### Fixed
- An act result that explicitly reports `fault: null` is stored as null. The
report used to replace that null with the requested fault, so a cleared
fault was recorded as `duplicate` when `--fault duplicate` was passed.
- The integrator example now removes its scratch directory when decide fails
or policy refuses the response. `process.exit` skipped the cleanup, so each
failed run left an `aas-integrator-` directory behind.
Expand Down
2 changes: 1 addition & 1 deletion bin/aas.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -1696,7 +1696,7 @@ export async function runDemo(args = [], options = {}) {
status: stages.act.status,
outcome,
state: act.raw?.state ?? null,
fault: act.raw?.fault ?? fault,
fault: act.raw && Object.hasOwn(act.raw, "fault") ? act.raw.fault : fault,
action_id: act.raw?.action_id ?? null,
assurance_mode: act.raw?.assurance_mode ?? null,
bundle_verification: act.raw?.bundle_verification ?? null,
Expand Down
14 changes: 14 additions & 0 deletions test/stack.test.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -1813,6 +1813,20 @@ test("demo rejects an unknown domain before running any stage", async () => {
assert.equal(rejected.exitCode, 2);
});

test("an explicit null act fault stays null instead of becoming the requested fault", async () => {
const outputRoot = tempRoot();
const cleared = await runDemo(["--fault", "duplicate"], stubOptions(outputRoot, {
runId: "null-fault",
runActFn: async () => ({ ok: true, raw: { outcome: "settled", state: "CLOSED", fault: null, action_id: "act-null" }, status: 0 }),
}));
assert.equal(cleared.report.stages.act.fault, null);
const omitted = await runDemo(["--fault", "duplicate"], stubOptions(outputRoot, {
runId: "omitted-fault",
runActFn: async () => ({ ok: true, raw: { outcome: "settled", state: "CLOSED", action_id: "act-omit" }, status: 0 }),
}));
assert.equal(omitted.report.stages.act.fault, "duplicate");
});

test("runAct targets the requested rail demo domain", () => {
const seen = [];
const runner = (bin, args) => {
Expand Down
Loading