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

How do I disable checks? i.e. just get red/green step/job/workflow based on unit test results #491

Closed
MPV opened this issue Sep 20, 2023 · 6 comments · Fixed by #532
Closed

Comments

@MPV
Copy link
Contributor

MPV commented Sep 20, 2023

How can I disable anything but red/green status of the step using this action?

I want

  • Failing tests to fail my step/job/workflow. ❌
  • Green tests to pass my step/job/workflow. ✅

I do not want

  • PR annotations ❌
  • PR checks ❌
  • PR comment ✅
  • PR job summary ✅
  • PR check summary ✅

Here's what I have tried:

      - name: Publish Test Results
        uses: EnricoMi/publish-unit-test-result-action/composite@283dea176069279a9076e77b548668a8e4f0c31b # v2.9.0
        with:
          files: "junitreport/*.xml"
          check_name: ${{ matrix.test }} results
          # This job should fail if tests fail:
          fail_on: "test failures"
          action_fail: true
          # This job should not upload test results to the PR (as it's grouped across these "matrix" jobs in the next "publish" job):
          check_run_annotations: none
          job_summary: false
          comment_mode: off

I thought action_fail was there for this particular purpose?

But when I run the above, I get for example this (at the moment I have an invalid path to my junit xml):

Publish Test Results
  2023-09-20 06:48:51 +0000 - publish -  INFO - Available memory to read files: 34.3 GiB
  2023-09-20 06:48:51 +0000 - publish - WARNING - Could not find any files for junitreport/*.xml
  2023-09-20 06:48:51 +0000 - publish -  INFO - Finished reading 0 files in 0.00 seconds
  2023-09-20 06:48:52 +0000 - publish -  INFO - Publishing neutral results for commit b13c20a54a9858a83a7827d621e724a2b4666f6b
  2023-09-20 06:48:54 +0000 - publish -  INFO - Created check https://github.com/my-org/my-repo/runs/123123123123
  2023-09-20 06:48:54 +0000 - publish -  INFO - Commenting on pull requests disabled
  Warning: Could not find any files for junitreport/*.xml

Also, as I tried to denote with ❌ / ✅ above, I am still getting "PR checks" and annotations.

@MPV MPV changed the title How do I disable checks? How do I disable checks? i.e. just get red/green step/job/workflow based on unit test results Sep 20, 2023
@EnricoMi
Copy link
Owner

Checks and annotations cannot be disabled right now, that might be added in the future.

With your config, the action should behave as expected (except for the checks and annotations), but this requires the action to find test results.

@MPV
Copy link
Contributor Author

MPV commented Sep 27, 2023

@EnricoMi Thanks for the feedback.

Do we agree that it would be useful/sensible to have this action fail if it doesn't find the test results?
Is that supported already, then how? If not, should I open a new issue for that?

@MPV
Copy link
Contributor Author

MPV commented Sep 27, 2023

It seems I got rid of the annotations by setting ignore_runs: true, thus this is how far I get:

  • PR annotations ✅
  • PR checks ❌
  • PR comment ✅
  • PR job summary ✅
  • PR check summary ✅

To summarize, thus it's "just":

  1. the checks I want to be able to disable
  2. and have it fail when test result files aren't found

@TurnrDev
Copy link
Contributor

Checks and annotations cannot be disabled right now, that might be added in the future.

I have a PR for that, can you take a look? #532

@EnricoMi
Copy link
Owner

2. and have it fail when test result files aren't found

You should get this by adding action_fail_on_inconclusive: true to your config.

@EnricoMi
Copy link
Owner

Fix has been released: https://github.com/EnricoMi/publish-unit-test-result-action/releases/tag/v2.12.0

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

Successfully merging a pull request may close this issue.

3 participants