Skip to content
New issue

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

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

Already on GitHub? Sign in to your account

Invalid JSON for check run / results gist - build failure? #13

Open
flexplate opened this issue Feb 8, 2021 · 9 comments
Open

Invalid JSON for check run / results gist - build failure? #13

flexplate opened this issue Feb 8, 2021 · 9 comments

Comments

@flexplate
Copy link

I'm seeing some strange behaviour with my test process. It runs my tests successfully and seems to generate an output, but then tries and fails to add a check run, citing invalid JSON:

Invoke-WebRequest: /home/runner/work/_actions/zyborg/dotnet-tests-report/v1.3.0/action.ps1:144
Line |
 144 |      Invoke-WebRequest -Headers $hdr $url -Method Post -Body ($bdy | C …
     |      ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
     | {"message":"Problems parsing
     | JSON","documentation_url":"https://docs.github.com/rest/reference/checks#create-a-check-run"}

It also fails to create a results gist, with the same error at line 235.

I did notice it failed to build the solution, but since the tests ran successfully I'm not sure if this is related:

 Results File: /home/runner/work/geodesy-csharp/geodesy-csharp/_TMP/test-results.trx

Test Run Failed.
Total tests: 81
     Passed: 75
     Failed: 6
 Total time: 1.6010 Seconds
     3>Done Building Project "/home/runner/work/geodesy-csharp/geodesy-csharp/geodesy-test/geodesy-test.csproj" (VSTest target(s)) -- FAILED.
     1>Done Building Project "/home/runner/work/geodesy-csharp/geodesy-csharp/geodesy-csharp.sln" (VSTest target(s)) -- FAILED.

Build FAILED.
    0 Warning(s)
    0 Error(s)

Time Elapsed 00:00:05.25
Warning: Execution of tests returned failure: 1
@TCBroad
Copy link

TCBroad commented Mar 9, 2021

I'm getting the same thing when I run tests for the whole solution (over 2000 tests). If I run smaller individual test suites it uploads successfully. Could be to do with the 64k character limit but I'm getting the exact error described above and not the one from #9

Edit to add - I have now tested it with a single large suite of tests and it fails to upload the check run or gist, so it isn't related to having multiple suites running.

image

image

@ebekker
Copy link
Member

ebekker commented Apr 1, 2021

Can you try to disable the Check Run reports by enabling the skip_check_run flag, and then enabling Gist-based reports using the gist_name and gist_token inputs and see if you still get this error?

@TCBroad
Copy link

TCBroad commented Apr 6, 2021

I get a similar error when it tries to create the gist:

image

@ebekker
Copy link
Member

ebekker commented Apr 6, 2021

This isn't accessible on a public GitHub project by any chance, is it?

@TCBroad
Copy link

TCBroad commented Apr 6, 2021

I'm afraid not but I might be able to help you out with bits of logs or any other info. Also happy to try any changes you might suggest - I did fork the repo but then had other work to do so never bothered investigating further.

@ebekker
Copy link
Member

ebekker commented Apr 6, 2021

If you reduce the number of tests, does it also fix the call to create the Gist?

@TCBroad
Copy link

TCBroad commented Apr 6, 2021 via email

@ebekker
Copy link
Member

ebekker commented Apr 6, 2021

I was looking at the documentation for some indication of a limit on the payload for creating Gists, but it doesn't mention anything, I'll need to play around with it and see if I can nail it down.

In the mean time, could you possibly work around the issue by breaking your batch of 2000+ tests into several smaller batches? If you are categorizing, perhaps run each category as a separate batch with separate result reports?

@flexplate
Copy link
Author

Apologies for bumping a 6-month old issue but I thought I'd give it another go since there have been multiple releases since last time I tried it. I can confirm that this issue still persists in 1.4.4 and that setting skip_check_run: true still raises the invalid JSON error:

Creating initial Tests Report Gist

Invoke-WebRequest: /home/runner/work/_actions/zyborg/dotnet-tests-report/v1.4.4/action.ps1:229
Line |
 229 |  … eGistResp = Invoke-WebRequest -Headers $apiHeaders -Uri $gistsApiUrl  …
     |                ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
     | {"message":"Problems parsing
     | JSON","documentation_url":"https://docs.github.com/rest/reference/gists#create-a-gist"}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants