simon.vergauwen
06/11/2020, 12:09 PMMinSize
is possible for Arb<List<A>>
etc, which is also what I’m looking for in combination with minSuccessful
. This way I could easily reduce the stress of the test suite depending on where it runs, or depending on what platform it runs when moving to MPP.Friedger
06/12/2020, 11:54 AMGopal S Akshintala
06/12/2020, 1:37 PMjava.lang.NoSuchMethodError: 'double kotlin.time.Duration$Companion.getZERO-UwyO8pc()'
when running any test with Kotest. I am on gradle 6.5, Kotlin - 1.4-M2, and using latest snapshots of Kotest. Can someone please helpsavrov
06/12/2020, 7:56 PMsam
06/14/2020, 4:50 PMGrigory Derzhavets
06/18/2020, 9:51 AMbeforeSpec/beforeTest
methods. As I see right now, the test_executor firstly runs these and then filters out tests. Does anybody know whether it is possible in KotlinTest? PleaseNeel Kamath
06/19/2020, 3:35 AMdataClass1 shouldBe dataClass2
test fails. Is there any way it could be pretty printed so that I needn't spend minutes manually formatting it every time to see the diff? I think I saw Gradle pretty print a List
or something I had once.
Sorry if this is unrelated to Kotest. I'm unsure whether this is issue is from Kotest, Gradle, JUnit, etc.Grigory Derzhavets
06/19/2020, 8:12 AMchristophsturm
06/22/2020, 9:25 AM~/Projects/kotlin/kotest% ./gradlew kotest-examples:kotest-examples-javascript:jsTest
> Configure project :
Kotlin Multiplatform Projects are an experimental feature.
The Kotlin source set commonTest was configured but not added to any Kotlin compilation. You can add a source set to a target's compilation by connecting it with the compilation's default source set using 'dependsOn'.
See <https://kotlinlang.org/docs/reference/building-mpp-with-gradle.html#connecting-source-sets>
> Task :kotest-examples:kotest-examples-javascript:installMocha
npm WARN saveError ENOENT: no such file or directory, open '/Users/christoph/package.json'
npm WARN enoent ENOENT: no such file or directory, open '/Users/christoph/package.json'
npm WARN christoph No description
npm WARN christoph No repository field.
npm WARN christoph No README data
npm WARN christoph No license field.
+ mocha@8.0.1
updated 1 package and audited 191 packages in 1.527s
found 0 vulnerabilities
> Task :kotest-examples:kotest-examples-javascript:runMocha FAILED
FAILURE: Build failed with an exception.
* What went wrong:
A problem was found with the configuration of task ':kotest-examples:kotest-examples-javascript:runMocha' (type 'NodeTask').
> File '/Users/christoph/Projects/kotlin/kotest/kotest-examples/kotest-examples-javascript/node_modules/mocha/bin/mocha' specified for property 'script' does not exist.
* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Run with --scan to get full insights.
* Get more help at <https://help.gradle.org>
Deprecated Gradle features were used in this build, making it incompatible with Gradle 7.0.
Use '--warning-mode all' to show the individual deprecation warnings.
See <https://docs.gradle.org/6.5/userguide/command_line_interface.html#sec:command_line_warnings>
BUILD FAILED in 3s
14 actionable tasks: 2 executed, 12 up-to-date
~/Projects/kotlin/kotest%
sam
06/23/2020, 5:54 PMsimon.vergauwen
06/25/2020, 7:48 AMmatthew graf
06/26/2020, 8:44 PMEither
type (Arrow)? The shouldBeRight()
matcher helps quite a bit but I found myself needing to use map
to check values within that object
val submittedPayment: Either<PaymentEventRepoError, Payment> = eventStore.getLatestPaymentForAccount(123)
submittedPayment.map { it.amount }.shouldBeRight(50.00.toBigDecimal())
submittedPayment.map { it.state }.shouldBeRight(PaymentState.PENDING)
Its not so bad but I’m wondering if anyone has a better patternxenomachina
06/26/2020, 9:38 PMjulian
06/29/2020, 8:08 PMatara
06/30/2020, 8:54 AMshouldThrow
like this
shouldThrow<Exception> {
client.callMyEndpoint(request).awaitSingle()
}
simon.vergauwen
06/30/2020, 11:06 AMArg 0: 0L (shrunk from 23)
Arg 1: 1L (shrunk from 96)I’m seeing the above error message from the following
Arb.long(20, 40), Arb.long(90, 100)
. Is it expected that the values get shrunk outside of the allowed range?bbaldino
06/30/2020, 9:29 PMcontext
?bbaldino
06/30/2020, 10:41 PMExecution default-test of goal org.apache.maven.plugins:maven-surefire-plugin:2.22.2:test failed: java.lang.BootstrapMethodError: java.lang.IllegalAccessError: no such method: org.junit.platform.launcher.TagFilter.includeTags(List)PostDiscoveryFilter/invokeStatic: org/junit/platform/commons/PreconditionViolationException: org.junit.platform.commons.PreconditionViolationException -> [Help 1]
before?bbaldino
07/02/2020, 4:25 PMtim
07/03/2020, 1:41 PMjulian
07/04/2020, 12:42 AMStringSpec
and I have a particularly long test name, and split it up on separate lines, like this:
"Given blah blah blah blah blah blah" +
" - When blah blah blah" +
" - Then blah blah blah" {
TODO()
}
Then the test name in the Intellij run window will be truncated to just - Then blah blah blah
.
To remedy, I tried putting the concatenation in parens:
("Given blah blah blah blah blah blah" +
" - When blah blah blah" +
" - Then blah blah blah") {
TODO()
}
This fixed the test name displayed in the run window.
But the plugin no longer recognized the test, I think. Because it removed the single green arrow gutter icon from that test in IntelliJ.
Is there a workaround that avoids both problems?
Thanks!LeoColman
07/07/2020, 12:05 AMProjectConfig
, keep that in mind 😉simon.vergauwen
07/07/2020, 9:59 AMpeekandpoke
07/08/2020, 12:03 PMCameron Lane
07/08/2020, 1:13 PMsam
07/08/2020, 2:09 PMDavid Glasser
07/08/2020, 5:06 PMshould
uses ErrorCollector
(a singleton object) to by-default throw?bbaldino
07/09/2020, 7:53 PMcontext("when the server") {
withTestApplication({
myServerModule()
}) {
context("receives a request for url/to/something") {
with(handleRequest(<http://HttpMethod.Post|HttpMethod.Post>, "url/to/som ething") {
should("return the correct response") {
response.status() shouldBe HttpStatusCode.OK
}
}
}
}
}
This doesn't work though, as where should
is there isn't a coroutine scope and it complains. Is there a better way to do tests like this? Or would it be possible to have a non-suspend version of should
?mattmoore
07/10/2020, 3:55 AMfreeCompilerArgs
Skolson5903
07/11/2020, 7:38 PMException in thread "main" java.lang.ClassNotFoundException: BasicsTest
Looking at the invoked gradle build I can see no evidence that it attempted to build the unit test class BasicsTest, so it's not on the classpath. If I then try to edit the Run Configuration for the debug attempt, it shows the plugin selected the "shared" classpath by default. Dropping down the list of classpaths available does not show shared.androidTest as a choice.
So I have no way to invoke a debug of a unit test on a multi platform project's shared module. Is this a Kotest plugin issue? Or a multiplatform M3 issue? Until I resolve this I don't see a way to debug/run Kotest unit tests that
are using common classes in the IDE.
Thanks in advance for any info/help. FWIW I have already posted a precursor question of this problem as a recent thread in #eap, in that thread we concluded it better to post here:
https://kotlinlang.slack.com/archives/C0KLZSCHF/p1594327039086400Skolson5903
07/11/2020, 7:38 PMException in thread "main" java.lang.ClassNotFoundException: BasicsTest
Looking at the invoked gradle build I can see no evidence that it attempted to build the unit test class BasicsTest, so it's not on the classpath. If I then try to edit the Run Configuration for the debug attempt, it shows the plugin selected the "shared" classpath by default. Dropping down the list of classpaths available does not show shared.androidTest as a choice.
So I have no way to invoke a debug of a unit test on a multi platform project's shared module. Is this a Kotest plugin issue? Or a multiplatform M3 issue? Until I resolve this I don't see a way to debug/run Kotest unit tests that
are using common classes in the IDE.
Thanks in advance for any info/help. FWIW I have already posted a precursor question of this problem as a recent thread in #eap, in that thread we concluded it better to post here:
https://kotlinlang.slack.com/archives/C0KLZSCHF/p1594327039086400sam
07/14/2020, 4:39 AM