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

Add Publish JUnit Test Results Action #28075

Merged
merged 3 commits into from
Aug 31, 2023
Merged

Conversation

magicgoody
Copy link
Contributor

This PR was created to add an action that visualize the results of JUnit tests and adds them to the workflow summary page and the PR page (if the PR exists).

The action requires additional permissions:
pull-requests: write (allow adding the test result to the PR page)
checks: write (allow to add test result to workflow summary page)
issues: write (allow to add the test result in order if the issue was created or it was a comment/push)

Example runs:
Push: https://github.com/magicgoody/beam/actions/runs/5926105477
Pull_request_target: https://github.com/magicgoody/beam/actions/runs/5926531661

image


Thank you for your contribution! Follow this checklist to help us incorporate your contribution quickly and easily:

  • Mention the appropriate issue in your description (for example: addresses #123), if applicable. This will automatically add a link to the pull request in the issue. If you would like the issue to automatically close on merging the pull request, comment fixes #<ISSUE NUMBER> instead.
  • Update CHANGES.md with noteworthy changes.
  • If this contribution is large, please file an Apache Individual Contributor License Agreement.

See the Contributor Guide for more tips on how to make review process smoother.

To check the build health, please visit https://github.com/apache/beam/blob/master/.test-infra/BUILD_STATUS.md

GitHub Actions Tests Status (on master branch)

Build python source distribution and wheels
Python tests
Java tests
Go tests

See CI.md for more information about GitHub Actions CI or the workflows README to see a list of phrases to trigger workflows.

@github-actions github-actions bot added the build label Aug 21, 2023
@magicgoody magicgoody marked this pull request as ready for review August 25, 2023 10:14
@github-actions
Copy link
Contributor

Assigning reviewers. If you would like to opt out of this review, comment assign to next reviewer:

R: @Abacn for label build.

Available commands:

  • stop reviewer notifications - opt out of the automated review tooling
  • remind me after tests pass - tag the comment author after tests pass
  • waiting on author - shift the attention set back to the author (any comment or push by the author will return the attention set to the reviewers)

The PR bot will only process comments in the main thread (not review comments).

@chamikaramj
Copy link
Contributor

@Abacn could you check or suggest a reviewer ?

@Abacn
Copy link
Contributor

Abacn commented Aug 29, 2023

third party action needs apache infra's approval to be able to run. Shall I make a request?

Also, if there is a test failure, is it possible to see which test and what is the reason for failure? This is the useful part. A summary of how many test run is already available in the log page, but currently the inconvenience for existing github action workflow is that when there is a test failure, there is no way to see the stack trace.

@magicgoody
Copy link
Contributor Author

Hello @Abacn

Thank you for your comment
I did a run where one task failed and the error was shown in the Test Results Summary tab.

Workflow run
https://github.com/magicgoody/beam/actions/runs/6036390451/job/16380099633

Summary Result
image

Task with Error
image

Here is the README file for the related github action used.
https://github.com/EnricoMi/publish-unit-test-result-action/blob/v2.9.0/README.md

Copy link
Contributor

@Abacn Abacn left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

awesome! That really helps!

@Abacn Abacn merged commit c1f3e12 into apache:master Aug 31, 2023
@Abacn
Copy link
Contributor

Abacn commented Aug 31, 2023

Let's get this in and see if the workflow also runs on beam repo. Possible need request permission to infra

@magicgoody
Copy link
Contributor Author

Third party action is blocked, the workflow is not running
image

@Abacn
Copy link
Contributor

Abacn commented Sep 2, 2023

As expected. created https://issues.apache.org/jira/browse/INFRA-24950 requesting enabling this action

@Abacn
Copy link
Contributor

Abacn commented Sep 11, 2023

Update: the third party workflow is whitelisted. I see a green run: https://github.com/apache/beam/actions/runs/6150041760/job/16687179322

But also there is failing run "Invalid workflow file
The workflow is not valid. Maximum object size exceeded"

https://github.com/apache/beam/actions/runs/6151946870/workflow

Will keep monitoring

@Abacn
Copy link
Contributor

Abacn commented Sep 11, 2023

Also, when we apply this plugin to all other java tests, can we also change the uploaded archive for "JUnit Test Results" from **/build/test-results/**/*.xml to **/build/reports/tests/ here, and change the condition to

if: failure()

so it would upload human readable detailed test results on failure.

path: '**/build/test-results/**/*.xml'

The current xml is not human readable, and **/build/reports/tests/ contains html that include both stack trace and stdout / stderr

@magicgoody
Copy link
Contributor Author

Hello @Abacn
Sure, thanks

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

Successfully merging this pull request may close these issues.

3 participants