Skip to content

BazelJUnitOutputListener Can't Handle Deeply Nested Test Classes #296

@sfc-gh-skhattak

Description

@sfc-gh-skhattak

It seems that the BazelJUnitOutputListener class can handle only up to 4 jupiter @Nested classes for simple tests. This is because with no nesting, there are 3 segments, and since (1) each nested class adds another segment to uniqueId, and (2) the matchTestCasesToSuites_locked method can handle up to 6 nested classes, the method silently handles nested classes until you hit 4, in which case I get the following error:

WARNING: Unexpected test organization for TestIdentifier 
[uniqueId = [engine:junit-jupiter]/
[class:<TestClass>]/
[nested-class:<nest1>]/
[nested-class:<nest2>]/
[nested-class:<nest3>]/
[nested-class:<nest4>]/
[method:<testmethod>], ...]

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions