Kelvin Chung
07/03/2025, 6:35 AMval testResultsElements = configurations.consumable("testResultsElementsForJvmTest") {
// This configuration mimics that defined by the "test-suite-base" plugin
description = "Binary results obtained from running the 'jvmTest' suites."
attributes.attribute(Category.CATEGORY_ATTRIBUTE, objects.named(Category.VERIFICATION))
attributes.attribute(VerificationType.VERIFICATION_TYPE_ATTRIBUTE, objects.named(VerificationType.TEST_RESULTS))
// FIXME how do we accommodate multiple JVM targets and their respective test suites?
attributes.attribute(TestSuiteName.TEST_SUITE_NAME_ATTRIBUTE, objects.named("test"))
val binaryDir = tasks.named<Test>("jvmTest").flatMap { it.binaryResultsDirectory }
outgoing.artifact(binaryDir) {
type = ArtifactTypeDefinition.DIRECTORY_TYPE
}
}
I'm wondering what I would have to change if I had two source sets that produced JVM code, so I would have two "testResults" configurations. And how that would relate to the test result aggregation plugin since I would need to differentiate them in such a way that the aggregation plugin could pick each of them separately.Vampire
07/03/2025, 2:38 PMKelvin Chung
07/03/2025, 2:41 PMtest. Perhaps I'm doing something wrong.Vampire
07/03/2025, 2:41 PMKelvin Chung
07/03/2025, 2:42 PMMutation of attributes is not allowed error when I try
dependencies {
testReportAggregation(...) {
attributes.attribute(TestSuiteName.TEST_SUITE_NAME_ATTRIBUTE, objects.named("jvmTest"))
}
}
Not sure if I'm doing that correctly.Vampire
07/03/2025, 2:42 PMKelvin Chung
07/03/2025, 2:42 PMorg.gradle.internal.component.resolution.failure.exception.VariantSelectionByAttributesException: The consumer was configured to find a component of category 'verification', as well as attribute 'org.gradle.testsuite.name' with value 'test', attribute 'org.gradle.verificationtype' with value 'test-results'
This is what I get when I have it as jvmTest in my producer. The error reads as if it accepts test and nothing else.Vampire
07/03/2025, 2:43 PMVampire
07/03/2025, 2:43 PMVampire
07/03/2025, 2:44 PMKelvin Chung
07/03/2025, 2:44 PMtest in some and jvmTest in others.Kelvin Chung
07/03/2025, 2:45 PMVampire
07/03/2025, 2:51 PMVampire
07/03/2025, 2:51 PMVampire
07/03/2025, 2:51 PMVampire
07/03/2025, 2:52 PMVampire
07/03/2025, 2:53 PMall outgoing configuration and can then do an aggregated jacoco report over all test suitesKelvin Chung
07/03/2025, 2:53 PMVampire
07/03/2025, 4:25 PM