Hi all, I'm using `@RequiresTag("Ignore")` in my ...
# kotest
v
Hi all, I'm using
@RequiresTag("Ignore")
in my Kotlin application, to exclude certain tests, as described here: https://kotest.io/docs/framework/tags.html#tagging-a-spec However, when I run the test task with:
./gradlew :app:test
I receive the following warning from Gradle:
Copy code
Task :app:test
No test executed. This behaviour has been deprecated. This will fail with an error in Gradle 9.0. There are test sources present, but no test was executed. Please check your test configuration. Consult the upgrading guide for further information: <https://docs.gradle.org/8.13/userguide/upgrading_version_8.html#test_task_fail_on_no_test_executed>
I currently have only one test, and it's excluded using the Ignore tag. While this is just a warning in Gradle 8.13, it will cause the build to fail in Gradle 9.0. Is there a recommended way to handle this scenario when using Kotest and tagged exclusions? Thanks!
o
This behavior is unrelated to tags. If you are trying to run tests and not a single test executes, Gradle 9.0 will report this as an error and no longer silently ignore it.
v
https://docs.gradle.org/8.13/userguide/upgrading_version_8.html#test_task_fail_on_no_test_executed gradle suggests excluding the
test
source from the build, but if I do so, then it won't be possible to trigger the test via the kotest tag. Do you have any idea how to handle this?
o
I’d just accept the error message I guess. It would just remind me that I might be missing tests.
Another option, if you don’t agree with Gradle’s new behavior: Add a single always-successful (no-op) test that always executes.
v
So with the kotest tag, I should not exclude all the tests. Atleast some test should be running to make the gradle happy.
o
In your case, that’s correct. The method used to include or exclude tests doesn’t matter, there always has to be at least one executing test.
👍 1