test: use integresql for parallel integration test capability #432
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.
This pull request introduces several important changes aimed at improving the testing infrastructure by integrating IntegreSQL for database management and updating dependencies. The most significant changes are the addition of services to the CI workflow, updates to
docker-compose.test.yml, modifications topackage.json, and enhancements to test setup and configuration files.CI and Docker Configuration:
.github/workflows/ci.yml: Added PostgreSQL and IntegreSQL services to the CI workflow to ensure consistent database environments during testing.docker-compose.test.yml: Introduced a new Docker Compose file to define services for PostgreSQL and IntegreSQL, including performance tuning for local development.Package Updates:
package.json: Added new scripts for test setup, replaced@electric-sql/pglitewith@devoxa/integresql-client, and updated several dependencies including@vitest/coverage-istanbulandvitest. [1] [2] [3] [4]Test Enhancements:
src/server/modules/auth/email/__tests__/email.router.test.ts: Added a step to clear verification tokens before each test to ensure a clean state.src/server/modules/me/__tests__/me.router.test.ts: Added a new test suite for themerouter, including user session setup and a test case for retrieving user information.Integration with IntegreSQL:
tests/integration/__mocks__/prisma.ts: Mocked Prisma client to use IntegreSQL for isolated test databases.tests/integration/helpers/hooks.ts: Added helper functions for IntegreSQL client initialization and database URL generation.Vitest Configuration:
vitest.config.ts: Updated to include global setup and mock files for Prisma integration.vitest.global-setup.ts: Added a global setup script to initialize the template database with migrations before running tests.vitest.setup.ts: Removed old setup logic for PGlite and Prisma, replaced by new IntegreSQL setup.