Please help me - I’m a newbie, so I apologize for ...
# konsist
d
Please help me - I’m a newbie, so I apologize for such questions. I’m trying to set up separate Konsist and other unit tests in Gitlab CI (I want these pipelines to be independent of each other). But the problem is that the pipeline for the “./gradlew testDebugUnitTest” unit tests also runs the Konsist tests. How to separate them correctly?
1
i
Is this an Android project or kotlin project?
d
Android
i
Actually this is a really good question. Best way to do it in Android project is to create a dedicated
konsist_test
module and run Gradle
test
command for this module
./gradlew konsist_test:test
and use another command to run all unit tests besides tests defined in the
konsist_test
module by running
./gradlew test -x konsistTest:test
command. See Konsist docs https://docs.konsist.lemonappdev.com/advanced/isolate-konsist-tests Here is the Android project where this is defined like this... https://github.com/igorwojda/android-showcase ...and here is CI script for this project https://github.com/igorwojda/android-showcase/blob/main/.github/workflows/check.yml
In fact see the Konsist sample projects - every Android project has a dedicated module for Konsist tests https://github.com/LemonAppDev/konsist/tree/main/samples/starter-projects
d
@igor.wojda thanks a lot!