Skip to content

TS-46357 Collect the tests of a @ParameterizedClass - #965

Merged
Stef2k16 merged 4 commits into
masterfrom
ts/46357_no_container_found
Sep 2, 2026
Merged

TS-46357 Collect the tests of a @ParameterizedClass#965
Stef2k16 merged 4 commits into
masterfrom
ts/46357_no_container_found

Conversation

@DreierF

@DreierF DreierF commented Aug 31, 2026

Copy link
Copy Markdown
Contributor

Addresses issue TS-46357

  • Changes are tested adequately
  • Teamscale documentation updated in case of user-visible changes
  • CHANGELOG.md updated
  • Present new features in N&N
  • TGA Tutorial updated
  • TIA Tutorial updated

Please respect the vote of the Teamscale bot or flag irrelevant findings as tolerated or false positives. If you feel that the Teamscale config needs adjustment, please state so in a comment and discuss this with your reviewer.

JUnit 5.13 introduced @ParameterizedClass, which the jupiter engine
reports with unique ID segment types the resolver did not know:
"class-template" for a top-level one, "nested-class-template" for a
@nested one and "class-template-invocation" for the individual parameter
sets. A top-level @ParameterizedClass therefore resolved to no uniform
path at all, so the agent never received a test start event and its
coverage was silently missing from the report. A @nested one was
reported under its enclosing class, which made the report generator log
"No container found for test ...".

Each test method of such a class is now reported as one test, with the
executions of all parameter sets collapsed into it, just like all
invocations of a @ParameterizedTest form one test. The invocation index
that the jupiter engine appends to the reporting name (e.g.
"testOne()[1]") is stripped, so that every parameter set reports the
same uniform path and all of their coverage ends up on that one test.

The JUnit platform prunes the tests of a @ParameterizedClass from the
test tree right after discovery and only re-registers them while the
class is being executed, so they are recorded while they are still there
(see ClassTemplateRegistry). They can only be selected via the class
template, because JUnit executes a parameterized class as a whole, which
is why all of them are mapped to its unique ID.

This uncovered that the coverage and the results of a test that was
executed repeatedly overwrote each other instead of being merged, even
though the report builder was documented to merge them. That hid the
failure of one parameter set behind a later successful one, and it also
swallowed a failure inside a nested test container. The streaming report
paths of the Maven plugin and of the convert CLI now merge the dumps of
a test before writing them, which requires holding the coverage in
memory, as the Gradle plugin already does.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
@DreierF
DreierF force-pushed the ts/46357_no_container_found branch from b81a024 to d36a599 Compare August 31, 2026 13:06
DreierF and others added 3 commits September 1, 2026 09:41
Instead of handing the ClassTemplateRegistry to ITestSorter.selectAndSort
so that ImpactedTestsSorter can re-derive the available tests, pass the
AvailableTests that InternalImpactedTestEngine already computed right
before the call. This keeps the registry an implementation detail of the
test descriptor handling and walks the test tree only once.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
impacted-test-engine:
- Require the ClassTemplateRegistry explicitly in the execution listener
  and in getAvailableTests. The default of an empty registry silently
  turned off the @ParameterizedClass handling.
- Report a skipped class template via reportSkipped, which already falls
  back to the registry, so the lookup stays in one place.
- The pruning helper in TestDescriptorUtilsTest was shadowed by
  TestDescriptor.prune(), so the tests ran against the unpruned tree and
  could not fail. Rename it and add the negative case.
- Cover the two untested behaviours of executionFinished: handing the
  results of a nested container up to its representative and skipping
  null stacktraces instead of appending "null" to the message.
- Attach the simulated results to the descriptors instead of deriving
  them from loop indexes, and assert uniform path and result as pairs.

report-generator:
- convertAndConsumePerTest no longer keeps the coverage of the whole test
  run in memory: a first pass over the *.exec files determines which
  tests were dumped repeatedly, and only those are held back while every
  other test is passed on as soon as its dump was read.
- Rank the results of repeated executions explicitly instead of relying
  on the declaration order of ETestExecutionResult, which let
  INCONCLUSIVE hide a FAILURE and SKIPPED hide a PASSED.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Extract the reading of the *.exec file from findTestsWithMultipleDumps
into its own method to stay within the nesting depth threshold.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
@Stef2k16
Stef2k16 merged commit dad93ce into master Sep 2, 2026
4 checks passed
@Stef2k16
Stef2k16 deleted the ts/46357_no_container_found branch September 2, 2026 09:05
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

Successfully merging this pull request may close these issues.

2 participants