test: pin lineage queued-vs-emitted semantics
This commit is contained in:
@@ -9,6 +9,7 @@ import {
|
||||
type Aud0OutboxRepository,
|
||||
type Aud0OutboxStats,
|
||||
} from "@/src/evidence/aud0-outbox";
|
||||
import { LineageEmitter } from "@/src/lineage/lineage-emitter";
|
||||
import type { OpenLineageRunEvent } from "@/src/lineage/openlineage";
|
||||
import { SiaxError } from "@/src/platform/errors";
|
||||
|
||||
@@ -152,4 +153,43 @@ describe("AUD0 durable outbox", () => {
|
||||
expect(calls).toBe(0);
|
||||
expect(repo.dead[0].error).toBe("PERMANENT_FAILURE:0pt.aud0_outbox");
|
||||
});
|
||||
|
||||
it("reports a durable client acknowledgement as queued, not emitted", async () => {
|
||||
const emitter = new LineageEmitter(client({
|
||||
async ingestOpenLineageEvent(tenantId, _appId, input) {
|
||||
return {
|
||||
tenant_id: tenantId,
|
||||
run_id: input.run.runId,
|
||||
job: input.job.name,
|
||||
event_id: "outbox:obx-queued-1",
|
||||
};
|
||||
},
|
||||
}));
|
||||
|
||||
const result = await emitter.emit({
|
||||
tenant_id: "tenant-a",
|
||||
capability_id: "0pt.test.v1",
|
||||
run_id: "run-queued",
|
||||
event_type: "COMPLETE",
|
||||
event_time: "2026-09-07T12:00:00.000Z",
|
||||
});
|
||||
expect(result).toEqual({
|
||||
emitted: false,
|
||||
queued: true,
|
||||
run_id: "run-queued",
|
||||
outbox_id: "obx-queued-1",
|
||||
});
|
||||
});
|
||||
|
||||
it("reports a raw AUD0 acknowledgement as emitted, not queued", async () => {
|
||||
const emitter = new LineageEmitter(client());
|
||||
const result = await emitter.emit({
|
||||
tenant_id: "tenant-a",
|
||||
capability_id: "0pt.test.v1",
|
||||
run_id: "run-live",
|
||||
event_type: "COMPLETE",
|
||||
event_time: "2026-09-07T12:00:00.000Z",
|
||||
});
|
||||
expect(result).toEqual({ emitted: true, queued: false, run_id: "run-live" });
|
||||
});
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user