https://kotlinlang.org logo
Title
p

peekandpoke

07/12/2022, 7:59 AM
Hi there! I am trying to run multiplatform tests (specifically JS) with the Snapshot builds 5.4.* But when I add a project dependency to
io.kotest:kotest-framework-engine
then some dependencies cannot be resolved, which means that JS tests cannot be run:
Execution failed for task ':commonmp:compileKotlinJs'.
> Error while evaluating property 'filteredArgumentsMap' of task ':commonmp:compileKotlinJs'
   > Could not resolve all files for configuration ':commonmp:kotlinCompilerPluginClasspathJsMain'.
      > Could not find io.kotest:kotest-framework-multiplatform-plugin-js-jvm:5.4.0.1048-SNAPSHOT.
        Searched in the following locations:
          - <https://repo.maven.apache.org/maven2/io/kotest/kotest-framework-multiplatform-plugin-js-jvm/5.4.0.1048-SNAPSHOT/maven-metadata.xml>
          - <https://repo.maven.apache.org/maven2/io/kotest/kotest-framework-multiplatform-plugin-js-jvm/5.4.0.1048-SNAPSHOT/kotest-framework-multiplatform-plugin-js-jvm-5.4.0.1048-SNAPSHOT.pom>
          - <https://maven.pkg.jetbrains.space/public/p/kotlinx-html/maven/io/kotest/kotest-framework-multiplatform-plugin-js-jvm/5.4.0.1048-SNAPSHOT/maven-metadata.xml>
          - <https://maven.pkg.jetbrains.space/public/p/kotlinx-html/maven/io/kotest/kotest-framework-multiplatform-plugin-js-jvm/5.4.0.1048-SNAPSHOT/kotest-framework-multiplatform-plugin-js-jvm-5.4.0.1048-SNAPSHOT.pom>
          - <https://jitpack.io/io/kotest/kotest-framework-multiplatform-plugin-js-jvm/5.4.0.1048-SNAPSHOT/maven-metadata.xml>
          - <https://jitpack.io/io/kotest/kotest-framework-multiplatform-plugin-js-jvm/5.4.0.1048-SNAPSHOT/kotest-framework-multiplatform-plugin-js-jvm-5.4.0.1048-SNAPSHOT.pom>
          - <https://oss.sonatype.org/content/repositories/snapshots/io/kotest/kotest-framework-multiplatform-plugin-js-jvm/5.4.0.1048-SNAPSHOT/maven-metadata.xml>
          - <https://oss.sonatype.org/content/repositories/snapshots/io/kotest/kotest-framework-multiplatform-plugin-js-jvm/5.4.0.1048-SNAPSHOT/kotest-framework-multiplatform-plugin-js-jvm-5.4.0.1048-SNAPSHOT.pom>
What appears strange to me is the pairing of js-jvm in
kotest-framework-multiplatform-plugin-js-jvm
Is there a way that I can work around this for the moment?
Ok ... it seems that the
kotest-framework-multiplatform-plugin
is not published for the snapshot version
e

Emil Kantis

07/12/2022, 8:06 AM
the
-js-jvm
is because the compiler-plugin is written for js, while gradle plugins are jvm based, so
-jvm
is added 🙂
p

peekandpoke

07/12/2022, 8:07 AM
But when I switch to
io.kotest:kotest-framework-engine:5.3.2
while using Kotlin 1.7.0 then this error pops up:
java.lang.NoClassDefFoundError: org/jetbrains/kotlin/ir/declarations/IrFileKt
	at io.kotest.framework.multiplatform.js.SpecIrGenerationExtension$generate$1.visitFileNew(SpecIrGenerationExtension.kt:158)
	at org.jetbrains.kotlin.backend.common.IrElementTransformerVoidWithContext.visitFile(IrElementTransformerVoidWithContext.kt:55)
	at org.jetbrains.kotlin.ir.visitors.IrElementTransformerVoid.visitFile(IrElementTransformerVoid.kt:48)
	at org.jetbrains.kotlin.ir.visitors.IrElementTransformerVoid.visitFile(IrElementTransformerVoid.kt:24)
	at org.jetbrains.kotlin.ir.declarations.IrFile.accept(IrFile.kt:22)
	at org.jetbrains.kotlin.ir.declarations.IrFile.transform(IrFile.kt:25)
	at org.jetbrains.kotlin.ir.declarations.IrFile.transform(IrFile.kt:14)
	at org.jetbrains.kotlin.ir.util.TransformKt.transformInPlace(transform.kt:35)
	at org.jetbrains.kotlin.ir.declarations.IrModuleFragment.transformChildren(IrModuleFragment.kt:40)
	at org.jetbrains.kotlin.ir.visitors.IrElementTransformerVoid.visitModuleFragment(IrElementTransformerVoid.kt:33)
	at io.kotest.framework.multiplatform.js.SpecIrGenerationExtension$generate$1.visitModuleFragment(SpecIrGenerationExtension.kt:38)
	at org.jetbrains.kotlin.ir.visitors.IrElementTransformerVoid.visitModuleFragment(IrElementTransformerVoid.kt:38)
	at org.jetbrains.kotlin.ir.visitors.IrElementTransformerVoid.visitModuleFragment(IrElementTransformerVoid.kt:24)
	at org.jetbrains.kotlin.ir.declarations.IrModuleFragment.accept(IrModuleFragment.kt:30)
	at org.jetbrains.kotlin.ir.declarations.IrModuleFragment.transform(IrModuleFragment.kt:33)
	at org.jetbrains.kotlin.ir.declarations.IrModuleFragment.transform(IrModuleFragment.kt:17)
	at io.kotest.framework.multiplatform.js.SpecIrGenerationExtension.generate(SpecIrGenerationExtension.kt:32)
	at org.jetbrains.kotlin.ir.backend.js.KlibKt.generateModuleFragmentWithPlugins$lambda-20(klib.kt:538)
	at org.jetbrains.kotlin.psi2ir.Psi2IrTranslator.generateModuleFragment(Psi2IrTranslator.kt:99)
	at org.jetbrains.kotlin.psi2ir.Psi2IrTranslator.generateModuleFragment$default(Psi2IrTranslator.kt:75)
	at org.jetbrains.kotlin.ir.backend.js.KlibKt.generateModuleFragmentWithPlugins(klib.kt:543)
	at org.jetbrains.kotlin.ir.backend.js.KlibKt.generateIrForKlibSerialization(klib.kt:173)
	at org.jetbrains.kotlin.ir.backend.js.KlibKt.generateKLib(klib.kt:208)
	at org.jetbrains.kotlin.ir.backend.js.KlibKt.generateKLib$default(klib.kt:190)
	at org.jetbrains.kotlin.cli.js.K2JsIrCompiler.doExecute(K2JsIrCompiler.kt:281)
	at org.jetbrains.kotlin.cli.js.K2JSCompiler.doExecute(K2JSCompiler.java:183)
	at org.jetbrains.kotlin.cli.js.K2JSCompiler.doExecute(K2JSCompiler.java:72)
	at org.jetbrains.kotlin.cli.common.CLICompiler.execImpl(CLICompiler.kt:94)
	at org.jetbrains.kotlin.cli.common.CLICompiler.execImpl(CLICompiler.kt:43)
	at org.jetbrains.kotlin.cli.common.CLITool.exec(CLITool.kt:101)
	at org.jetbrains.kotlin.incremental.IncrementalJsCompilerRunner.runCompiler(IncrementalJsCompilerRunner.kt:208)
	at org.jetbrains.kotlin.incremental.IncrementalJsCompilerRunner.runCompiler(IncrementalJsCompilerRunner.kt:83)
	at org.jetbrains.kotlin.incremental.IncrementalCompilerRunner.compileIncrementally(IncrementalCompilerRunner.kt:366)
	at org.jetbrains.kotlin.incremental.IncrementalCompilerRunner.compileIncrementally$default(IncrementalCompilerRunner.kt:311)
	at org.jetbrains.kotlin.incremental.IncrementalCompilerRunner.rebuild(IncrementalCompilerRunner.kt:110)
	at org.jetbrains.kotlin.incremental.IncrementalCompilerRunner.compileImpl(IncrementalCompilerRunner.kt:200)
	at org.jetbrains.kotlin.incremental.IncrementalCompilerRunner.compile(IncrementalCompilerRunner.kt:75)
	at org.jetbrains.kotlin.incremental.IncrementalCompilerRunner.compile$default(IncrementalCompilerRunner.kt:65)
	at org.jetbrains.kotlin.daemon.CompileServiceImplBase.execJsIncrementalCompiler(CompileServiceImpl.kt:566)
	at org.jetbrains.kotlin.daemon.CompileServiceImplBase.access$execJsIncrementalCompiler(CompileServiceImpl.kt:101)
	at org.jetbrains.kotlin.daemon.CompileServiceImpl.compile(CompileServiceImpl.kt:1830)
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
	at java.lang.reflect.Method.invoke(Method.java:498)
	at sun.rmi.server.UnicastServerRef.dispatch(UnicastServerRef.java:357)
	at sun.rmi.transport.Transport$1.run(Transport.java:200)
	at sun.rmi.transport.Transport$1.run(Transport.java:197)
	at java.security.AccessController.doPrivileged(Native Method)
	at sun.rmi.transport.Transport.serviceCall(Transport.java:196)
	at sun.rmi.transport.tcp.TCPTransport.handleMessages(TCPTransport.java:573)
	at sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.run0(TCPTransport.java:834)
	at sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.lambda$run$0(TCPTransport.java:688)
	at java.security.AccessController.doPrivileged(Native Method)
	at sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.run(TCPTransport.java:687)
	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
	at java.lang.Thread.run(Thread.java:748)
Caused by: java.lang.ClassNotFoundException: org.jetbrains.kotlin.ir.declarations.IrFileKt
	at java.net.URLClassLoader.findClass(URLClassLoader.java:382)
	at java.lang.ClassLoader.loadClass(ClassLoader.java:418)
	at java.lang.ClassLoader.loadClass(ClassLoader.java:351)
	... 58 more
e

Emil Kantis

07/12/2022, 8:08 AM
For now I think you could do this. • Clone kotest into a sibling directory, e.g.:
workspace/my-project
workspace/kotest
• Add
includeBuild("../kotest")
to
my-project/settings.gradle.kts
p

peekandpoke

07/12/2022, 8:14 AM
Ok thank you.
Is there an estimate when 5.4.0 is going to be released?
Or will the snapshot versions of mulitplatform plugins be published anytime soon? This would be great!
e

Emil Kantis

07/12/2022, 8:18 AM
It seems gradle plugin portal does not support snapshots, so I don't think it's likely to happen. See this discussion for instance (were the include-build solution is also recommended)