Setup Gradle functional tests#4074
Conversation
Codecov Report
@@ Coverage Diff @@
## main #4074 +/- ##
===========================================
+ Coverage 0 84.27% +84.27%
- Complexity 0 3249 +3249
===========================================
Files 0 471 +471
Lines 0 10261 +10261
Branches 0 1805 +1805
===========================================
+ Hits 0 8647 +8647
- Misses 0 664 +664
- Partials 0 950 +950
Continue to review full report at Codecov.
|
|
IntelliJ IDE does not really like addition test source set like I am thinking if we should start experimenting with extracting integration tests into a separate module as discussed in #3324 (comment). |
I'm not seeing that - which IDE specifically (IntelliJ, Android Studio) & which version? Can you try deleting the I have no red underline in any files under /src/intTest (IntelliJ IDEA 2021.2.1) with almost all settings at defaults: |
|
I think as long as the Spek IDE plugin can pick up the tests, Gradle executes them and IDE indexing works, the fact that it's not specifically identified as green/test module isn't a showstopper (it does bug me as well though! But this setup is simpler to me than having a whole new module for integration tests) We can have others weigh in of course. |
Agree. Also I believe you can workaround the coloring issue with something like: Sadly I wasn't able to let it work (see https://youtrack.jetbrains.com/issue/IDEA-151925). If you folks look into it let me know 🙏 |
|
Converting back to draft and removing from 1.19.0 milestone (for now) - Gradle 7.3 is introducing support for test suites which I believe supersedes the currently recommended configuration I've used here. It would be better to wait to see what that looks like and use the newer, hopefully simpler setup. |
|
@3flex Would you mind sharing some of the pointers how Gradle 7.3 changes the test suites? (Assuming this is for Gradle integration test only) |
b11b720 to
1409591
Compare
https://docs.gradle.org/7.3-rc-1/release-notes.html#test-suites |
7a235e6 to
b79c62d
Compare
|
Great stuff! What's the status on the IDE support? |
146b506 to
4350fc2
Compare
Unfortunately it's not configured automatically but I've requested this integration & configuration be applied automatically: gradle/gradle#18723 |
This should autoconfigure IntelliJ module test roots for each test suite from Gradle 7.4


This is a step on the way to separating Gradle TestKit tests from the other Gradle plugin tests (see #3778).
This PR sets up the Gradle build to support the new structure, and moves tests that use TestKit but don't use dry-run mode into
src/functionalTest. It also moves shared code intosrc/testFixturesso they can be used by both functional tests and standard tests while that's still necessary.There's a new task
functionalTestwhich runs all tests insrc/functionalTest. BothfunctionalTestandtestare dependencies ofchecktask and therefore also thebuildtask.