From 0ad8bb66cc8b742c9454f7e8f97751874ee5adad Mon Sep 17 00:00:00 2001 From: ouyangxq <775153912@qq.com> Date: Thu, 3 Sep 2026 21:00:11 +0800 Subject: [PATCH] test: bound reused price fixture names --- scripts/admin-test-env-modules/pricing-contract.test.mjs | 2 ++ scripts/admin-test-env-modules/pricing.mjs | 6 +++++- 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/scripts/admin-test-env-modules/pricing-contract.test.mjs b/scripts/admin-test-env-modules/pricing-contract.test.mjs index 55cc64b54..140566283 100644 --- a/scripts/admin-test-env-modules/pricing-contract.test.mjs +++ b/scripts/admin-test-env-modules/pricing-contract.test.mjs @@ -12,5 +12,7 @@ test('price-book acceptance is portable and reuses a deployed active source by d assert.match(source, /activeBefore\[0\]/) assert.match(source, /requestBinary\('GET', `\$\{PRICE_BOOK_PATH\}\/\$\{encodeURIComponent\(activeFixture\.id\)\}\/source`\)/) assert.match(source, /复用当前生效价格源作为本轮隔离上传夹具/) + assert.match(source, /sourceName = 'active-price-book-fixture\.xlsx'/) + assert.doesNotMatch(source, /sourceName = activeFixture\.originalFileName/) assert.doesNotMatch(source, /WXWork|Users\\BY-OY|DEFAULT_PRICE_BOOK_FILE/) }) diff --git a/scripts/admin-test-env-modules/pricing.mjs b/scripts/admin-test-env-modules/pricing.mjs index 91952b572..9dbed5222 100644 --- a/scripts/admin-test-env-modules/pricing.mjs +++ b/scripts/admin-test-env-modules/pricing.mjs @@ -160,7 +160,11 @@ export async function run(context) { return } sourceBytes = sourceResponse.bytes - sourceName = activeFixture.originalFileName || `price-book-${activeFixture.id}.xlsx` + // The active version may itself have been created by an earlier acceptance run. + // Reusing its original name would prepend a new marker on every run until the + // storage filename limit is exceeded. Keep the downloaded workbook content, + // but give each new isolated upload a stable, bounded fixture basename. + sourceName = 'active-price-book-fixture.xlsx' } const sourceHash = sha256(sourceBytes) const uploadName = `${context.marker}-${sourceName}`