Skip to content

Unable to figure the badge URL #6

New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Closed
RyanONeill1970 opened this issue Nov 28, 2020 · 5 comments
Closed

Unable to figure the badge URL #6

RyanONeill1970 opened this issue Nov 28, 2020 · 5 comments
Labels
bug Something isn't working cantfix

Comments

@RyanONeill1970
Copy link

I've got the action running against a bunch of tests and it runs them all correctly but I don't understand how to construct the badge reference.

It is possible that the build has not completed as the following is output near the bottom of the log;

Resolve Repo Full Name as TheGeneGenieProject/GeneGenie.DataQuality

Adding Check Run

Invoke-WebRequest: /home/runner/work/_actions/zyborg/dotnet-tests-report/v1.0.0/action.ps1:103
Line |
103 | Invoke-WebRequest -Headers $hdr $url -Method Post -Body ($bdy | C …
| ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
| {"message":"Invalid request.\n\nOnly 65535 characters are
| allowed; 174429 were
| supplied.","documentation_url":"https://docs.github.com/rest/reference/checks#create-a-check-run"}

My workflow has the following step based on the sample. Am I doing something daft?

`
- name: Unit tests
uses: zyborg/dotnet-tests-report@v1.0.0
with:
project_path: GeneGenie.DataQuality.Tests
report_name: unit_test_results
report_title: Unit test results
github_token: ${{ secrets.GITHUB_TOKEN }}
gist_name: unit_tests.md
gist_badge_label: 'Unit tests: %Counters_passed%/%Counters_total%'
gist_token: ${{ secrets.GIST_TOKEN }}

`

@ebekker
Copy link
Member

ebekker commented Nov 30, 2020

Hmm, it looks like the Checks message payload is exceeding the limit, I'm guessing you have a lot of tests?

Are you saying the "embedded" test results are getting generated correctly, but only the badge in the Gist is not being generated?

@ebekker
Copy link
Member

ebekker commented Nov 30, 2020

I looked through your Workflow runs that failed with this, and it does appear to be the issue is calling the Check Run API to attach the report to the Workflow because the test results are just too big.

So, you can skip attaching to the Check Run (the Workflow instance) and just create/update a Gist with the test results, and then should be able to accommodate a much larger (limitless?) test result size, and the Badge is generated to a Gist test result anyway so you should be able to get the results you intend.

Here's the doc for skipping the Check Run attachment: skip_check_run

@ebekker
Copy link
Member

ebekker commented Nov 30, 2020

I'm going to close this issue for now since this appears to be the issue, and there's really no way for me to correct this as it's a limitation of the Check Run API, but the work around above should work nicely. If you think otherwise, you can reopen.

@ebekker ebekker closed this as completed Nov 30, 2020
@ebekker ebekker added bug Something isn't working cantfix labels Nov 30, 2020
@RyanONeill1970
Copy link
Author

That's very helpful, thank you. Not a lot of tests in there really, but I appreciate that is the GitHub API.

@ebekker
Copy link
Member

ebekker commented Jan 8, 2021

Related: github/docs#2403

# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
bug Something isn't working cantfix
Projects
None yet
Development

No branches or pull requests

2 participants