Open ntoskrnl opened 3 years ago
After some digging, I found that adding dependency on mock-agent-jvm
artifact fixes the problem.
But mockk
already has a runtime dependency on it: https://mvnrepository.com/artifact/io.mockk/mockk/1.11.0
@ntoskrnl Can you attach a sample project here that reproduces the issue? Would help out in debugging.
Here is a sample project: https://github.com/ntoskrnl/spek2-with-mockk-sample Let me know what I can do to help with the debugging.
For the issue with mockk there is a workaround, but there is also an issue with Spek replacing RunConfiguration for all other tests in the project. It is reported here: https://github.com/spekframework/spek/issues/837
Maybe it has something to do with how SpekRunConfigurationProducer
is implemented - it looks like it doesn't actually check if there are other types of tests under the provided path.
Maybe it has something to do with how SpekRunConfigurationProducer is implemented - it looks like it doesn't actually check if there are other types of tests under the provided path.
Nah, this is something in IJ - IJ will query each plugin for an "action" that can be run in a particular context. It's not the responsibility of Spek's plugin to check for other test types.
I am trying to use MockK in tests with Spek. Tests run just fine from command line but fail when I run them from the IDE (Android Studio).
There is an issue report in MockK for this, but previously there were similar issues with other test framework plugins (e.g. bug in Kotest plugin). And it was related to the problem in the IDE plugin, not mockk. I think this one is similar and it should be the issue in Spek plugin for Android Studio.
I am using Android Studio 4.1.x with Kotlin plugin 1.4.32 and Spek Framework plugin "2.0.16-IJ2020.2".
Here is a stack trace of the crash (just in case):