Skip to content

EngineDiscoveryOrchestrator#applyPostDiscoveryFilters should probably do depth-first processing #3188

Open

Description

In platform 1.9.0, the EngineDiscoveryOrchestrator#applyPostDiscoveryFilters calls acceptInAllTestEngines which iterates over the test engine descriptors and for each engine descriptor calls accept with a visitor that checks all post discovery filters and removes nodes from the hierarchy eventually.

This removing is done, if the descriptor is not the root, and any of the filters excludes it, and the descriptor has no children.

Gradle, Maven, and IntelliJ for example use post discovery filters to match test method names with own supported pattern syntaxes.

So if you now have a hierarchy like

a
  b
    c

and the post discovery filter would filter out b and c, the end result would be

a
  b

because when the filter is applied to b, it has children and thus is not excluded.
When it then checks c, it is removed because it does not have children.

Shouldn't the children be checked first, so that the filter can remove c first and then remove b as it no longer has children?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions