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

Save Test Results to File or Action Output #1148

Open
ChrisPage-AT opened this issue Mar 12, 2024 · 6 comments
Open

Save Test Results to File or Action Output #1148

ChrisPage-AT opened this issue Mar 12, 2024 · 6 comments
Labels
type: enhancement New feature or request

Comments

@ChrisPage-AT
Copy link

Would it be possible to have an option to save the test results to a file instead of posting a job summary? My use case is I am using the parallel: true flag to run across multiple runners and I want to combine the test results into one post per group: instead of each parallel run having their own. The easiest way I can think to accomplish this is to save what would normally put to the job summary into a file (json, csv, etc) and upload those as artifacts. Then I can have a job that waits for all the parallel jobs to complete, aggregates the results, and posts a single summary.

If that's not possible, I could create such a file myself if the various fields such as testResults.totalPassed were exposed as action outputs.

@MikeMcC399
Copy link
Collaborator

@ChrisPage-AT

Are you using Cypress Cloud to view your results?

Most pages on Cypress Cloud Analytics allow download reports in CSV format. It's the small cloud symbol on the top right.

  • There was also a PR feat: add test results output #949 submitted, but unfortunately there was no agreement reached between the submitter and the Cypress.io team, so eventually it was closed as being stale.

@MikeMcC399 MikeMcC399 added the type: enhancement New feature or request label Mar 12, 2024
@ChrisPage-AT
Copy link
Author

Ah, I see closed PR now. Do you know if this is something the Cypress.io team is interested in still? Those totalDuration, totalFailed, totalPassed, etc fields would help me do what I need to. The current Summary output works fine for parallel: false jobs just fine, but this would make the parallel: true jobs output much cleaner.

We do use Cypress Cloud to view the results, but not everyone has access or knows how to view the results. The $GITHUB_STEP_SUMMARY output in the test pipeline is useful for helping non-QA folks determine if they created a new test failure or if it's one that was already failing that day.

I can try and download the csv report via api call and display the information that way, but I figured just getting test output from the step would be easier since it already has that information.

@jennifer-shehane
Copy link
Member

Having the simple stats report would be fine and this was the feedback in the PR - version, totalDuration, totalFailed, totalPassed, totalPending, totalSkipped, totalSuites and totalTests. We don't want the entirety of results or config printed since this could impact performance and also opens up opportunity to users to accidentally expose secrets within the GitHub output.

@ChrisPage-AT
Copy link
Author

That would be perfectly fine since if anyone needs that much detail they can just look at the Cypress Cloud site. I'm just looking for whatever data variables you'd use for the GITHUB_STEP_SUMMARY to also be exported as outputs.

@erezarnon
Copy link

We'd also like the same thing. Our usecase is we want to grep the output to post to slack the exact test cases that failed. Is there any way to do that?

@nrgbistro
Copy link

nrgbistro commented Aug 29, 2024

+1 for this feature, I'm looking for a similar use case using parallel tests. IMO it would be cleaner and easier to read if these tables were all together in 1 summary instead of 5 different ones, since by default GitHub only shows the first 3 summaries: https://github.com/bahmutov/cypress-examples/actions/runs/10608410827

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type: enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

5 participants