zyborg / dotnet-tests-report

GitHub Action to run .NET Core tests and generate report attached to Workflow Run
MIT License
112 stars 36 forks source link

Unable to figure the badge URL #6

Closed RyanONeill1970 closed 3 years ago

RyanONeill1970 commented 3 years ago

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?

`

`

ebekker commented 3 years ago

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 commented 3 years ago

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 commented 3 years ago

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.

RyanONeill1970 commented 3 years ago

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

ebekker commented 3 years ago

Related: https://github.com/github/docs/issues/2403