test(node-integration-tests): Reuse Docker Compose containers across tests#22128
Open
mydea wants to merge 10 commits into
Open
test(node-integration-tests): Reuse Docker Compose containers across tests#22128mydea wants to merge 10 commits into
mydea wants to merge 10 commits into
Conversation
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes and found 3 potential issues.
❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.
Reviewed by Cursor Bugbot for commit d5ba5d2. Configure here.
This reverts commit 5a918d9.
acc254b to
9ab3366
Compare
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.

Speeds up the Docker-backed
node-integration-testssuites by bringing each Compose service up once per suite instead of once per test, and by removing redundant per-test setup work.describeWithDockerComposePreviously every test spun its own container up and down via
runner.withDockerCompose(...), so a suite with N tests paid N × (docker compose down+up --waithealthcheck) — the dominant cost of these suites. The newdescribeWithDockerCompose(name, { workingDirectory }, () => { ... })wrapper starts the container in a singlebeforeAlland tears it down once inafterAll; the inner tests no longer callwithDockerCompose()themselves.withDockerCompose()(and the now-unusedDockerOptions.setupCommand) has been removed fromcreateRunner.Migrated suites: amqplib, ioredis-dc, kafkajs, knex (mysql2/pg), mysql2, mysql2-tracing-channel, postgres, postgres-streamed, postgresjs, prisma v5/v6/v7, redis, redis-cache, redis-dc, tedious.
Prisma: stop running
prisma generate/migrateon every testmigrate→ Postgres init script. Each Prismadocker-compose.ymlnow bind-mounts the committedmigration.sqlinto/docker-entrypoint-initdb.d/, so the schema is created on container init. The runtimeprisma migrate devstep is gone entirely.generate→ once per suite. NewafterSetupCommandoption oncreateEsmAndCjsTests'CommonTestOptionsruns a command once in the tmp dir afteradditionalDependenciesare installed (withnode_modules/.binon PATH). The Prisma suites use it forprisma generate(v7 also runstsc), instead of running it inside the per-test Docker setup command.Flaky tests fixed
These Docker-backed suites flaked with an opaque
Test timed out: on the previous per-test model,docker compose up --wait(DB healthcheck / cold start — slowest for MSSQL) ran inside the per-test timeout, so on a loaded runner the budget was exhausted before the scenario could emit its envelope. Moving Docker startup intobeforeAllremoves it from the per-test budget, fixing the whole class.Fixes #22122
Fixes #22117
Fixes #22114
Fixes #22109
Fixes #22110
Fixes #22082
Fixes #22135
Fixes #22078
Fixes #22031
Fixes #22030
Fixes #21698
Fixes #21724
Other test changes
Some tests needed adjustments to make sure we drop tables that have been created again (as multiple tests share a DB instance now). While at this I also hardended the tests a bit by using random emails instead of fixed ones - this alone is not enough because we also check the table creation spans, but IMHO that is fine either way (we could revisit this later).
🤖 Generated with Claude Code