Giter VIP home page Giter VIP logo

clovercodecoveragesummary's People

Contributors

dependabot[bot] avatar eloisetaylor5693 avatar saschanowak avatar

Watchers

 avatar

clovercodecoveragesummary's Issues

Parser fails when multiple classes are declared within single file

First of all, thank you for this useful action, great job!

There is an issue when the codebase contains files that declare multiple classes. The clover.xml will look something like the below:

    <file name="{filePath}">
      <class name="{class1}" namespace="global">
        <metrics complexity="3" methods="3" coveredmethods="0" conditionals="0" coveredconditionals="0" statements="6" coveredstatements="0" elements="9" coveredelements="0"/>
      </class>
      <class name="{class2}" namespace="global">
        <metrics complexity="0" methods="0" coveredmethods="0" conditionals="0" coveredconditionals="0" statements="0" coveredstatements="0" elements="0" coveredelements="0"/>
      </class>
      <line num="17" type="method" name="xxx" visibility="public" complexity="1" crap="2" count="0"/>
      .....    
      <metrics loc="43" ncloc="40" classes="1" methods="3" coveredmethods="0" conditionals="0" coveredconditionals="0" statements="6" coveredstatements="0" elements="9" coveredelements="0"/>
    </file>

That means a single <file> element will have multiple <class> children.

In that case, the parse will fail with ::error::Cannot read properties of undefined (reading '@_statements') here

reportData.coverage.project.file is not iterable

When using this github action I get the error:
Error: reportData.coverage.project.file is not iterable

My setup

"jest": "^27.0.0",

To generate the clover coverage report I'm running: jest --ci --coverage which generates the folder in the root of my project
image

The workflow file:

permissions:
  checks: write
  contents: read
  packages: read
  pull-requests: write

jobs:
  test:
    name: Test
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v3
      - uses: actions/setup-node@v3
        with:
          node-version-file: '.nvmrc'
      - uses: actions/cache@v3
        with:
          path: |
            node_modules
            ~/.cache/Cypress
          key: node-${{ hashFiles('yarn.lock') }}
      - run: yarn --frozen-lockfile --check-files
      - run: yarn test:ci
      - name: Clover Code Coverage Summary
        uses: saschanowak/[email protected]
        with:
          filename: ./coverage/clover.xml
      - name: 'Add Code Coverage to Job Summary'
        run: |
          cat code-coverage-summary.md >> $GITHUB_STEP_SUMMARY
          cat code-coverage-details.md >> $GITHUB_STEP_SUMMARY

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.