test: separate integration tests to their own gradle task
See original GitHub issueSome tests are slow and flaky and not safe to run in parallel. We’ve added tags to these tests and would like to use them to define a separate test run.
We have TteTest
and MteTest
tags for these tests. The remainder of the tests (hopefully less slow and flaky) remain untagged. We will be treating TteTest
and MteTest
as equivalent for this new test task.
We need one gradle task (possibly the default test
task?) that excludes tests with either of these tags,
and one gradle task that includes only tests with either of these tags.
This needs to be done for
-
engine
and/orengine-test
projects in the main repo - modules, which are configured by
terasology-module
underbuild-logic
engine-tests/build.gradle
is probably the easiest place to start.
References
Terasology tests are written using JUnit 5 and run with the JUnit Platform.
Naming Questions
- Should we make new tasks for “tests with MTE” and “tests without MTE”, and keep
test
in its current behavior of running all JUnit tests? Or should we change the defaulttest
task to be the “without MTE” one? - What should the “tests with MTE” task be named? Could be less specific than “MTE” to include other implementations in this category.
integrationTest
,simulationTest
,flakyTest
?
Issue Analytics
- State:
- Created 2 years ago
- Comments:5 (5 by maintainers)
Top Results From Across the Web
Separate Gradle Tasks for Unit and Integration Tests - Inspeerity
Since now you can move all your integration tests to proper folder, and all of them will have all dependencies which are defined...
Read more >Running integration tests in Gradle - Tom Gregory
This separates the integration tests from unit tests, making the project easier to understand and helping developers to work more productively.
Read more >How to create a Gradle Task to run only a specific Tests in ...
I would suggest separating integration tests into separate source set. By default you already have 2 source sets, one for production code ...
Read more >Testing in Java & JVM projects - Gradle User Manual
Gradle executes tests in a separate ('forked') JVM, isolated from the main build process. This prevents classpath pollution and excessive memory consumption for ......
Read more >Running Integration Tests With Gradle - Test With Spring Course
We can add custom test sets into our Gradle build by using the Gradle TestSets plugin. · The Gradle TestSets plugin creates dependency ......
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Oh I was already thinking about the stages in Jenkins when I said we want to have (only) those two separate ones. I would expect
gradlew test
to still run all of them.@keturn Thank you for writing this up 👍 and @mahela97 thank you for volunteering to implement this 👍
I believe we don’t want to keep
test
in its current behavior of running all tests, but have two new tasks, one for the tagged tests, one for the non-tagged tests. I’d suggest going for the following naming:IMO this makes sense because of the following expectations: Proper unittests are expected to be many, but small in scope (testing a small aspect of the code), fast-running and parallelizable. Integration tests (including end-to-end (E2E) and scenario tests as well as tests combining a few units) on the contrary are expected to be fewer, but bigger in scope, slower-running and likely not parallelizable.
While it’s possible that currently, our non-tagged (neither MTE nor TTE) tests are not pure unit tests but could also be categorized as integration tests, they are expected to be a lot quicker than MTE and TTE tests. If they turn out not to be, we can think about tagging them as well and grouping them with the MTE and TTE tests.