Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

KoTest run configuration does not have options to run test repeatedly #304

Open
bliessens opened this issue Jun 21, 2024 · 3 comments
Open

Comments

@bliessens
Copy link

bliessens commented Jun 21, 2024

The JUnit run configuration has options to run a test repeatedly: given number of executions, until failure, ...

image

KoTest run configuration do not have this option.

@Kantis
Copy link
Member

Kantis commented Jun 21, 2024

You can easily configure the test itself to repeat N times.

@bliessens
Copy link
Author

I found this deprecated method but it doesn't seem to work:

override fun defaultTestCaseConfig(): TestCaseConfig? = TestCaseConfig(invocations = 1_000)

@Kantis
Copy link
Member

Kantis commented Jun 23, 2024

Do you want to do it for all tests, or a particular test?

For a particular test, you add .config(invocations = N) to the test itself. Like:

      "Value provided (cents) should be converted to whole SEK".config(invocations = 100) {
         Amount(100, 25).vatAmount shouldBe BigDecimal.valueOf(0.25)
      }

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants