Skip to content

Finding coverage not possible for non default kover.log settings #3

@Flaxoos

Description

@Flaxoos

⚠️ Is your feature request related to a problem? Please describe

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
        }

💡 Describe the solution you'd like

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.

🤚 Do you want to develop this feature yourself?

  • [] Yes
  • [] No
  • If no else does

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions