https://kotlinlang.org logo
#konsist
Title
# konsist
d

Denys

09/07/2023, 7:53 AM
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

igor.wojda

09/07/2023, 7:54 AM
Is this an Android project or kotlin project?
d

Denys

09/07/2023, 7:54 AM
Android
i

igor.wojda

09/07/2023, 8:22 AM
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

Denys

09/07/2023, 8:36 AM
@igor.wojda thanks a lot!
2 Views