test: Drop duplicate Spring tests using non-H2 Gradle tasks #1947
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.
Currently, both
spring-transaction
andexposed-spring-boot-starter
modules are set up to not be database-specific, but to only test how Exposed generally integrates with Spring.This means that all unit tests use an embedded H2 database and that these test classes do not extend
DatabaseTestsBase()
.In spite of this, all Spring tests are run by every Gradle test task, resulting in multiple H2 duplicate tests when task
test
or TC build is run.Duplicates can be confirmed by:
Transaction.db.vendor
orTransaction.db.dialect
in any test while running a non-H2 test task:exec("SELECT version();")
should work when included in any test run withtestPostgres
, but instead this is thrown:org.h2.jdbc.JdbcSQLSyntaxErrorException: Function "VERSION" not found
Excluding tests in the Spring packages confirmed locally and on TC build.
![springtx_before_small](https://private-user-images.githubusercontent.com/82039410/291111119-cb1cca9f-804a-4f21-b44f-bea9376227bc.jpg?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3Mzk1Mzg2ODcsIm5iZiI6MTczOTUzODM4NywicGF0aCI6Ii84MjAzOTQxMC8yOTExMTExMTktY2IxY2NhOWYtODA0YS00ZjIxLWI0NGYtYmVhOTM3NjIyN2JjLmpwZz9YLUFtei1BbGdvcml0aG09QVdTNC1ITUFDLVNIQTI1NiZYLUFtei1DcmVkZW50aWFsPUFLSUFWQ09EWUxTQTUzUFFLNFpBJTJGMjAyNTAyMTQlMkZ1cy1lYXN0LTElMkZzMyUyRmF3czRfcmVxdWVzdCZYLUFtei1EYXRlPTIwMjUwMjE0VDEzMDYyN1omWC1BbXotRXhwaXJlcz0zMDAmWC1BbXotU2lnbmF0dXJlPTEwMTMxZjI0MTUyZGE1NDY1OTA3OTMwMDk1MDdiZGY1NzdkOTgyYTJkZGMzNzlkZDQ4Zjg5OGQwNDAzNTNkNjImWC1BbXotU2lnbmVkSGVhZGVycz1ob3N0In0.6tuQgWmVmoJQYUszX_VDXwZ-AR8A49Ru80h_-On4wk0)
The total number of tests is still somehow 10071 but the only tasks with tests is
testH2
and build time dropped from 37-40 minutes to 32-35 minutes.Example before:
Example after:
![springtx_after_small](https://private-user-images.githubusercontent.com/82039410/291111307-7bb67bf1-7c45-4203-a29a-2c1b9249cca5.jpg?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3Mzk1Mzg2ODcsIm5iZiI6MTczOTUzODM4NywicGF0aCI6Ii84MjAzOTQxMC8yOTExMTEzMDctN2JiNjdiZjEtN2M0NS00MjAzLWEyOWEtMmMxYjkyNDljY2E1LmpwZz9YLUFtei1BbGdvcml0aG09QVdTNC1ITUFDLVNIQTI1NiZYLUFtei1DcmVkZW50aWFsPUFLSUFWQ09EWUxTQTUzUFFLNFpBJTJGMjAyNTAyMTQlMkZ1cy1lYXN0LTElMkZzMyUyRmF3czRfcmVxdWVzdCZYLUFtei1EYXRlPTIwMjUwMjE0VDEzMDYyN1omWC1BbXotRXhwaXJlcz0zMDAmWC1BbXotU2lnbmF0dXJlPWJkNjdjNmFlZWY1NTdmMDlhODAzM2I4OTRlZGIyODQ0ZmU1YWMzNTYyMjkwMmI0MDNhMzhmYzgzN2FhNTEwZDQmWC1BbXotU2lnbmVkSGVhZGVycz1ob3N0In0.1ZaOe2RPTMCQI3ExkMvtYhUCKq-Lvgq64FFLm4RzzuQ)