wasyl
10/20/2020, 11:42 AMsam
10/20/2020, 11:43 AMsam
10/20/2020, 11:44 AMsam
10/20/2020, 11:44 AMwasyl
10/20/2020, 11:44 AMwasyl
10/20/2020, 11:45 AMIf using junit5 platform in gradle, gradle will pass the discovered tests throughYou mean tests or test classes? And Kotest will still filter those and only pick classes that extend from a Spec?
sam
10/20/2020, 11:46 AMwasyl
10/20/2020, 11:47 AMdiscover
method in KotestJunitPlatformTestEngine
, right?sam
10/20/2020, 11:47 AMwasyl
10/20/2020, 11:47 AMsam
10/20/2020, 11:49 AMkotest-framework-discovery
module which contains the codesam
10/20/2020, 11:50 AMKotestJunitPlatformTestEngine
uses that depending on what gradle / intellij / whatever passes insam
10/20/2020, 11:50 AMsam
10/20/2020, 11:50 AMsam
10/20/2020, 11:51 AMwasyl
10/20/2020, 11:51 AM./gradlew foo:test
the request will scan the classpath, right?sam
10/20/2020, 11:51 AMsam
10/20/2020, 11:51 AMwasyl
10/20/2020, 11:51 AMdoDiscover
earlier 🙂 Just wanted to confirm that’s a good directionwasyl
10/20/2020, 11:53 AMpublic class DataBinderMapperImpl extends DataBinderMapper {
private static final SparseIntArray INTERNAL_LAYOUT_ID_LOOKUP = new SparseIntArray(0);
private static class InnerBrLookup {
static final SparseArray<String> sKeys = new SparseArray<String>(22);
}
}
The offending line is the InnerBrLookup
, not the outer one. I’m not sure if it’s because of the order of how the classes are loaded or it’s something about the class being an inner onewasyl
10/20/2020, 11:54 AMsam
10/20/2020, 11:54 AMsam
10/20/2020, 11:57 AMclass Foo {
companion object {
init {
error("boom")
}
}
}sam
10/20/2020, 11:57 AMsam
10/20/2020, 11:58 AMwasyl
10/20/2020, 11:59 AMwasyl
10/20/2020, 12:00 PMkaptTest
so the classes would have to be available in tests nowsam
10/20/2020, 12:00 PMsam
10/20/2020, 12:00 PMwasyl
10/20/2020, 12:02 PMwasyl
10/20/2020, 12:03 PMwasyl
10/20/2020, 12:04 PMstatic { }
block in decompiled bytecode in the nested class, and the error is in the companion constructor. Not sure if it should technically make a difference, just pointing out it’s differentsam
10/20/2020, 12:05 PMsam
10/20/2020, 12:05 PMwasyl
10/20/2020, 12:07 PMclass Foo {
class Bar {
companion object {
private val x: Nothing = error("boom")
}
}
}
wasyl
10/20/2020, 12:07 PMsam
10/20/2020, 12:07 PMwasyl
10/20/2020, 12:09 PMsam
10/20/2020, 12:10 PMsam
10/20/2020, 12:10 PMsam
10/20/2020, 12:15 PMsam
10/20/2020, 12:16 PMsam
10/20/2020, 12:16 PMsam
10/20/2020, 12:16 PMwasyl
10/20/2020, 12:17 PMforName(String name, boolean initialize, ClassLoader loader)
, which as I understand shouldn’t trigger class initialization if initialize = false
. However I don’t know if it changes something in the resulting classsam
10/20/2020, 12:19 PMsam
10/20/2020, 12:20 PMsam
10/20/2020, 12:26 PMsam
10/20/2020, 12:26 PMwasyl
10/20/2020, 12:31 PMsam
10/20/2020, 12:37 PMsam
10/20/2020, 12:37 PM// first filter down to spec instances only, then load the full class
val loadedClasses = request
.selectors
.filterIsInstance<DiscoverySelector.ClassDiscoverySelector>()
.map { Class.forName(it.className, false, this::class.java.classLoader) }
.filter(isSpecSubclass)
.map { Class.forName(it.name).kotlin }
.filterIsInstance<KClass<out Spec>>()
wasyl
10/20/2020, 12:39 PMsam
10/20/2020, 12:39 PMsam
10/20/2020, 12:39 PMwasyl
10/20/2020, 12:40 PMwasyl
10/20/2020, 12:41 PMenabled()
change 🙂wasyl
10/20/2020, 12:41 PMsam
10/20/2020, 12:42 PMsam
10/20/2020, 12:43 PMsam
10/20/2020, 12:43 PMwasyl
10/20/2020, 12:46 PMsam
10/20/2020, 12:51 PMsam
10/20/2020, 1:22 PMwasyl
10/20/2020, 2:17 PMsam
10/20/2020, 2:18 PMsam
10/20/2020, 2:18 PMwasyl
10/20/2020, 2:20 PMsam
10/20/2020, 2:21 PMsam
10/20/2020, 2:21 PMwasyl
10/20/2020, 2:23 PMPeter
10/20/2020, 3:34 PMchristophsturm
10/21/2020, 10:36 AM