gitlab ci/cd 将工件作为“junit”上传到协调器...失败 500

时间:2021-06-16 08:23:01

标签: gitlab gitlab-ci pipeline gitlab-ci-runner

我想用一个包含一个主类和一个测试类的简单 helloWorld 项目来测试 gitlab ci/cd,使用 ant 构建,但是当我运行管道时,它给了我这个错误:< /p>

WARNING: Uploading artifacts as "junit" to coordinator... failed  id=13076195 responseStatus=500 Internal Server Error status=500 token=fxB2Np58
WARNING: Retrying...                                context=artifacts-uploader error=invalid argument
WARNING: Uploading artifacts as "junit" to coordinator... failed  id=13076195 responseStatus=500 Internal Server Error status=500 token=fxB2Np58
WARNING: Retrying...                                context=artifacts-uploader error=invalid argument
WARNING: Uploading artifacts as "junit" to coordinator... failed  id=13076195 responseStatus=500 Internal Server Error status=500 token=fxB2Np58 FATAL: invalid argument                             Cleaning up file based variables 00:00 ERROR: Job failed: command terminated with exit code 1

这是我的gitlab-ci.yml

image: java:latest
     
stages:
  - test

test-stage:    
  image: frekele/ant    
  stage: test   
  script:
    - echo starting tests
    - ant junit
  artifacts:     
    paths: 
      - $CI_PROJECT_DIR/build/junitreport
    reports: 
      junit: $CI_PROJECT_DIR/build/junitreport
  when: always

1 个答案:

答案 0 :(得分:0)

我修复了它.. 我在 gitlab-ci.yml 文件中犯了一个错误

在 artifact:paths 和 artifact:reports:junit 标签中,我应该在路径中添加 /*.xml :

神器:
路径: - $CI_PROJECT_DIR/build/junitreport/*.xml

报告: junit: $CI_PROJECT_DIR/build/junitreport/*.xml 什么时候:总是