Skip to content

Commit

Permalink
Convert Konsist tests to junit5 and run them in parallel
Browse files Browse the repository at this point in the history
  • Loading branch information
Pururun committed Jan 11, 2024
1 parent 3e52ec0 commit 3675473
Show file tree
Hide file tree
Showing 11 changed files with 16 additions and 11 deletions.
2 changes: 1 addition & 1 deletion android/test/arch/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,6 @@ androidComponents {
dependencies {
testImplementation(Dependencies.Compose.uiToolingAndroidPreview)
testImplementation(Dependencies.AndroidX.appcompat)
testImplementation(Dependencies.junit)
testImplementation(Dependencies.junitApi)
testImplementation(Dependencies.konsist)
}
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ package net.mullvad.mullvadvpn.test.arch
import com.lemonappdev.konsist.api.Konsist
import com.lemonappdev.konsist.api.architecture.KoArchitectureCreator.assertArchitecture
import com.lemonappdev.konsist.api.architecture.Layer
import org.junit.Test
import org.junit.jupiter.api.Test

class ArchitectureTests {

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import com.lemonappdev.konsist.api.Konsist
import com.lemonappdev.konsist.api.ext.list.properties
import com.lemonappdev.konsist.api.verify.assert
import com.lemonappdev.konsist.api.verify.assertNot
import org.junit.Test
import org.junit.jupiter.api.Test

class GeneralTests {
@Test
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ package net.mullvad.mullvadvpn.test.arch
import com.lemonappdev.konsist.api.Konsist
import com.lemonappdev.konsist.api.ext.list.withAnnotationOf
import com.lemonappdev.konsist.api.verify.assert
import org.junit.Test
import org.junit.jupiter.api.Test

class KonsistTests {
@Test
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import com.lemonappdev.konsist.api.ext.list.properties
import com.lemonappdev.konsist.api.ext.list.withAllParentsOf
import com.lemonappdev.konsist.api.verify.assert
import com.lemonappdev.konsist.api.verify.assertNot
import org.junit.Test
import org.junit.jupiter.api.Test

class ViewModelTests {
@Test
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ package net.mullvad.mullvadvpn.test.arch.classes

import com.lemonappdev.konsist.api.Konsist
import com.lemonappdev.konsist.api.verify.assert
import org.junit.Test
import org.junit.jupiter.api.Test

class ClassTests {
@Test
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import com.lemonappdev.konsist.api.Konsist
import com.lemonappdev.konsist.api.ext.list.modifierprovider.withDataModifier
import com.lemonappdev.konsist.api.ext.list.properties
import com.lemonappdev.konsist.api.verify.assertNot
import org.junit.Test
import org.junit.jupiter.api.Test

class DataClasses {
@Test
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,8 @@ package net.mullvad.mullvadvpn.test.arch.classes

import com.lemonappdev.konsist.api.Konsist
import com.lemonappdev.konsist.api.ext.list.modifierprovider.withValueModifier
import com.lemonappdev.konsist.api.ext.list.properties
import com.lemonappdev.konsist.api.verify.assertTrue
import org.junit.Test
import org.junit.jupiter.api.Test

class ValueClassTests {
@Test
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import androidx.compose.ui.tooling.preview.Preview
import com.lemonappdev.konsist.api.Konsist
import com.lemonappdev.konsist.api.ext.list.withAllAnnotationsOf
import com.lemonappdev.konsist.api.verify.assert
import org.junit.Test
import org.junit.jupiter.api.Test

class ComposePreviewTests {
@Test
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import androidx.compose.runtime.Composable
import com.lemonappdev.konsist.api.Konsist
import com.lemonappdev.konsist.api.ext.list.withAllAnnotationsOf
import com.lemonappdev.konsist.api.verify.assert
import org.junit.Test
import org.junit.jupiter.api.Test

class ComposeTests {
@Test
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
# Enables parallel execution of Konsist tests, values found here:
# https://docs.konsist.lemonappdev.com/advanced/additional-junit5-setup
junit.jupiter.execution.parallel.enabled=true
junit.jupiter.execution.parallel.mode.default=concurrent
junit.jupiter.execution.parallel.config.strategy=dynamic
junit.jupiter.execution.parallel.config.dynamic.factor=0.95

0 comments on commit 3675473

Please sign in to comment.