Automatically create test results elements for each test suite#31706
Merged
big-guy merged 1 commit intoDec 18, 2024
Conversation
8dfdd58 to
212a951
Compare
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
212a951 to
26f9745
Compare
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
26f9745 to
bce02ad
Compare
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
bce02ad to
fc5be0d
Compare
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
Collaborator
|
The following builds have failed: |
Collaborator
|
The following builds have failed: |
fc5be0d to
669ee1f
Compare
Previously, we created a binary test results elements for each test target. When performing aggregation, this only worked if the target test suite had a single target. Otherwise, we'd run into ambiguity. To resolve this for multi-target test suites, we only create a single variant for each sutie and add all test results variants for all targets to the suite's variant. This means when aggregating against a project, we will aggregate the results of all targets. Eventually we will want to go back to a test results variant for each target, but until we have the targets able to declare their identity via attributes, we will have a single variant per suite. We remove the concept of a test suite type, as this was a very simple mapping over the suite name, and only differed for the case of the default test suite, which has a test type of UNIT_TEST instead of its suite name. We will eventually want to not use the suite name as an attribute either, but rather use the suite name as part of a capability. The reports will eventually want to use attributes to distinguish which targets to aggregate instead of aggregating all targets from each suite. We also make similar changes to Jacoco.
669ee1f to
0d03a85
Compare
Member
Author
|
@bot-gradle test this |
This comment has been minimized.
This comment has been minimized.
Collaborator
|
The following builds have passed: |
big-guy
approved these changes
Dec 17, 2024
big-guy
left a comment
Member
There was a problem hiding this comment.
As a follow up, please add something to the upgrade guide that warns about changes in the JaCoCo and test suite plugins + aggregation.
|
|
||
| package org.gradle.testing.base.plugins; | ||
|
|
||
| import org.apache.commons.lang3.StringUtils; |
Member
There was a problem hiding this comment.
Can we keep using org.apache.commons.lang.StringUtils? I'm not sure why we have both versions...
Member
Author
There was a problem hiding this comment.
Shouldn't we prefer lang3 over lang?
Member
There was a problem hiding this comment.
Bah, it looks like we have a mix of both. I thought we were only using lang, not lang3
Member
There was a problem hiding this comment.
I guess lang3 is good enough. Ignore me
Member
Author
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.
Previously, we created a binary test results elements for each test target. When performing aggregation, this only worked if the target test suite had a single target. Otherwise, we'd run into ambiguity.
To resolve this for multi-target test suites, we only create a single variant for each suite and add all test results variants for all targets to the suite's variant. This means when aggregating against a project, we will aggregate the results of all targets.
Eventually we will want to go back to a test results variant for each target, but until we have the targets able to declare their identity via attributes, we will have a single variant per suite.
We remove the concept of a test suite type, as this was a very simple mapping over the suite name, and only differed for the case of the default test suite, which has a test type of UNIT_TEST instead of its suite name. We will eventually want to not use the suite name as an attribute either, but rather use the suite name as part of a capability.
The reports will eventually want to use attributes to distinguish which targets to aggregate instead of aggregating all targets from each suite.
We also make similar changes to Jacoco.
Reviewing cheatsheet
Before merging the PR, comments starting with