kotest icon indicating copy to clipboard operation
kotest copied to clipboard

UniqueId Selectors Failing With Kotest

Open oscargolding opened this issue 3 years ago • 2 comments

Which version of Kotest are you using 5.3.0

Hi there, I have had a kotest commit recently break the functionality of my application. Please see the error line below. I make a tool that performs load tests using the JUnit launcher. Some of the tests that may be run include kotest tests.

Caused by: java.lang.RuntimeException: Kotest does not allow running tests via uniqueId

Due to performance reasons, our application requires that the UniqueId be used from a JUnit TestPlan to cache discovery requests. This works exceptionally well for the Jupiter engine, but when the kotest engine is used we are seeing runtime exceptions appear. According to the JUnit team, all engines should support UniqueId.

I see that a decision was intentionally made recently to no longer support UniqueId selector when the engine is kotest. https://github.com/kotest/kotest/pull/2862#issuecomment-1065919788

Specifically, I am seeing the following runtime exceptions.

To see an example of how I do test discovery see this comment on the JUnit issue board: https://github.com/junit-team/junit5/issues/2952#issuecomment-1165390154

Could kotest support running tests with UniqueId selectors? Mainly the tests being run are just kotest tests and are not mixed with JUnit. Ideally, when I provide UniqueId selectors I expect kotest to run only those tests (and not all the tests in a suite).

Thanks!

oscargolding avatar Aug 09 '22 06:08 oscargolding

How are you getting the unique id to pass into the launcher for kotest tests?

sksamuel avatar Aug 29 '22 09:08 sksamuel

The same way as outlined here: https://github.com/junit-team/junit5/issues/2952#issuecomment-1165390154

I just get the UniqueId from the test identifiers inside a TestPlan.

Thanks :)

oscargolding avatar Sep 05 '22 09:09 oscargolding

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

stale[bot] avatar Nov 12 '22 04:11 stale[bot]

Hey, just wondering if this work was done in the attached milestones. I still would really like this feature! Thanks :)

oscargolding avatar Feb 07 '23 01:02 oscargolding

@oscargolding #3461 should fix this. Could you please try with a current snapshot?

marcphilipp avatar Apr 04 '23 12:04 marcphilipp

Closing it as completed since the feature was implemented in #3461. If problems arise again let's open it as a bug :D

LeoColman avatar Apr 05 '23 15:04 LeoColman