Skip to content

Misleading spurious error when artifacts:reports:junit file does not exist.

Summary

When using gitlab-ci includes, it is often the case that you add more to inherited artifacts to export. When files don't exist, a warning in the job logs will be issued. In the case of a file specified in 'artifacts:reports:junit' does not exist, then a warning then an error is logged and job succeeds.

Steps to reproduce

Create a job with the following:

  artifacts:
    paths:
      - coverage.*
      - public/
    reports:
      junit: public/unitreport.xml
    when: always

You'll get logs like this:

Uploading artifacts...
public/: found 1 matching files
WARNING: coverage.*: no matching files
Uploading artifacts to coordinator... ok id=123456 responseStatus=201 Created token=XXXXXXX
Uploading artifacts...
WARNING: public/unitreport.xml: no matching files
ERROR: No files to upload
Job succeeded

What is the current bug behavior?

WARNING + ERROR and "Job succeeed" is shown. This is confusing.

What is the expected correct behavior?

Only one is shown

Edited by Julien Lecomte