feat(stability): unify readiness and recovery
CI - Build & Test / Backend (.NET) (push) Successful in 45s
CI - Build & Test / Backend integration (PostgreSQL/Toxiproxy) (push) Failing after 1m0s
CI - Build & Test / Frontend (Vue/TS) (push) Successful in 2m49s
CI - Build & Test / Security Check (push) Successful in 7s
CI - Build & Test / Deploy Nexus (push) Has been skipped
CI - Build & Test / Backend (.NET) (push) Successful in 45s
CI - Build & Test / Backend integration (PostgreSQL/Toxiproxy) (push) Failing after 1m0s
CI - Build & Test / Frontend (Vue/TS) (push) Successful in 2m49s
CI - Build & Test / Security Check (push) Successful in 7s
CI - Build & Test / Deploy Nexus (push) Has been skipped
This commit is contained in:
@@ -131,6 +131,33 @@ test.describe('authenticated route and deep-link smoke', () => {
|
||||
})).toBeVisible()
|
||||
|
||||
await expect.poll(() => api.openClawOverviewRequestCount).toBe(1)
|
||||
expect(api.browserTelemetryRequestCount).toBe(0)
|
||||
})
|
||||
|
||||
test('distinguishes a dependency outage and recovers without hiding the route', async ({ page }, testInfo) => {
|
||||
await mockNexusApi(page, {
|
||||
role: 'owner',
|
||||
apiFailure: {
|
||||
path: '/api/v1/projects',
|
||||
status: 503,
|
||||
// Vue Query performs two bounded retries for safe reads. The visible
|
||||
// recovery action is the next, explicit request.
|
||||
attempts: 3,
|
||||
},
|
||||
})
|
||||
|
||||
await page.goto('/projects')
|
||||
const recovery = page.locator('[data-state="offline"][data-problem-kind="offline"]')
|
||||
await expect(recovery).toBeVisible()
|
||||
await expect(recovery).toContainText('Abhängigkeit nicht erreichbar')
|
||||
await page.screenshot({
|
||||
path: testInfo.outputPath('dependency-recovery.png'),
|
||||
fullPage: true,
|
||||
})
|
||||
await recovery.getByRole('button', { name: 'Erneut prüfen' }).click()
|
||||
|
||||
await expect(page.getByRole('link', { name: /Release Readiness/ })).toBeVisible()
|
||||
await expect(recovery).toHaveCount(0)
|
||||
})
|
||||
|
||||
test('keeps Iris and run mutation entry points unavailable to non-owners', async ({ page }) => {
|
||||
|
||||
@@ -23,6 +23,11 @@ interface MockOptions {
|
||||
domainResyncSequence?: number
|
||||
boardRefreshDelayMs?: number
|
||||
boardRefreshTitle?: string
|
||||
apiFailure?: {
|
||||
path: string
|
||||
status: number
|
||||
attempts?: number
|
||||
}
|
||||
}
|
||||
|
||||
interface CapturedRequest {
|
||||
@@ -40,6 +45,7 @@ export interface NexusApiHarness {
|
||||
readonly chatRequests: CapturedRequest[]
|
||||
readonly resyncResponseCount: number
|
||||
readonly openClawOverviewRequestCount: number
|
||||
readonly browserTelemetryRequestCount: number
|
||||
readonly proposal: Record<string, unknown>
|
||||
}
|
||||
|
||||
@@ -453,6 +459,8 @@ export async function mockNexusApi(
|
||||
let resyncResponseCount = 0
|
||||
let boardInitialRequestCount = 0
|
||||
let openClawOverviewRequestCount = 0
|
||||
let browserTelemetryRequestCount = 0
|
||||
let injectedFailureCount = 0
|
||||
let openTaskState = 'Backlog'
|
||||
|
||||
await page.route('**/api/**', async route => {
|
||||
@@ -469,6 +477,23 @@ export async function mockNexusApi(
|
||||
return
|
||||
}
|
||||
|
||||
if (
|
||||
options.apiFailure
|
||||
&& path === options.apiFailure.path
|
||||
&& injectedFailureCount < (options.apiFailure.attempts ?? 1)
|
||||
) {
|
||||
injectedFailureCount += 1
|
||||
await fulfillJson(
|
||||
route,
|
||||
problem(
|
||||
'The requested Nexus dependency is temporarily unavailable.',
|
||||
options.apiFailure.status,
|
||||
),
|
||||
options.apiFailure.status,
|
||||
)
|
||||
return
|
||||
}
|
||||
|
||||
if (path === '/api/v1/auth/refresh' && method === 'POST') {
|
||||
if (!authenticated) {
|
||||
await fulfillJson(route, problem('No active E2E session.', 401), 401)
|
||||
@@ -861,6 +886,7 @@ export async function mockNexusApi(
|
||||
return
|
||||
}
|
||||
if (path === '/api/v1/telemetry/browser') {
|
||||
browserTelemetryRequestCount += 1
|
||||
await route.fulfill({ status: 202 })
|
||||
return
|
||||
}
|
||||
@@ -1192,6 +1218,9 @@ export async function mockNexusApi(
|
||||
get openClawOverviewRequestCount() {
|
||||
return openClawOverviewRequestCount
|
||||
},
|
||||
get browserTelemetryRequestCount() {
|
||||
return browserTelemetryRequestCount
|
||||
},
|
||||
get proposal() {
|
||||
return proposal
|
||||
},
|
||||
|
||||
Reference in New Issue
Block a user