From e3dc5329aaafd855b475b7c269d91791b8d1950e Mon Sep 17 00:00:00 2001 From: ouyangxq <775153912@qq.com> Date: Thu, 10 Sep 2026 21:26:52 +0800 Subject: [PATCH] fix(acceptance): reuse configured merchant credentials --- .../admin-test-env-modules/inbound-fees-contract.test.mjs | 4 ++-- scripts/admin-test-env-modules/inbound-fees.mjs | 5 ++++- .../phase4-carrier-nodes-contract.test.mjs | 2 +- scripts/admin-test-env-modules/phase4-carrier-nodes.mjs | 2 +- 4 files changed, 8 insertions(+), 5 deletions(-) diff --git a/scripts/admin-test-env-modules/inbound-fees-contract.test.mjs b/scripts/admin-test-env-modules/inbound-fees-contract.test.mjs index 251f83da1..044718c60 100644 --- a/scripts/admin-test-env-modules/inbound-fees-contract.test.mjs +++ b/scripts/admin-test-env-modules/inbound-fees-contract.test.mjs @@ -48,8 +48,8 @@ test('customer confirms chargeable quantity and manual unit price in one locked const source = await readFile(moduleFile, 'utf8') assert.match(source, /const orderId = id\(fixture\?\.orderId\)/) assert.match(source, /context\.context\?\.merchantQualificationFixture/) - assert.match(source, /merchantFixture\?\.username/) - assert.match(source, /merchantFixture\?\.password/) + assert.match(source, /merchantFixture\?\.username \|\| MERCHANT_USERNAME/) + assert.match(source, /merchantFixture\?\.password \|\| MERCHANT_PASSWORD/) assert.doesNotMatch(source, /const orderId = id\(context\.createdResources\.orders\?\.orderId\)/) assert.match(source, /Client 读取已推送计费量、对客单价和费用合计/) assert.match(source, /Client 一次确认计费量、对客单价和费用/) diff --git a/scripts/admin-test-env-modules/inbound-fees.mjs b/scripts/admin-test-env-modules/inbound-fees.mjs index 3a4e8adfd..3ed2dfb03 100644 --- a/scripts/admin-test-env-modules/inbound-fees.mjs +++ b/scripts/admin-test-env-modules/inbound-fees.mjs @@ -1,5 +1,7 @@ const MODULE = 'inbound-fees' const OPTIONS = { scenario: 'inbound-fee-lifecycle', deploymentBlocker: true } +const MERCHANT_USERNAME = process.env.MERCHANT_TEST_USERNAME || '' +const MERCHANT_PASSWORD = process.env.MERCHANT_TEST_PASSWORD || '' function id(value) { return value === null || value === undefined ? '' : String(value) } function success(response) { return response?.http === 200 && String(response?.body?.code) === '200' } @@ -134,7 +136,8 @@ export async function run(context) { const orderId = id(fixture?.orderId) const merchantFixture = context.context?.merchantQualificationFixture const merchantLoginResponse = await context.request('POST', '/api/auth/login', { - loginId: merchantFixture?.username, password: merchantFixture?.password, + loginId: merchantFixture?.username || MERCHANT_USERNAME, + password: merchantFixture?.password || MERCHANT_PASSWORD, }, '') const merchantLogin = context.apiSuccess(MODULE, 'Client 登录并准备确认计费量和费用', merchantLoginResponse, `orderId=${orderId || 'missing'}`, OPTIONS) diff --git a/scripts/admin-test-env-modules/phase4-carrier-nodes-contract.test.mjs b/scripts/admin-test-env-modules/phase4-carrier-nodes-contract.test.mjs index a4a33b8a2..efd86abc8 100644 --- a/scripts/admin-test-env-modules/phase4-carrier-nodes-contract.test.mjs +++ b/scripts/admin-test-env-modules/phase4-carrier-nodes-contract.test.mjs @@ -185,7 +185,7 @@ function markerOwnedContext() { if (body.actualAt != null && NODE_SEQUENCES[body.standardNode] <= NODE_SEQUENCES[task.latestActualNode]) { return conflict(`req-monotonic-${key}`, - `人工实际节点必须严格晚于当前最新实际节点:${task.latestActualNode}`) + '实际船节点必须按业务顺序向后推进') } const providerEventId = `manual-${String(nextId)}` nodes.push({ diff --git a/scripts/admin-test-env-modules/phase4-carrier-nodes.mjs b/scripts/admin-test-env-modules/phase4-carrier-nodes.mjs index 21a1e2586..f9e53aa20 100644 --- a/scripts/admin-test-env-modules/phase4-carrier-nodes.mjs +++ b/scripts/admin-test-env-modules/phase4-carrier-nodes.mjs @@ -34,7 +34,7 @@ function codeOf(response) { return response?.body?.code == null ? 'missing' : St function rejected(response) { return response?.http === 200 && ['A0409', '409'].includes(codeOf(response)) } function monotonicRejected(response) { return rejected(response) - && String(response?.body?.message || '').includes('人工实际节点必须严格晚于当前最新实际节点') + && String(response?.body?.message || '').includes('实际船节点必须按业务顺序向后推进') && Boolean(response?.requestId) && Boolean(response?.traceId) } function localIso(value) { return value.toISOString().slice(0, 19) }