This commit is contained in:
2026-10-27 17:44:41 +08:00
parent 57cd211973
commit db0e72daeb
37 changed files with 701 additions and 671 deletions
+4 -3
View File
@@ -3,7 +3,7 @@ import { execFileSync } from 'node:child_process'
import { dirname, resolve, join } from 'node:path'
import { fileURLToPath, pathToFileURL } from 'node:url'
import { createHash } from 'node:crypto'
import { AcceptanceRun, parseArguments, validateExecutionOptions, buildAcceptanceSummary, createFleetPoolGrayOptions } from './admin-test-env-acceptance.mjs'
import { AcceptanceRun, parseArguments, validateExecutionOptions, buildAcceptanceSummary, createFleetPoolGrayOptions, grayFixedCustomerOptions } from './admin-test-env-acceptance.mjs'
import { createTestEvidenceReaders } from './fba-core-regression-evidence.mjs'
import { createGrayEvidenceReaders } from './gray-regression-evidence.mjs'
import { redactEvidence } from './fba-core-regression-test-env.mjs'
@@ -34,7 +34,7 @@ export function parseCrossCustomerArguments(args) {
}
export function crossCustomerPlan(config) {
return { environment: 'TEST', execute: config.execute, runId: config.runId, warehouseId: config.warehouseId || null, destinationWarehouseId: config.destinationWarehouseId || null,
output: `reports/fleet-cross-${config.runId}`, stages: ['two new customers', 'two ordinary transfer receipts', 'one native cross-customer dispatch and its unique automatic trip',
output: `reports/fleet-cross-${config.runId}`, stages: ['reuse two existing customers', 'two ordinary transfer receipts', 'one native cross-customer dispatch and its unique automatic trip',
'unready customer gate rejection', 'shared departure and replay', 'independent receipts', 'trip completion and separate resource release'],
limits: 'Prerequisite rejection is not mid-transaction rollback. No deployment, configuration change, SQL writes or automatic rerun. Retain business samples; disable temporary PDA in finally.' }
}
@@ -65,6 +65,7 @@ async function runCrossCustomerCore(config, { env = process.env, outputRoot = RO
|| !env.CHONGCHONG_ADMIN_USERNAME || !env.CHONGCHONG_ADMIN_PASSWORD) throw Error(`Explicit ${environment} configuration required`)
const base = new URL(env.CHONGCHONG_ADMIN_API_BASE_URL)
if (!(gray ? base.protocol === 'https:' : ['http:', 'https:'].includes(base.protocol)) || base.username || base.password || base.search || base.hash || !['/api', '/api/'].includes(base.pathname)) throw Error(`Invalid ${environment} gateway`)
const fixedCustomers = gray ? grayFixedCustomerOptions(env) : {}
if (gray) readers = createGrayEvidenceReaders(env)
else readers ||= createTestEvidenceReaders(env)
// Load the reviewed producer before creating any resources.
@@ -91,7 +92,7 @@ async function runCrossCustomerCore(config, { env = process.env, outputRoot = RO
await readers.preflight()
const transport = { gateway: base.origin, username: env.CHONGCHONG_ADMIN_USERNAME, password: env.CHONGCHONG_ADMIN_PASSWORD,
output, markerNamespace: createHash('sha256').update(`${environment}:${config.runId}`).digest('hex').slice(0, 12) }
const options = gray ? createFleetPoolGrayOptions(transport) : validateExecutionOptions({
const options = gray ? createFleetPoolGrayOptions({ ...transport, ...fixedCustomers }) : validateExecutionOptions({
...parseArguments(['--modules', 'merchant-qualification-fixture', '--quiet', 'true']), ...transport, environment: 'test' })
context = contextFactory(options)
const previousCheckpoint = context.checkpoint