test: use testcontainers#1390
Conversation
7606c5c to
bacd2cb
Compare
bacd2cb to
f5731dc
Compare
|
I'm not fully happy with this |
|
Yeah I feel the same about #1424, probably gonna make a new PR with something better. I took a look at this one and right now it creates a new container for every single test case. Feels like overkill, right? Can’t we make something that just spins up one container, takes a DB snapshot in a This original PR stats were: After the container changes: So yeah, way faster, but I still wanna dig deeper since I’m more used to Java testing and mocking. The thing is even with this improvement we’re still spawning child processes for each test which definitely adds some overhead. Plus every time we spawn the container stuff adds to that too. There are some Also because of the way we do things with child processes we can’t really mock files properly which is another reason I was thinking of moving the code out of the |
|
The biggest "problem" is that the integration tests are especially running for each supported postgres version in parallel for local container testing I think only the latest postgres is important, but then we would need to define a flag or mode to optionally run other versions and in GitHub actions the full suite runs again in parallel |
TODOs:
use memfs for virtual file mocking (https://vitest.dev/guide/mocking.html#file-system)execand running commands in a new context, therefore loosing thevi.mockThoughts:
Right now the tests are taking roughly 2min. Maybe we should only integration test the latest postgres locally and stay with the GitHub CI strategy as before.