Skip to content

Commit 4feb7ec

Browse files
committed
Fix testIgnore blocking audit pack; use env var gate instead
Playwright's testIgnore applies even when files are passed as explicit CLI arguments, so the npm script always found zero tests. Replace with TASKDECK_RUN_AUDIT env var gate on each describe block (matching the existing stakeholder-demo and live-llm patterns). The npm script sets the env var automatically via a cross-platform node wrapper. Also reverts CRLF line-ending noise in playwright.config.ts and updates MANUAL_AUDIT_PACK.md to reflect the actual CI exclusion mechanism.
1 parent 653643f commit 4feb7ec

4 files changed

Lines changed: 34 additions & 26 deletions

File tree

docs/testing/MANUAL_AUDIT_PACK.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@ Screenshots are saved as `01-home.png`, `02-inbox-with-capture.png`, etc. in the
6464

6565
## CI Exclusion
6666

67-
The `manual-audit.spec.ts` file is listed in `playwright.config.ts` under `testIgnore`, so `npm run test:e2e` (the default CI command) skips it. The dedicated `npm run test:e2e:audit:headed` script explicitly targets the file, bypassing `testIgnore`.
67+
All tests in `manual-audit.spec.ts` are gated behind `TASKDECK_RUN_AUDIT=1`. When `npm run test:e2e` runs in CI, the env var is unset and all audit tests are skipped. The dedicated `npm run test:e2e:audit:headed` script sets the env var automatically.
6868

6969
## Configuration
7070

frontend/taskdeck-web/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@
2323
"test:ui": "vitest --ui",
2424
"test:coverage": "node -e \"require('fs').mkdirSync('test-results',{recursive:true})\" && vitest run --coverage --reporter=default --reporter=junit --outputFile.junit=./test-results/vitest.coverage.junit.xml",
2525
"test:e2e": "playwright test",
26-
"test:e2e:audit:headed": "playwright test tests/e2e/manual-audit.spec.ts --headed --reporter=line",
26+
"test:e2e:audit:headed": "node -e \"process.env.TASKDECK_RUN_AUDIT='1';require('child_process').execSync('npx playwright test tests/e2e/manual-audit.spec.ts --headed --reporter=line',{stdio:'inherit',env:process.env})\"",
2727
"test:e2e:concurrency": "playwright test tests/e2e/concurrency.spec.ts --reporter=line",
2828
"test:e2e:live-llm:headed": "playwright test tests/e2e/live-llm.spec.ts --headed --reporter=line",
2929
"test:e2e:headed": "playwright test --headed"

frontend/taskdeck-web/playwright.config.ts

Lines changed: 23 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,21 @@
11
import { defineConfig } from '@playwright/test'
2-
import {
3-
buildHttpOrigin,
4-
defaultFrontendHost,
5-
defaultFrontendPort,
6-
parseFrontendHost,
7-
resolveDefaultFrontendPort,
8-
} from './playwright.port-resolution'
9-
import { resolveDemoBackendLlmEnv, resolvePlaywrightBackendLlmEnv } from './playwright.demo-llm'
10-
import { resolveReuseExistingServer } from './playwright.server-reuse'
11-
12-
const e2eDbPath = process.env.TASKDECK_E2E_DB ?? 'taskdeck.e2e.db'
13-
const defaultApiBaseUrl = 'http://localhost:5000/api'
14-
const demoBackendLlmEnv = resolveDemoBackendLlmEnv(process.env)
15-
const backendLlmEnv = resolvePlaywrightBackendLlmEnv(process.env)
16-
const reuseExistingServer = resolveReuseExistingServer(process.env, {
17-
requiresFreshServer: Object.keys(demoBackendLlmEnv).length > 0,
18-
})
2+
import {
3+
buildHttpOrigin,
4+
defaultFrontendHost,
5+
defaultFrontendPort,
6+
parseFrontendHost,
7+
resolveDefaultFrontendPort,
8+
} from './playwright.port-resolution'
9+
import { resolveDemoBackendLlmEnv, resolvePlaywrightBackendLlmEnv } from './playwright.demo-llm'
10+
import { resolveReuseExistingServer } from './playwright.server-reuse'
11+
12+
const e2eDbPath = process.env.TASKDECK_E2E_DB ?? 'taskdeck.e2e.db'
13+
const defaultApiBaseUrl = 'http://localhost:5000/api'
14+
const demoBackendLlmEnv = resolveDemoBackendLlmEnv(process.env)
15+
const backendLlmEnv = resolvePlaywrightBackendLlmEnv(process.env)
16+
const reuseExistingServer = resolveReuseExistingServer(process.env, {
17+
requiresFreshServer: Object.keys(demoBackendLlmEnv).length > 0,
18+
})
1919

