Skip to content

Commit 11dd7bb

Browse files
committed
fix(qa): set build/e2e env and skip chat-assistant without AI key
1 parent 2a37a42 commit 11dd7bb

File tree

3 files changed

+16
-3
lines changed

3 files changed

+16
-3
lines changed

apps/web/e2e/chat-assistant.spec.ts

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,14 @@ test.describe('Chat Assistant', () => {
5151
test.skip(true, `Ollama/AI upstream unreachable: ${errorText.slice(0, 80)}`)
5252
return
5353
}
54+
if (
55+
/No AI provider configured|Set ANTHROPIC_API_KEY|OPEN_ROUTER_API_KEY|OLLAMA_BASE_URL/i.test(
56+
errorText,
57+
)
58+
) {
59+
test.skip(true, 'AI provider not configured (skip without API key)')
60+
return
61+
}
5462
}
5563
await expect(chatError, `Chat failed: ${errorText || '(no error text)'}`).not.toBeVisible()
5664
await expect(assistantLoc).toBeVisible({ timeout: 60_000 })

scripts/run-e2e.mjs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,7 @@ function run(cmd, args, opts = {}) {
3131
}
3232

3333
async function main() {
34+
process.env.JWT_SECRET = process.env.JWT_SECRET ?? 'e2e-jwt-secret-min-32-chars-for-tests'
3435
killPorts()
3536
await run('pnpm', ['-F', '@repo/api', 'test:e2e:local'])
3637
killPorts()

scripts/run-qa.mjs

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,9 +11,13 @@ import { fileURLToPath } from 'node:url'
1111
const scriptDir = dirname(fileURLToPath(import.meta.url))
1212
const repoRoot = dirname(scriptDir)
1313

14-
const qaBuildEnv = process.env.JWT_SECRET
15-
? undefined
16-
: { JWT_SECRET: 'qa-build-placeholder-min-32-chars-to-pass-validation' }
14+
const qaBuildEnv = {
15+
...(process.env.JWT_SECRET
16+
? {}
17+
: { JWT_SECRET: 'qa-build-placeholder-min-32-chars-to-pass-validation' }),
18+
PGLITE: process.env.PGLITE ?? 'true',
19+
DATABASE_URL: process.env.DATABASE_URL ?? 'postgresql://localhost/test',
20+
}
1721

1822
const skipTests = process.env.QA_SKIP_TESTS === '1' || process.env.QA_SKIP_TESTS === 'true'
1923

0 commit comments

Comments
 (0)