mikepenz/action-junit-report

Get test report results in workflow logs as well

itsankit-google opened this issue · 8 comments

Hi, I recently switched from using https://github.com/ScaCap/action-surefire-report to this action,

Due to this existing issue with GitHub - #40, this feature of including test results in the workflow logs was really helpful in ScaCap/action-surefire-report.

ref -
image

But I cannot find something like this in this action. Is there a flag to enable it??

Okay, I see it shows the count here -
image

Will it also show the names of failed tests here, if any??

@itsankit-google while there is currently no flag to display the results as part of the logs one alternative to the reports which may end up in the wrong section, is the new Job summary feature GitHub offers. - https://docs.github.com/en/actions/using-workflows/workflow-commands-for-github-actions#adding-a-job-summary

This will build a report with tables highlighting passed and failed tests. Offering also options to have a full result listing or only a simple overview:

Screen Shot 2022-10-18 at 22 32 18

Hi @mikepenz, If I understand correctly Job Summary will be attached to the correct build summary by the action even though test report might get attached to some wrong build, is that what you intended?

@itsankit-google the issue outlined in #40 (based on all information available) is something we can't yet fix.

But GitHub introduced Job Summaries which are always attached to the particular job a given action was executed in.
While this won't solve #40 and it's no direct answer to have the result in the logs (there is currently no flag to enable report via logs - as in my experience that should be the last resort for engineers to look into) - Using the job summary would help to get the insight into the results as part of the build.

You can find it in action here for example: https://github.com/mikepenz/action-junit-report/actions/runs/3248491905#summary-8888055040

@itsankit-google the issue outlined in #40 (based on all information available) is something we can't yet fix.

But GitHub introduced Job Summaries which are always attached to the particular job a given action was executed in. While this won't solve #40 and it's no direct answer to have the result in the logs (there is currently no flag to enable report via logs - as in my experience that should be the last resort for engineers to look into) - Using the job summary would help to get the insight into the results as part of the build.

You can find it in action here for example: https://github.com/mikepenz/action-junit-report/actions/runs/3248491905#summary-8888055040

Thanks @mikepenz for the explanation.

Would that be a good fit for your requirements, or do you still believe having similar output in the console log itself may be needed?

It works for me as of now because ultimately I want a way to know which tests failed if the report got lost due to any reason. Thanks!! Really appreciate your effort.

Sometimes what happens is the tests log output is too verbose but an output like this with the reason in crisp why the tests failed really helps!!

image