Use fixtures to speed up database tests#163
Merged
Merged
Conversation
6448215 to
8a8d356
Compare
Contributor
Author
|
The last commit also adds test reports in GitHub actions so that it's easy to see all the test results in the summary of the action run. For example: https://github.com/jbogard/Respawn/actions/runs/21113310127?pr=163 |
Using a fixture creates and starts a single container per test class instead of creating and starting one container per test. Comparison of execution times on a MacBook Pro M2 Max. DB2Tests: from about 1 hour to 6 minutes MySqlTests: from 2 minutes down to 15 seconds PostgresTests: from 45 seconds down to 6 seconds SqlServerTests: from over 3 minutes down to 30 seconds Note that two Informix tests are already failing with a DB2Exception, even before introducing the fixture (ShouldExcludeSchemas + ShouldIncludeSchemas) > IBM.Data.Db2.DB2Exception > ERROR [IX000] [IBM][IDS/UNIX64] User (a) was not found.
8a8d356 to
dea3219
Compare
Still skipping on CI because it fails with "No space left on device"
dea3219 to
b1f6985
Compare
jbogard
approved these changes
Jan 19, 2026
Owner
|
Thanks! Yeah I don't know what's going on with those Informix tests. It was contributed externally so no idea. |
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.

Using a fixture creates and starts a single container per test class instead of creating and starting one container per test.
Comparison of execution times on a MacBook Pro M2 Max.
DB2Tests: from about 1 hour to 6 minutes
MySqlTests: from 2 minutes down to 15 seconds
PostgresTests: from 45 seconds down to 6 seconds
SqlServerTests: from over 3 minutes down to 30 seconds
Note that two Informix tests are already failing with a DB2Exception, even before introducing the fixture (ShouldExcludeSchemas + ShouldIncludeSchemas)