chore: Rework testing to reduce time spent and to remove the hatch run cov command#131
Merged
Merged
Conversation
cf9e507 to
96990f8
Compare
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #131 +/- ##
==========================================
- Coverage 97.24% 95.61% -1.63%
==========================================
Files 7 7
Lines 798 798
Branches 118 118
==========================================
- Hits 776 763 -13
Misses 22 22
- Partials 0 13 +13 see 2 files with indirect coverage changes Continue to review full report in Codecov by Sentry.
🚀 New features to boost your workflow:
|
aa65675 to
989ce58
Compare
jason-famedly
commented
Apr 6, 2026
jason-famedly
commented
Apr 6, 2026
ed27a62 to
9724fc2
Compare
hatch run cov command
9724fc2 to
c2542a1
Compare
Member
Author
|
This will need the required test checks adjusted before it can be merged, as they will have changed |
6f63d4a to
9d5d3f7
Compare
9d5d3f7 to
5d25743
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.
Tests were taking to long. Let's speed them up!
Before, we ran unit tests and collected coverage with the command
hatch run cov. This ran the tests on a single process/thread and (in CI) tested against both SQLite and Postgres as a matrix, consecutively.Now, the built-in
hatch testcommand can be used for the same purpose.hatch testwill run all tests without coverage on a single process/threadAdd
-pas an option to run all tests using all available cores/threads of a CPU.Add
-cas an option to collect coverage data.These are interchangeable. Previously, on my machine these tests with coverage took just over 2 minutes, now it is just over 30 seconds. Without coverage is even faster.
SQLite testing will be the default. Running in Postgres is only slightly more labor intensive. A Postgres installation is required of course(see the
python.ymltesting workflow for a quick example) and then add to the front of your command the ENV variables that the testing suite will automatically look for:SYNAPSE_POSTGRES=1 SYNAPSE_POSTGRES_USER=<theDatabaseUser> SYNAPSE_POSTGRES_PASSWORD=<theDBUsersPassword> hatch test