igor.wojda
08/01/2017, 12:14 PMSpek
and I can't run them for Android project.
Spek
seems to have general problem with JUnit4 runner, so I am not sure how can I use it for Android project?
Here is my sample project
https://github.com/igorwojda/migrate-java-tests-to-kotlin
I would be grateful if some one would take a look and give some fix hints or share working Spek on Android projectadambl4
08/01/2017, 12:21 PMrafal
08/01/2017, 12:27 PMrafal
08/01/2017, 12:27 PMtestImplementation "org.jetbrains.spek:spek-api:$versions.spek"
testRuntime "org.jetbrains.spek:spek-junit-platform-engine:$versions.spek"
testImplementation "org.junit.platform:junit-platform-console:$versions.junit_platform"
testImplementation "org.junit.jupiter:junit-jupiter-api:$versions.junit_jupiter"
rafal
08/01/2017, 12:27 PMspek : '1.1.2',
junit_platform : '1.0.0-M4',
junit_jupiter : '5.0.0-M4'
rafal
08/01/2017, 12:28 PMrafal
08/01/2017, 12:29 PMadambl4
08/01/2017, 12:40 PMigor.wojda
08/01/2017, 12:48 PMCannot add jps/kotlin-jps-plugin.jar from plugin 'Kotlin' to external compiler classpath: home directory of plugin not found
And then framework crashes
Exception in thread "main" org.junit.platform.commons.util.PreconditionViolationException: Could not load class with name: igorwojda.com.presentertest.feature.ProfilePresenterTest_Sample1_Kotlin_Spek
at org.junit.platform.engine.discovery.ClassSelector.lambda$getJavaClass$0(ClassSelector.java:71)
...
igor.wojda
08/01/2017, 12:52 PMscr\test
, not src\androidTest
, so they are runned loccallyrafal
08/01/2017, 12:54 PMrafal
08/01/2017, 12:55 PM-M5
does not work with Spek 😞 )rafal
08/01/2017, 12:56 PMbuild.gradle
buildscript {
dependencies{
classpath "org.junit.platform:junit-platform-gradle-plugin:$versions.junit_platform"
}
}
igor.wojda
08/01/2017, 1:38 PMTest framework quited unexpectedly
error`
I am starting to think that there maybye something wrong with my IDE/SYSTEMigor.wojda
08/01/2017, 1:39 PMProfilePresenterTestSpek
or CorePresenterTestSpek
https://github.com/igorwojda/migrate-java-tests-to-kotlin ?adambl4
08/01/2017, 1:40 PMjk
08/01/2017, 1:44 PMjunitPlatform {
filters {
engines {
include 'spek'
}
}
}`
adambl4
08/01/2017, 1:46 PMrafal
08/01/2017, 1:46 PM:app:compileDebugUnitTestJavaWithJavac
rafal
08/01/2017, 1:48 PMigor.wojda
08/01/2017, 1:52 PMigor.wojda
08/01/2017, 2:42 PMapp:compileDebugUnitTestJavaWithJavac
- this did not helped
2. @jk Truied to add those junitplatform configurations to main project gradle file
apply plugin: 'org.junit.platform.gradle.plugin'
junitPlatform {
filters {
engines {
include 'spek'
}
}
}
but is fails with an error
Error:(31, 0) Declaring custom 'clean' task when using the standard Gradle lifecycle plugins is not allowed.
jk
08/01/2017, 2:50 PMrafal
08/01/2017, 2:53 PMigor.wojda
08/01/2017, 2:54 PMigor.wojda
08/01/2017, 2:55 PMrafal
08/01/2017, 2:57 PMProfilePresenterTest_Kotlin_Spek
(it's inside tests in app
module)igor.wojda
08/01/2017, 3:00 PMigor.wojda
08/01/2017, 3:32 PMProfilePresenterTest_Kotlin_Spek
seems to be working now indeed. Can you run tests in CorePresenterTestSpek
? (core module)jk
08/01/2017, 4:16 PMigor.wojda
08/01/2017, 4:25 PMjk
08/01/2017, 4:30 PM