Fix CI env loading and flaky API token regeneration test - #4
Open
syyspe wants to merge 1 commit into
Open
Conversation
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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #3.
drizzle-kit pushandnext devboth pick.env.testvs.env.localbased onprocess.env.NODE_ENV, but the workflow only wroteNODE_ENVinto the generated.env.testfile 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 emptyDATABASE_URL. SettingNODE_ENV: testat the job level fixes both the migration step and the Playwright-driven dev server.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.