TS-46357 Collect the tests of a @ParameterizedClass - #965
Merged
Conversation
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
force-pushed
the
ts/46357_no_container_found
branch
from
August 31, 2026 13:06
b81a024 to
d36a599
Compare
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>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Addresses issue TS-46357
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.