Skip to content

Allow ParameterizedTest annotation to receive a filter class to filter the arguments #5034

@Llamadmiral

Description

@Llamadmiral

We have a big codebase, and we have a lot of tests. A lot of those tests are ParameterizedTests that are connected to services that take a really long time for each test run. Unfortunately parallel test running is not really an option for us.
We had an idea to filter the ParameterizedTest arguments, however, since they can receive Enums, Fields, Classes, and Method sources, it is difficult to implement this.

My idea (which is probably not the best) is to introduce a class, that has a Stream<Arguments> filter(Stream<Arguments> arguments) method.
What we want to achieve, is to have either a round-robin, a random, or something else based run.
With this, we could run our tests with lets say, only 1 set of arguments, without touching the codebase.

Deliverables

  • Have a ParameterizedTestArgumentsFilter class or interface
  • Have a method Stream<Arguments> filter(Stream<Arguments> arguments)
  • Use said class in the ParameterizedTests annotation.

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions