Code Monkey home page Code Monkey logo

Comments (11)

gmetal avatar gmetal commented on July 28, 2024 3

@PavanMudigondaTR I can confirm that it is now working properly (v4.3).
With:

          skip_check_run: true
          publish_only_summary: false

the coverage-results.md file is generated properly and I can archive it, with something like the following:

      - name: Upload Code Coverage Artifacts
        uses: actions/upload-artifact@v2
        with:
          name: code-coverage-report
          path: "*/coverage-results.md"
          retention-days: 1

from jacoco-reporter.

PavanMudigonda avatar PavanMudigonda commented on July 28, 2024 1

@gmetal Github REST API has a limit of 65K chars for creating checkrun. Its limitation on Microsoft/Github side. I will take this request as enhancement and i will look in to using GitHub GraphQL API instead but i can't promise any timeline since i happened to be busy at moment.

from jacoco-reporter.

PavanMudigondaTR avatar PavanMudigondaTR commented on July 28, 2024 1

@gmetal
I have fully fixed it in v4.3 and well tested in https://github.com/PavanMudigonda/jacoco-playground/actions
you are welcome to try out as per my https://github.com/PavanMudigonda/jacoco-reporter/blob/main/README.md

from jacoco-reporter.

PavanMudigonda avatar PavanMudigonda commented on July 28, 2024

@gmetal I tried to solve it by using GitHub Graph API but i got the same error....GitHub has hard limit on how many characters that can be posted as CheckRun. I will find a way to slim down report or only publish summary.

from jacoco-reporter.

gmetal avatar gmetal commented on July 28, 2024

@PavanMudigonda I think that publishing a summary would a safer approach. It would also cover most scenarios I believe.

from jacoco-reporter.

PavanMudigonda avatar PavanMudigonda commented on July 28, 2024

@gmetal Please try again with your report that is about 1.3Mb). Use below parameters.

uses: PavanMudigonda/[email protected],
publish_only_summary: true

- name: JaCoCo Code Coverage Report
  id: jacoco_reporter
  uses: PavanMudigonda/[email protected]
  with:
    coverage_results_path: ${{ github.workspace }}/build/reports/jacoco/testCoverage/testCoverage.xml
    coverage_report_name: Coverage
    coverage_report_title: JaCoCo
    github_token: ${{ secrets.GITHUB_TOKEN }}
    skip_check_run: false
    minimum_coverage: 80
    fail_below_threshold: false
    publish_only_summary: true

image

from jacoco-reporter.

PavanMudigonda avatar PavanMudigonda commented on July 28, 2024

You should see 12.48 %

Covered Lines: 1125
Missed Lines: 7888
Total Lines: 9013
Coverage % : 12.48 %

from jacoco-reporter.

PavanMudigondaTR avatar PavanMudigondaTR commented on July 28, 2024

@gmetal

I have made another workaround for this 65k problem. Please see below with this i do skip check run and then generate markdown file and upload to GitHub assets which you can download and view offline using VS Code. I hope this helps you and your team !

https://github.com/PavanMudigonda/jacoco-playground/actions/runs/2173239744

jobs:
test:
runs-on: ubuntu-latest
steps:

  # generates coverage-report.md and publishes as checkrun
  - name: JaCoCo Code Coverage Report
    id: jacoco_reporter
    uses: PavanMudigonda/[email protected]
    with:
      coverage_results_path: jacoco-report/test.xml
      coverage_report_name: Coverage
      coverage_report_title: JaCoCo
      github_token: ${{ secrets.GITHUB_TOKEN }}
      skip_check_run: true
      minimum_coverage: 80
      fail_below_threshold: false
      publish_only_summary: false
      
  # uploads the coverage-report.md artifact    
  - name: Upload Code Coverage Artifacts
    uses: actions/upload-artifact@v2
    with:
      name: code-coverage-report
      path: */coverage-results.md 
      retention-days: 1  

from jacoco-reporter.

gmetal avatar gmetal commented on July 28, 2024

@PavanMudigonda I tried the 2.6 version (the summary version) and it worked fine. I also gave 2.7 a go as per your instructions, but I got the original error.

from jacoco-reporter.

PavanMudigondaTR avatar PavanMudigondaTR commented on July 28, 2024

@PavanMudigonda I tried the 2.6 version (the summary version) and it worked fine. I also gave 2.7 a go as per your instructions, but I got the original error.

@gmetal
Could you try v3.0 as i have fixed few other problems.

Scenario# 1:- Generate summary report as checkrun

generates coverage-report.md and publishes as checkrun

  • name: JaCoCo Code Coverage Report
    id: jacoco_reporter
    uses: PavanMudigonda/[email protected]
    with:
    coverage_results_path: jacoco-report/test.xml
    coverage_report_name: Coverage
    coverage_report_title: JaCoCo
    github_token: ${{ secrets.GITHUB_TOKEN }}
    skip_check_run: false # set to false to publish check run
    minimum_coverage: 80
    fail_below_threshold: false # set to false to pass below even when threshold is not met
    publish_only_summary: true. #set to true to publish only summary to avoid 65k problem

Scenario# 2 Generate full report and view offline by downloading coverage artifact

generates coverage-report.md and publishes as checkrun

  • name: JaCoCo Code Coverage Report
    id: jacoco_reporter
    uses: PavanMudigonda/[email protected]
    with:
    coverage_results_path: jacoco-report/test.xml
    coverage_report_name: Coverage
    coverage_report_title: JaCoCo
    github_token: ${{ secrets.GITHUB_TOKEN }}
    skip_check_run: true # set to true to skip the run and to avoid 65k problem
    minimum_coverage: 80
    fail_below_threshold: false
    publish_only_summary: false #set to false to generate full coverage report

uploads the coverage-report.md artifact for offline viewing using VS Code

  • name: Upload Code Coverage Artifacts
    uses: actions/upload-artifact@v2
    with:
    name: code-coverage-report
    path: */coverage-results.md
    retention-days: 1

from jacoco-reporter.

gmetal avatar gmetal commented on July 28, 2024

@PavanMudigonda Hello, I had a go at version 3 of the action. When using the skip_check_run: true, then no artifacts get generated. If that is set to false, then the coverage-results.md is not generated. With skip_check_run:false and the publish_only_summary: false the I run into the 65k problem again.

from jacoco-reporter.

Related Issues (20)

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.