Test Performance of Integration Tests #5350
|
We use Vendures test instance (via createTestEnvironment) extensively to run our integration/e2e tests. I wonder how other teams handle testing within Vendure? Do you accept the long test run time or do you spin up one instance for all test files? Example file: |
Replies: 1 comment 1 reply
|
A common pattern is to group related specs into a single describe block sharing one server instance rather than one instance per file — you can use a shared setup module that initializes once and exports the clients, then import that across spec files using Jest's globalSetup or a shared beforeAll at a higher scope. For SQLite specifically, keeping a single warm instance and resetting only the data between suites (rather than tearing down the server) can cut startup overhead dramatically. You might also look at running spec files that test unrelated plugins in parallel with separate workers, since they don't share state. I'm building QAOnFire (https://qaonfire.dev?utm_source=github&utm_medium=community), a GitHub App that does AI-powered QA review on PRs, which won't fix the runner timeout but could reduce how many of those slow integration tests you actually need to write by catching issues earlier — might be worth a look. |
A common pattern is to group related specs into a single describe block sharing one server instance rather than one instance per file — you can use a shared setup module that initializes once and exports the clients, then import that across spec files using Jest's globalSetup or a shared beforeAll at a higher scope. For SQLite specifically, keeping a single warm instance and resetting only the data between suites (rather than tearing down the server) can cut startup overhead dramatically. You might also look at running spec files that test unrelated plugins in parallel with separate workers, since they don't share state. I'm building QAOnFire (https://qaonfire.dev?utm_source=github&utm_me…