Replies: 5 comments 4 replies
-
You can use |
Beta Was this translation helpful? Give feedback.
-
Yes but how can I use one of this tools with gauge ?
As these tools are based on junit runner and gauge not, I don’t find a way to have the code coverture by my gauge tests.
… Le 3 févr. 2023 à 10:50, lirany1 ***@***.***> a écrit :
The gauge validate command verifies if your specs are well formed and free of syntax errors. This helps you catch any issues with your specs before executing them, ensuring that your tests run smoothly and accurately.
So AFAIK the option to use JaCoCo, Cobertura, Codecov, Clover, etc are the probably the best for you.
—
Reply to this email directly, view it on GitHub, or unsubscribe.
You are receiving this because you authored the thread.
|
Beta Was this translation helpful? Give feedback.
-
I tested this gradle conf, but unlikely this is not good.
Gauge is executed before Jacoco but not during the jacoco measurement so the jacoco report doesn’t consider code cover by gauge.
I think I need a junit runner for gauge or a jacoco instrumentation of an non junit test or an intern gauge coverage.
… Le 3 févr. 2023 à 18:32, lirany1 ***@***.***> a écrit :
If you are using Gradle -> you need to first apply the Jacoco plugin in your build.gradle file and configure it. Then, you can add a task to generate the Jacoco coverage report after the gaugeTask task(if you are using Gauge gradle plugin).so the build.gradle file will be something like:
plugins {
id 'jacoco'
}
jacoco {
toolVersion = '0.8.5'
}
task gaugeTask(type: GaugeTask) {
doFirst {
gauge {
tags = "$gaugeTags"
specsDir = 'specs'
inParallel = true
nodes = 4
env = "$gaugeEnv"
additionalFlags = '--max-retries-count=4 --retry-only=should-retry'
}
}
}
task jacocoTestReport(type: JacocoReport) {
dependsOn gaugeTask
group = "Reporting"
description = "Generate Jacoco coverage reports"
sourceDirectories.setFrom fileTree(project.rootProject.projectDir.toString() + '/src/test/java')
classDirectories.setFrom files([
fileTree(project.rootProject.projectDir.toString() + '/build/classes/java/test')
])
reports {
xml.enabled = true
html.enabled = true
}
}
the jacocoTestReport task is dependent on the gaugeTask task. After the gaugeTask task is executed, the jacocoTestReport task will generate the Jacoco coverage report in both XML and HTML format.
—
Reply to this email directly, view it on GitHub, or unsubscribe.
You are receiving this because you authored the thread.
|
Beta Was this translation helpful? Give feedback.
-
Thanks, I will try.
I also want to try to create a junit runner which call the start command of gauge-Java instead of the gradle plug-in.
Is there really no work in gauge team to propose code coverage ? Test solution and code coverage are not separable in my way of dev.
… Le 4 févr. 2023 à 06:52, Srikanth ***@***.***> a écrit :
Gauge does not have this support out of the box, largely because gauge is framework agnostic.
You will have to instrument the execution and tap the coverage stuff.
You may want to try something like this - https://stackoverflow.com/a/64701493
—
Reply to this email directly, view it on GitHub, or unsubscribe.
You are receiving this because you authored the thread.
|
Beta Was this translation helpful? Give feedback.
-
Worth trying it out.
Unfortunately yes, most core developers have got other things at hand presently. That said we do try to spend some time to review pull requests.
That is a good philosophy, but I have only used it for unit tests. Higher tests such as User Journey tests end up consuming many part of the application, so in my experiment (which I did back in 2010), a simple happy path functional test ended up touching 72% of the codebase. |
Beta Was this translation helpful? Give feedback.
-
I want to have code coverage indicator for my spring projects.
Is-it possible and how have gauge specifications and code coverage ?
Beta Was this translation helpful? Give feedback.
All reactions