mikepenz/action-junit-report

fail_on_failure = false marks the step as failed when a test fails

fasmat opened this issue · 8 comments

I have a job that runs unit tests. Some of these tests fail. I have the following step in my job:

- name: Publish Test Report
  uses: mikepenz/action-junit-report@v3
  if: always()
  with:
    report_paths: "**/unit-tests.xml"
    fail_on_failure: false

This step fails when any test in unit-tests.xml failed, although fail_on_failure is set to false.

@fasmat do you have some additional details on this please.

The action fails either if:

It would be helpful to see with what message it fails.

Hi @mikepenz, thanks for your quick response.

A token is set, and tests cases were found. When all tests pass the build step is marked as successful and shows the number of executed and skipped tests.

If some tests fail the step executing the tests is marked as successful, but the step using mikepenz/action-junit-report@v3 using fail_on_failure: false is marked as failing:

Screenshot 2022-10-04 at 17 40 50

Screenshot 2022-10-04 at 17 40 58

Oh I see now. It's not the step which fails:
Screenshot 2022-10-04 at 17 56 16

You are referencing to the status of the check:
https://github.com/mikepenz/action-junit-report/blob/main/src/annotator.ts#L96

Currently that one will have the respective conclusion of the test results.

If you only want the annotation you could enable annotate_only=true and have a job summary being posted at the end

annotate_only=true did the trick. Thanks 😃