我正在尝试在Gitlab CI上上传J单元报告(这些是我的赛普拉斯自动化框架的测试结果)。我正在使用Junit-merge。由于赛普拉斯(Cypress)的体系结构(每个测试都是单独进行的),因此报告需要额外的“合并”才能将报告放入一个文件中。本地一切正常:
试图在本地调试它,但是在本地一切正常。我可能想到的是:合并脚本处理不正确,或者Gitlab不接受.xml文件的相对路径。
{ “ baseUrl”:“ https://www-acc.anwb.nl/”,
“ reporter”:“ mocha-junit-reporter”,
“ reporterOptions”:{
"mochaFile": "results/resultsreport.[hash].xml",
"testsuiteTitle": "true"
} }
cypress-e2e:
image: cypress/base:10
stage: test
script:
- npm run cy:run:staging
- npx junit-merge -d results -o results/results.xml
artifacts:
paths:
- results/results.xml
reports:
junit: results/results.xml
expire_in: 1 week
同样,在本地一切正常。我从gitlab Ci中得到的错误是:
正在上传工件...
警告:results / results.xml:没有匹配的文件
错误:没有要上传的文件
错误:作业失败:退出代码1
答案 0 :(得分:1)
---Select---
这意味着下一个配置应解决此问题:
Artifacts can only exist in
directories relative to the build directory and specifying paths which don't
comply to this rule trigger an unintuitive and illogical error message (an
enhancement is discussed at
gitlab-ce#15530
). Artifacts need to be uploaded to the GitLab instance (not only the GitLab
runner) before the next stage job(s) can start, so you need to evaluate
carefully whether your bandwidth allows you to profit from parallelization
with stages and shared artifacts before investing time in changes to the
setup.