test(wp7-02): require GPT reference edit route
Dada P0-A isolated Windows CI / validate-and-package (push) Failing after 1m55s

This commit is contained in:
suyx
2026-08-04 17:23:34 +08:00
parent 0201c3e896
commit fa925bfe12
2 changed files with 11 additions and 2 deletions
@@ -96,6 +96,14 @@ test("TDD-WP7-EXT-001 builds protocol-specific requests without auth in argument
size: "1008x1792",
});
assert.equal("authorization" in openai.headers, false);
const openaiEdit = buildProviderRequest({ modelConfig: models[2], prompt: "controlled fixture prompt", ratio: "1:1", reference });
assert.equal(openaiEdit.url, "https://oneapi.intelligrow.cn/v1/images/edits");
assert.equal(openaiEdit.body instanceof FormData, true);
assert.equal(openaiEdit.body.get("model"), "gpt-image-2");
assert.equal(openaiEdit.body.get("size"), "1088x1088");
assert.equal(openaiEdit.body.get("image[]") instanceof Blob, true);
assert.equal("content-type" in openaiEdit.headers, false);
});
test("TDD-WP7-EXT-001 retains only response metadata and hashes", () => {
@@ -98,7 +98,7 @@ test("TDD-WP7-EXT-001 remains externally blocked without confirmation, config an
test("TDD-WP7-EXT-001 fixes independent OneAPI routes without embedding credentials", () => {
const manifest = JSON.parse(readFileSync("config/wp7-02-oneapi-test.json", "utf8"));
assert.equal(manifest.config_set_version, 2);
assert.equal(manifest.config_set_version, 3);
assert.equal(manifest.gateway_account_ref, "oneapi-intelligrow-test");
assert.deepEqual(manifest.models.map((entry) => entry.model_id), WP7_02_MODEL_IDS);
assert.deepEqual(manifest.models.map((entry) => entry.route_profile.protocol_version), [
@@ -106,8 +106,9 @@ test("TDD-WP7-EXT-001 fixes independent OneAPI routes without embedding credenti
"gemini-native-v1",
"openai-images-v1",
]);
assert.deepEqual(manifest.models.map((entry) => entry.config_version), [2, 2, 1]);
assert.deepEqual(manifest.models.map((entry) => entry.config_version), [2, 2, 2]);
assert.equal(manifest.models.slice(0, 2).every((entry) => /\/v1\/models\/.+:generateContent$/.test(entry.route_profile.endpoint)), true);
assert.equal(manifest.models[2].route_profile.reference_endpoint, "https://oneapi.intelligrow.cn/v1/images/edits");
assert.equal(manifest.models.every((entry) => entry.route_profile.endpoint.startsWith("https://oneapi.intelligrow.cn/")), true);
assert.doesNotMatch(JSON.stringify(manifest), /api[_-]?key|authorization|bearer|sk-[A-Za-z0-9]/i);
});