test(ci): verify complete Python reports and exact model references

This commit is contained in:
Agent Workbench Dev
2026-11-07 23:25:49 +08:00
parent 50d799c6b4
commit d5207dc6cc
4 changed files with 25 additions and 3 deletions
+9 -1
View File
@@ -2,6 +2,7 @@ import test from 'node:test';
import assert from 'node:assert/strict';
import fs from 'node:fs';
import path from 'node:path';
import { createHash } from 'node:crypto';
import { fixture, launchWorkbench, until, compatibleFixture, call, completion, assertToolPairs } from './helpers.mjs';
import { deliveryGit } from './fixtures/delivery-project.mjs';
import { captureWorkspaceSource, assertWorkspaceSource } from './fixtures/workspace-project.mjs';
@@ -103,7 +104,14 @@ test('an isolated three-module Python Task repairs, checks and delivers a source
await host.api(route + '/delivery-jobs', { planId: session.execution.deliveryPlans.at(-1).id });
await wait(value => value.execution.deliveries.at(-1).status === 'completed' && !!value.execution.deliveries.at(-1).reportArtifactId);
assert.equal(model.requests.length, requests); assert.equal(session.status, 'completed');
const job = session.execution.deliveries.at(-1), report = JSON.parse((await host.api('/artifacts/' + job.reportArtifactId + '?session=' + session.id + '&limit=64000')).content);
const job = session.execution.deliveries.at(-1), artifactRoute = '/artifacts/' + job.reportArtifactId + '?session=' + session.id;
const metadata = await host.api(artifactRoute + '&limit=1');
const download = await fetch(host.url + '/api' + artifactRoute + '&download=1', { headers: { 'X-Workbench-Token': host.bootstrap.token, Connection: 'close' } });
assert.equal(download.status, 200);
const bytes = Buffer.from(await download.arrayBuffer());
assert.equal(bytes.length, metadata.bytes);
assert.equal(createHash('sha256').update(bytes).digest('hex'), metadata.sha256);
const report = JSON.parse(bytes.toString('utf8'));
assert.equal(report.status, 'verified_committed'); assert.equal(report.workspace.workspaceId, workspace.id);
assert.equal(report.workspace.sourceRoot, f.projectRoot); assert.equal(report.task.id, taskId);
assert.deepEqual(job.paths.slice().sort(), Object.keys(pythonFixes).sort());