infra: add vitest workspaces and TestContainer#1478
Conversation
… and improve timeout handling
|
🤯 I need more time and energy to review a 95 file changes 😆 Is it possible to split the However I will try to run GitHub Copilot Review against this PR for now. Maybe it can help already a bit. |
|
@brenoepics looks like Copilot has the same energy as I have right now 🤣 |
No worries and yeah, I can separate it, most of the changes are log snapshots since they were all local before so I generated snapshots for pg |
|
... @brenoepics I'm a bit sorry to ask for that..., but could you for now just move the One of the things is also that the |
Yeah, I agree that way would be better, those real config tests stay via actions and non config related integration tests go to containers so we can run locally.
I think it still works, since I kept the |
Oh, I see, because the tests just moved from |
|
@brenoepics please delete the snapshots and regenerate them. That will delete a lot of stale snapshot files and make the file changes finally smaller. |
|
@brenoepics updated the PR with my preferences you got me wrong about the snapshot files 🥲 so please bring back the snapshot check for the successful stdout with the related pg-version
accordingly we can store the error logs in
|
|
I think |
except for pg-17 -> #1478 (comment) |
|
|
😮 you talked about |
Co-authored-by: Copilot <[email protected]>
Co-authored-by: Copilot <[email protected]>
Co-authored-by: Copilot <[email protected]>
Co-authored-by: Copilot <[email protected]>
There was a problem hiding this comment.
Pull Request Overview
This PR introduces Vitest workspaces and TestContainer setup for improved integration testing infrastructure. It replaces the existing GitHub Actions PostgreSQL service-based testing with a containerized approach that supports testing against multiple PostgreSQL versions locally and in CI.
- Migrates from spawnSync-based integration tests to TestContainer-powered tests using real PostgreSQL instances
- Adds comprehensive database cleanup utilities for test isolation
- Implements configurable PostgreSQL version testing through environment variables
Reviewed Changes
Copilot reviewed 6 out of 20 changed files in this pull request and generated 5 comments.
Show a summary per file
| File | Description |
|---|---|
| test/integration/utils.ts | New utility module providing TestContainer setup, database cleanup, and test configuration helpers |
| test/integration/db-config-it.spec.ts | Replaces db-config.spec.ts with TestContainer-based integration tests that run against multiple PostgreSQL versions |
| test/integration/db-config.spec.ts | Removed old spawnSync-based integration test file |
| package.json | Added @testcontainers/postgresql and testcontainers dependencies for containerized testing |
| .github/workflows/postgres-test.yml | Removed old PostgreSQL service-based test job in favor of TestContainer approach |
| .github/workflows/ci.yml | Added PGM_VERSIONS environment variable to configure PostgreSQL versions for CI testing |
Files not reviewed (1)
- pnpm-lock.yaml: Language not supported
Follow up on #1390
Locally, it will run on pg 17 only (you can set environment variables), but it is quick enough to run everything locally, taking about 56 seconds to run 5 pg versions.
running all versions
running
preflightwith pg 17 only