This message was deleted.
# general
s
This message was deleted.
l
The first issue is an unfortunate problem with Groovy 3 error reporting in the Gradle Groovy DSL. The underlying issue is most likely that
annotationProcessor
is not understood inside the test suite block. See https://docs.gradle.org/current/javadoc/org/gradle/api/plugins/jvm/JvmComponentDependencies.html.
t
…so you'd have to use
smokeTestAnnotationProcessor("…")
in the global
dependencies {}
block.
👍 2
s
For (1) -- @Thomas Broyer is right. That's what you'll need to do for now. we should add annotationProcessor as an option in JvmComponentDependencies. We didn't do this initially because we were only focused on the compile/runtime aspect. cc @Tom Tresansky
for (2), have you applied the jacoco plugin? If you only want code coverage from the built-in test task, that should already be configured to do that in the jacoco plugin
t
I’ll put adding
annotationProcessor
support to TestSuites on my list. Hopefully not a big change that can be done in the next version.
s
Not able to add annotationProcessor in global dependencies. Getting this error:
Copy code
Could not find method smokeTestAnnotationProcessor() for arguments [org.projectlombok:lombok:1.18.22] on object of type org.gradle.api.internal.artifacts.dsl.dependencies.DefaultDependencyHandler.
t
Make sure you add it after you declare your
smokeTest
suite. Also if using the Kotlin DSL you'll probably have to use
"smokeTestAnnotationProcessor"("…")
or
add("smokeTestAnnotationProcessor", "…")
.
1
s
@Sterling Thank you for the reply. Much appreciated. (1) This one is solved now. Thanks @Thomas Broyer You were right, I was declaring the suite after the global dependencies block. (2) Yes I have jacoco plugin applied globally at the top of build.gradle file. But in the report it generated. It is only covering default src/test and not the test suite directory that I have added using this plugin. So, can you guide me can I accomplish this. I want to get report coverage both src/tests folder as well as all tests from test suites.
(3) Does this plugin, also donot support setting up of System Property ?? I am trying this and getting the same error - No signature of method present.
Copy code
testing {
    suites {
        test {
            useJUnitJupiter()
            systemProperty("junit.jupiter.execution.parallel.enabled", true)
            systemProperty("junit.jupiter.execution.parallel.mode.default", "concurrent")
        }

}
}
I was trying to use the above mentioned system properties for executing tests in parallel.
s
It is only covering default src/test and not the test suite directory that I have added using this plugin. So, can you guide me can I accomplish this. I want to get report coverage both src/tests folder as well as all tests from test suites.
Ah, I understand. I think you can do something like this:
Copy code
testing {
    suites {
        // other configuration

        withType(JvmTestSuite) {
            targets.all {
                tasks.named("jacocoTestReport").configure {
                    executionData.from(testTask)
                }
            }
        }
    }
}
This says the jacocoTestReport gets execution data from all jvm test suite targets.
(3) Does this plugin, also donot support setting up of System Property ??
I think you're confusing the test suite named "test" with the
Test
task named "test". Each test suite could have one or more test tasks associated with it, so you need to be a little more verbose:
Copy code
testing {
    suites {
        test {
            // other configuration
            targets.all {
                testTask.configure {
                    systemProperty("junit.jupiter.execution.parallel.mode.default", "concurrent")
                }
            }
        }
    }
}
s
(2) This is also solved now . I have added this configuration in main jacocoTestReport block:-
Copy code
executionData.from fileTree(dir: project.buildDir, includes: ['jacoco/test.exec','jacoco/smokeTest.exec'])
(3) This is also working. Thanks team for the help!! You guys are awesome.