1
This commit is contained in:
@@ -2,7 +2,7 @@ import test from 'node:test'
|
||||
import assert from 'node:assert/strict'
|
||||
import { readFileSync } from 'node:fs'
|
||||
import { resolve } from 'node:path'
|
||||
import { parseArguments } from './admin-test-env-acceptance.mjs'
|
||||
import { AcceptanceRun, parseArguments, validateExecutionOptions } from './admin-test-env-acceptance.mjs'
|
||||
|
||||
const source = readFileSync(resolve('scripts/admin-test-env-acceptance.mjs'), 'utf8')
|
||||
|
||||
@@ -33,3 +33,38 @@ test('entry accepts a separate overseas Gateway without exposing token state', (
|
||||
assert.match(source, /async requestOverseasMultipart\(/)
|
||||
assert.match(source, /forbiddenValues = \[this\.options\.password, this\.token, this\.overseasToken\]/)
|
||||
})
|
||||
|
||||
test('entry has no built-in environment address or password and requires explicit execution options', () => {
|
||||
assert.doesNotMatch(source, /8\.163\.|ChangeMe123|DEFAULT_PASSWORD|DEFAULT_GATEWAY/)
|
||||
assert.throws(() => validateExecutionOptions(parseArguments(['--modules', 'phase4-overseas-pda'])),
|
||||
/缺少必填执行参数/)
|
||||
const options = parseArguments([
|
||||
'--gateway', 'http://localhost:9000', '--overseas-gateway', 'http://localhost:9300',
|
||||
'--username', 'contract-user', '--password', 'contract-password', '--modules', 'phase4-overseas-pda',
|
||||
])
|
||||
assert.equal(validateExecutionOptions(options), options)
|
||||
})
|
||||
|
||||
test('core coverage gaps fail closed while device and external-provider gaps remain report-only', () => {
|
||||
const run = new AcceptanceRun({ gateway: 'http://localhost:9000', overseasGateway: 'http://localhost:9300',
|
||||
username: 'contract-user', password: 'contract-password', modules: [], output: '' })
|
||||
run.addCoverageGap('phase4', 'core', 'fixture', 'missing fixture', 'fixture')
|
||||
assert.equal(run.steps.at(-1)?.passed, false)
|
||||
assert.equal(run.steps.at(-1)?.deploymentBlocker, true)
|
||||
const stepCount = run.steps.length
|
||||
run.addCoverageGap('phase3', 'device', 'Android', 'manual device validation', 'device')
|
||||
run.addCoverageGap('phase3', 'provider', 'captcha', 'external captcha', 'external-third-party')
|
||||
assert.equal(run.steps.length, stepCount)
|
||||
})
|
||||
|
||||
test('PDA entry expands the real phase-three producer chain and builds an FBA/OVERSEAS/second-container matrix', () => {
|
||||
const modules = parseArguments(['--modules', 'phase4-overseas-pda']).modules
|
||||
for (const prerequisite of ['merchant-qualification-fixture', 'phase3-loading', 'phase3-pda-convergence',
|
||||
'phase3-evidence-gate', 'phase3-loading-finalize']) {
|
||||
assert.ok(modules.indexOf(prerequisite) >= 0 && modules.indexOf(prerequisite) < modules.indexOf('phase4-overseas-pda'))
|
||||
}
|
||||
assert.match(source, /async ensurePhase4PdaProducerMatrix\(\)/)
|
||||
assert.match(source, /runPhase4ProducerVariant\('OVERSEAS-PRIMARY', 'OVERSEAS'\)/)
|
||||
assert.match(source, /runPhase4ProducerVariant\('SECONDARY', 'FBA'\)/)
|
||||
assert.match(source, /readyForPhase4Pda === true/)
|
||||
})
|
||||
|
||||
Reference in New Issue
Block a user