3 ms·
Here is another thing worth sharing. Database integration tests on Bazel used to be difficult. Ultimately I've found an elegant solution: https://github.com/di
by marvin-hansen 2y ago
Here is another thing worth sharing. Database integration tests on Bazel used to be difficult. Ultimately I've found an elegant solution:
https://github.com/diesel-rs/diesel/blob/master/examples/postgres/custom_arrays/README.md https://github.com/diesel-rs/diesel/blob/master/examples/pos...
The parallel testing with dangling transactions isn't Diesel or Postgres specific. You can do the same with pure SQL and any relational DB that supports transactions.
For CI, BuildBuddy can spin up Docker in a remote execution host, then you write a custom util that tests if the DB container is already running and if not starts one, out that in a test and then let Bazel execute all integration tests in parallel. For some weird reasons, all tests have to be in one file per insolated remote execution host, so I created one per table.
Incremental builds that compile, tests, build and publish images usually complete in about one minute. That's thanks to the 80 Core BuildBuddy cluster with remote cache.
GitHub took about an hour back in April when the repo was half in size.
There is real gain in terms of developer velocity.