May not be specific to kotlin but I am trying to a...
# announcements
a
May not be specific to kotlin but I am trying to add some unit tests that run independent of regular tests, ideally the "test" gradle task would skip these but another task would run only those. How can I do this aside from adding another project just for testing?
a
You can include and exclude tests based on name or file path in the Gradle test task (see the Gradle documentation). you could create another tasks that only filter the other tests.
v
Depending on the test framework you could also use annotations for the filtering, at least JUnit and Spock support this. Or you could also define another source set with sources in
src/otherTest
instead of
src/test
and define a task for those.
a
I think I might do the 2nd source set approach. This is not an integration test but similar concept and usually those are kept separate and sometimes another project altogether
👌 1