Closed gmetal closed 2 years ago
@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.
@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.
@PavanMudigonda I think that publishing a summary would a safer approach. It would also cover most scenarios I believe.
@gmetal Please try again with your report that is about 1.3Mb). Use below parameters.
uses: PavanMudigonda/jacoco-reporter@v2.6,
publish_only_summary: true
- name: JaCoCo Code Coverage Report
id: jacoco_reporter
uses: PavanMudigonda/jacoco-reporter@v2.6
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
You should see 12.48 %
Covered Lines: 1125 Missed Lines: 7888 Total Lines: 9013 Coverage % : 12.48 %
@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/jacoco-reporter@v2.7
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
@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.
@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
Scenario# 2 Generate full report and view offline by downloading coverage artifact
name: JaCoCo Code Coverage Report id: jacoco_reporter uses: PavanMudigonda/jacoco-reporter@v2.7 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
@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.
@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
@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
Describe the bug If the action is used with a coverage report that produces an output greater than 65535 characters long, then the action fails,.
Steps to reproduce the behavior:
Expected behavior The report gets generated correctly
Screenshots The report produces the following (partially redacted) log: