Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Cobertura Reporter - Reports 0.0 for line rate at the package level #1268

Closed
@BrandonMercerSC

Description

@BrandonMercerSC

Describe the bug
The ut_coverage_cobertura_reporter does not seem to be calculating line rate coverage at a package level. Only the summarized coverage is provided.

<?xml version="1.0" encoding="US-ASCII"?>
<!DOCTYPE coverage SYSTEM "http://cobertura.sourceforge.net/xml/coverage-04.dtd">
<coverage line-rate="1.0" branch-rate="0.0" lines-covered="11" lines-valid="11" branches-covered="0" branches-valid="0" complexity="0" version="1" timestamp="1695388568.000000000000000000000000000003">
<sources>
<source>/demo/src/award_bonus/award_bonus.prc</source>
<source>/demo/src/between_string/betwnstr.fnc</source>
<source>/demo/src/remove_rooms_by_name/remove_rooms_by_name.prc</source>
</sources>
<packages>
<package name="AWARD_BONUS" line-rate="0.0" branch-rate="0.0" complexity="0.0">
<classes>
<class name="AWARD_BONUS" filename="/demo/src/award_bonus/award_bonus.prc" line-rate="0.0" branch-rate="0.0" complexity="0.0">
<lines>
<line number="6" hits="2" branch="false"/>
<line number="10" hits="2" branch="false"/>
<line number="11" hits="1" branch="false"/>
<line number="13" hits="1" branch="false"/>
</lines>
</class>
</classes>
</package>
<package name="BETWNSTR" line-rate="0.0" branch-rate="0.0" complexity="0.0">
<classes>
<class name="BETWNSTR" filename="/demo/src/between_string/betwnstr.fnc" line-rate="0.0" branch-rate="0.0" complexity="0.0">
<lines>
<line number="2" hits="5" branch="false"/>
<line number="4" hits="5" branch="false"/>
<line number="5" hits="3" branch="false"/>
<line number="7" hits="5" branch="false"/>
</lines>
</class>
</classes>
</package>
<package name="REMOVE_ROOMS_BY_NAME" line-rate="0.0" branch-rate="0.0" complexity="0.0">
<classes>
<class name="REMOVE_ROOMS_BY_NAME" filename="/demo/src/remove_rooms_by_name/remove_rooms_by_name.prc" line-rate="0.0" branch-rate="0.0" complexity="0.0">
<lines>
<line number="3" hits="3" branch="false"/>
<line number="4" hits="1" branch="false"/>
<line number="6" hits="2" branch="false"/>
</lines>
</class>
</classes>
</package>
</packages>
</coverage>

Provide version info
Oracle Database 19c Enterprise Edition Release 19.0.0.0.0 - Production
utPLSQL - v3.1.13.3592

Information about client software
utPLSQLl-cli - v3.1.9

To Reproduce

  1. Download the demo project. example: https://github.com/utPLSQL/utPLSQL-demo-project/tree/fix/coverage_fix
  2. Execute the tests using the ut_coverage_cobertura_reporter
  3. Note that the summary contains the line rate but the packages within do not. Sample report of above branch execution
  4. Include a reporter that interprets cobertura coverage reports such as the following github action

Expected behavior

The cobertura coverage report should include line rate at the package level not just the project level.

Example code
You can add the following steps to your github workflow so that you can get PR coverage reporting summary for faster analysis of the issue

      - name: Checkout code
        uses: actions/checkout@v4

#or
      - name: Download test artifact
        uses: actions/[email protected]
        with:
          name: test-output
          path: ./results/ 

      - name: Code Coverage Report
        uses: irongut/[email protected]
        with:
          filename: results/cobertura.xml
          badge: true
          fail_below_min: true
          format: markdown
          hide_branch_rate: false
          hide_complexity: true
          indicators: true
          output: both
          thresholds: "60 80"

      - name: Add Coverage PR Comment
        uses: marocchino/sticky-pull-request-comment@v2
        if: github.event_name == 'pull_request'
        with:
          recreate: true
          path: code-coverage-results.md

      - name: Write Coverage Summary to Job Summary
        run: cat code-coverage-results.md >> $GITHUB_STEP_SUMMARY

image

Additional context
Add any other context about the problem here.

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions