Failing to upload junit artifacts does not fail job

Summary

Failing to upload junit artifacts does not fail job

Steps to reproduce

See commit Stalle/junit-report-error-test@7f60c1d5

This introduces and error in the configuration of where to find the junit results.

Example Project

https://gitlab.com/Stalle/junit-report-error-test

What is the current bug behavior?

CI output a warning and a error but the job still succeeds.

What is the expected correct behavior?

The jobs should fails since it does not find any reports. Alternatively there should be something like jenkins pipeline's junit allowEmptyResults:true

The description in jenkins kinda describes why the current way is bad: "Please note that this setting (allowEmptyResults) make it harder to spot misconfigured jobs or build failures where the test tool does not exit with an error code when not producing test report files."

Relevant logs and/or screenshots

See pipeline https://gitlab.com/Stalle/junit-report-error-test/-/jobs/313713079 Shows a simple gradle projects where the path to the junit reports are incorrect and no files are found. The output even says:

WARNING: */build/test-results/*/*.xml: no matching files 
ERROR: No files to upload 

This should be a error.

Output of checks

This bug happens on GitLab.com

Possible fixes

Assignee Loading
Time tracking Loading