flaxoos / flax-gradle-plugins Goto Github PK
View Code? Open in Web Editor NEWBespoke Gradle Plugins
License: MIT License
Bespoke Gradle Plugins
License: MIT License
When the addKoverBadge
command is added to the I get the following exception. Somehow looks like the plugin is not handling different decimal formats.
> Task :koverPrintCoverage
application line coverage: 88.0672%
...
Execution failed for task ':addKoverBadge'.
> For input string: "88,07"
...
Caused by: java.lang.NumberFormatException: For input string: "88,07"
at java.base/jdk.internal.math.FloatingDecimal.readJavaFormatString(FloatingDecimal.java:2054)
at java.base/jdk.internal.math.FloatingDecimal.parseFloat(FloatingDecimal.java:122)
at io.github.flaxoos.kover.KoverBadgeTask.getTestCoverage(KoverBadgeTask.kt:200)
at io.github.flaxoos.kover.KoverBadgeTask.editReadme(KoverBadgeTask.kt:140)
I would expect the plugin to work, regardless of the format used in the input string, and would update the README.md file with a suitable coverage value.
The current implementation of the plugin badge limitations when it comes to identifying the coverage when the kover plugin is configured with metrictype
and groupBy
to anything other than "line" and "application" respectivly, the plugin fails to pick up any coverage information. This is due to the hard-coded string search logic, making the plugin less flexible for users with different configuration needs.
This is where the issue would come from, and probably where the solution would be
log {
// Add a header line to the output before the lines with coverage
header = null
// Format of the strings to print coverage for the specified in `groupBy` group
format = "<entity> line coverage: <value>%"
// Specifies by which entity the code for separate coverage evaluation will be grouped
groupBy = GroupingEntityType.APPLICATION
// Specifies which metric is used for coverage evaluation
coverageUnits = MetricType.LINE
// Specifies aggregation function that will be calculated over all the elements of the same group
aggregationForGroup = AggregationType.COVERED_PERCENTAGE
}
I suggest modifying the Kover plugin to allow more dynamic string matching when looking for coverage data. One approach could be to introduce an option to specify a custom string or header to look for when aggregating coverage information. Alternatively, the plugin could be designed to simply search for the term "coverage" to make it more universally applicable, regardless of metrictype
and groupBy
settings. If it's possible, integrating these changes into the Kover extension by the badge plugin would be ideal.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.