2020
const frontendConfig = resolveFrontendConfig()
2121
const frontendHost = frontendConfig.host
@@ -28,20 +28,19 @@ const backendCorsOrigins = resolveBackendCorsOrigins(
2828
frontendConfig.origin,
2929
process.env.TASKDECK_E2E_API_CORS_ORIGINS,
3030
)
31-
const backendServerEnv: Record<string, string> = {
32-
ASPNETCORE_ENVIRONMENT: 'Development',
33-
ConnectionStrings__DefaultConnection: `Data Source=${e2eDbPath}`,
34-
ASPNETCORE_URLS: apiConfig.origin,
35-
...backendLlmEnv,
36-
}
31+
const backendServerEnv: Record<string, string> = {
32+
ASPNETCORE_ENVIRONMENT: 'Development',
33+
ConnectionStrings__DefaultConnection: `Data Source=${e2eDbPath}`,
34+
ASPNETCORE_URLS: apiConfig.origin,
35+
...backendLlmEnv,
36+
}
3737

3838
for (const [index, origin] of backendCorsOrigins.entries()) {
3939
backendServerEnv[`Cors__DevelopmentAllowedOrigins__${index}`] = origin
4040
}
4141

4242
export default defineConfig({
4343
testDir: './tests/e2e',
44-
testIgnore: ['**/manual-audit.spec.ts'],
4544
forbidOnly: !!process.env.CI,
4645
fullyParallel: false,
4746
workers: process.env.CI ? 1 : undefined,

frontend/taskdeck-web/tests/e2e/manual-audit.spec.ts

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,9 @@
1313
*
1414
* This pack is NOT part of required CI. It is intended for local operator audits,
1515
* pre-release sanity checks, and visual debugging sessions.
16+
*
17+
* Gated behind TASKDECK_RUN_AUDIT=1. The npm script sets this automatically:
18+
* npm run test:e2e:audit:headed
1619
*/
1720

1821
import { expect, test } from '@playwright/test'
@@ -26,6 +29,8 @@ import {
2629
waitForProposalCreated,
2730
} from './support/captureFlow'
2831

32+
const runAudit = parseTrueishEnv(process.env.TASKDECK_RUN_AUDIT)
33+
2934
test.use({
3035
screenshot: 'on',
3136
trace: 'retain-on-failure',
@@ -41,6 +46,7 @@ test.beforeEach(async ({ page, request }) => {
4146
})
4247

4348
test.describe('Core loop: Home -> Inbox/Capture -> Review -> Board', () => {
49+
test.skip(!runAudit, 'Set TASKDECK_RUN_AUDIT=1 or use npm run test:e2e:audit:headed')
4450
test('full capture-triage-review-apply loop with screenshots', async ({ page, request }, testInfo) => {
4551
// Step 1: Home landing
4652
await page.goto('/workspace/home')
@@ -131,6 +137,8 @@ test.describe('Core loop: Home -> Inbox/Capture -> Review -> Board', () => {
131137
})
132138

133139
test.describe('Advanced checks', () => {
140+
test.skip(!runAudit, 'Set TASKDECK_RUN_AUDIT=1 or use npm run test:e2e:audit:headed')
141+
134142
test('command palette search navigates to inbox', async ({ page }, testInfo) => {
135143
await page.goto('/workspace/boards')
136144
await expect(page.getByRole('button', { name: '+ New Board' })).toBeVisible()
@@ -218,6 +226,7 @@ test.describe('Advanced checks', () => {
218226
})
219227

220228
test.describe('Live LLM provider probe', () => {
229+
test.skip(!runAudit, 'Set TASKDECK_RUN_AUDIT=1 or use npm run test:e2e:audit:headed')
221230
test.skip(
222231
!parseTrueishEnv(process.env.TASKDECK_RUN_LIVE_LLM_TESTS),
223232
'Set TASKDECK_RUN_LIVE_LLM_TESTS=1 to run the opt-in live-provider probe.',

0 commit comments

Comments
 (0)