fix: add database seed step to frontend-tests CI job - #16
Merged
Christopher Harrison (GeekTrainer) merged 4 commits intoMar 11, 2026
Merged
Conversation
The frontend E2E tests fail in CI because the database is not populated. The *.db files are gitignored, so the SQLite database doesn't exist in CI. This adds a step to run seed_database.py after environment setup and before Playwright tests, ensuring the API returns data during E2E test runs. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Set working-directory to ./server so Python can resolve 'from models import ...' the same way the test scripts do (by having server/ as CWD). Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Instead of a separate seed step in CI, call seed_database() in app.py on startup. The seed function is idempotent so it's safe to call every time. This means the database is always populated when the Flask server starts, whether in CI, local dev, or any other environment. Also simplify the frontend-tests job to use the existing run-e2e-tests.sh script, which already handles setup via Playwright's webServer config. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Playwright browsers must be installed after npm ci, otherwise @playwright/test package is not found. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
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.
Description
Frontend E2E tests have been consistently failing in CI because the SQLite database is never populated. The
*.dbfiles are gitignored, sodata/tailspin-toys.dbdoesn't exist in CI runners. Without data, the Flask API returns 404s/empty responses, causing 17 of 28 E2E tests to fail.Closes #15
Type of Change
Changes Made
frontend-testsjob in.github/workflows/run-tests.ymlserver/utils/seed_database.pyafter environment setup and before Playwright testsTesting
Backend Changes
./scripts/run-server-tests.sh- all 24 tests passFrontend Changes
Checklist
Additional Notes
This is a pre-existing issue affecting all runs on
main, not specific to any PR. Every recent workflow run shows the same 17-test failure pattern.