mirror of
https://github.com/saltbo/zpan.git
synced 2026-10-30 18:31:36 +08:00
fix(e2e): clean cloud license slots
This commit is contained in:
@@ -209,8 +209,8 @@ async function unbindCloudTestLicenses(cloudRequest: APIRequestContext) {
|
||||
const response = await cloudRequest.get('/api/licenses')
|
||||
await expectCloudOk(response, 'Cloud license list failed during pairing cleanup')
|
||||
|
||||
const body = (await response.json()) as { data?: { items?: CloudLicense[] } }
|
||||
const licenses = body.data?.items ?? []
|
||||
const body = (await response.json()) as { items: CloudLicense[] }
|
||||
const licenses = body.items
|
||||
for (const license of licenses) {
|
||||
const deleted = await cloudRequest.delete(`/api/licenses/${encodeURIComponent(license.id)}`)
|
||||
await expectCloudOk(deleted, 'Cloud license cleanup failed')
|
||||
|
||||
@@ -77,8 +77,13 @@ function valueAfter(flag) {
|
||||
|
||||
function runtimeCloudCredentials(runtime) {
|
||||
const suffix = runtime === 'cf' ? '_CF' : '_NODE'
|
||||
const email = process.env[`E2E_CLOUD_PRO_EMAIL${suffix}`] ?? process.env.E2E_CLOUD_PRO_EMAIL
|
||||
const password = process.env[`E2E_CLOUD_PRO_PASSWORD${suffix}`] ?? process.env.E2E_CLOUD_PRO_PASSWORD
|
||||
const runtimeEmail = process.env[`E2E_CLOUD_PRO_EMAIL${suffix}`]?.trim()
|
||||
const runtimePassword = process.env[`E2E_CLOUD_PRO_PASSWORD${suffix}`]?.trim()
|
||||
if (process.env.CI && (!runtimeEmail || !runtimePassword)) {
|
||||
throw new Error(`Missing E2E_CLOUD_PRO_EMAIL${suffix} or E2E_CLOUD_PRO_PASSWORD${suffix}`)
|
||||
}
|
||||
const email = runtimeEmail || process.env.E2E_CLOUD_PRO_EMAIL
|
||||
const password = runtimePassword || process.env.E2E_CLOUD_PRO_PASSWORD
|
||||
return email && password
|
||||
? {
|
||||
E2E_CLOUD_PRO_EMAIL: email,
|
||||
|
||||
Reference in New Issue
Block a user