Skip to content

Fix CI env loading and flaky API token regeneration test - #4

Open
syyspe wants to merge 1 commit into
fullstack-hy2020:mainfrom
syyspe:fix/ci-node-env-and-flaky-token-test
Open

Fix CI env loading and flaky API token regeneration test#4
syyspe wants to merge 1 commit into
fullstack-hy2020:mainfrom
syyspe:fix/ci-node-env-and-flaky-token-test

Conversation

@syyspe

@syyspe syyspe commented Aug 13, 2026

Copy link
Copy Markdown

Fixes #3.

  • drizzle-kit push and next dev both pick .env.test vs .env.local based on process.env.NODE_ENV, but the workflow only wrote NODE_ENV into the generated .env.test file itself — too late to affect that choice, since the file is only read after the decision of which file to read is made. Migrations then ran against an empty DATABASE_URL. Setting NODE_ENV: test at the job level fixes both the migration step and the Playwright-driven dev server.
  • Replaced the fixed 500ms wait in "can regenerate API token" with an auto-retrying assertion (expect(...).not.toHaveText(...)), since the server action + revalidate round trip can exceed 500ms on slower CI runners, causing the test to read the token before the UI updates.

Both issues were found while debugging CI failures on a student submission that otherwise passed locally.

drizzle-kit push and next dev both select .env.test vs .env.local
based on process.env.NODE_ENV, but the workflow only wrote NODE_ENV
into the generated .env.test file, which is too late to affect that
choice. Migrations then ran against an empty DATABASE_URL. Setting
NODE_ENV: test at the job level fixes both the migration step and
the Playwright-driven dev server.

Also replaced the fixed 500ms wait in "can regenerate API token"
with an auto-retrying assertion, since the server action + revalidate
round trip can exceed 500ms on slower CI runners, causing the test to
read the token before the UI updates.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Too little time for regenerating API token test

1 participant