test: freeze host-authoritative original Purge validation

This commit is contained in:
Agent Workbench Dev
2026-11-06 13:53:53 +08:00
parent 01e64f3fcf
commit a6830bbf50
16 changed files with 256 additions and 15 deletions
+2 -2
View File
@@ -8,10 +8,10 @@ import { Agent, fetch } from 'undici';
export let root = path.resolve('.qa/live-validation-ad'), origin = 'http://127.0.0.1:4318';
export function engineeringEvidence() { root = path.resolve('.qa/live-engineering-ae'); }
let purgeFixture;
export function purgeEvidence() { root = purgeFixture?.root ?? path.resolve('.qa/live-purge-af'); if (purgeFixture) origin = purgeFixture.origin; }
export function purgeEvidence() { root = purgeFixture?.root ?? path.resolve(process.argv.includes('--batch=ag') ? '.qa/live-purge-ag' : '.qa/live-purge-af'); if (purgeFixture) origin = purgeFixture.origin; }
export function configurePurgeFixture(options) {
const target = path.resolve(options.root), url = new URL(options.origin);
assert.equal(path.dirname(target), path.resolve('.qa')); assert.match(path.basename(target), /^af-driver-[a-f0-9-]{36}$/);
assert.equal(path.dirname(target), path.resolve('.qa')); assert.match(path.basename(target), /^a[fg]-driver-[a-f0-9-]{36}$/);
assert.equal(url.hostname, '127.0.0.1'); assert.notEqual(url.port, '4318'); assert.ok(url.port);
purgeFixture = { root: target, origin: url.origin }; purgeEvidence();
}