Skip to content
This repository was archived by the owner on Feb 2, 2025. It is now read-only.

upgrade kotest to 5.2.1 #149

Merged
merged 8 commits into from
Mar 23, 2022
Merged

upgrade kotest to 5.2.1 #149

merged 8 commits into from
Mar 23, 2022

Conversation

myuwono
Copy link
Contributor

@myuwono myuwono commented Mar 22, 2022

No description provided.

@myuwono
Copy link
Contributor Author

myuwono commented Mar 22, 2022

hmm.. the laws dsl in this repo doesn't work anymore due to the way that's being declared with string spec.

@myuwono myuwono marked this pull request as draft March 22, 2022 12:43
laws
.flatMap { list: List<Law> -> list.asIterable() }
.distinctBy { law: Law -> law.name }
.forEach { law: Law ->
addTest(TestName(prefix, law.name, true), disabled = false, config = null) { law.test(this) }
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@i-walker this addTest is no longer allowed after spec is instantiated kotest/kotest#2872

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It never was, it just silently ignored the test. So in 5.2 it actually lets you know it's broken.

Copy link
Member

@i-walker i-walker Mar 22, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks @myuwono, @sksamuel, is there a recommended option to add tests?
or does DSLDrivenDpec covers the same use-cases like RootSpec?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@i-walker I believe under normal circumstances we normally do that within container scope. I tried fixing that here.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Awesome thank you I didn‘t know the context :)

@sksamuel sksamuel force-pushed the issue/upgrade-kotest-version branch from 1b77cf6 to c06b0cc Compare March 22, 2022 13:06
@sksamuel sksamuel marked this pull request as ready for review March 22, 2022 13:06
@myuwono
Copy link
Contributor Author

myuwono commented Mar 22, 2022

My laptop cannot run gradle check locally on this repo somehow, i'm using github CI as my dev loop.

3 tests completed, 1 failed
MonoidLawTests.Boolean, Int, String obeys MonoidLaws FAILED
    IllegalStateException at /tmp/_karma_webpack_557292/commons.js:102685
There were failing tests

> Task :kotest-property-arrow:jsNodeTest

So i think by fixing the laws the tests started to run and seems like that started failing. I'll hand this over to you @i-walker i don't think i can easily debug this with my broken setup

@i-walker
Copy link
Member

Thanks @myuwono I‘ll take a look this evening 👍🏾☺️

MonoidLaws.laws(Monoid.string(), Arb.string())
)
}
class MonoidLawTests : FunSpec({
Copy link
Member

@i-walker i-walker Mar 23, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: can't we use StringSpec here?

aGen = Arb.list(Arb.int()),
bGen = Arb.int(),
funcGen = Arb.functionAToB(Arb.int()),
class TraversalTests : FunSpec({
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

same here

Copy link
Member

@i-walker i-walker left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Left a few nits, thanks @myuwono 👍🏾

@i-walker i-walker merged commit b76095c into master Mar 23, 2022
@i-walker i-walker deleted the issue/upgrade-kotest-version branch March 23, 2022 10:07
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants