[英]Jenkins not generating test report files
I am using pipline to build and run unit tests. 我正在使用pipline构建和运行单元测试。
Here is my pipeline: 这是我的管道:
pipeline {
agent any
stages {
stage('Build') {
steps {
sh '''
./system/fuge/ci/docker-up.sh
./system/fuge/ci/docker-down.sh
'''
}
}
stage('Test') {
steps {
sh '''
./system/fuge/ci/docker-up-test.sh
'''
}
}
}
post {
always {
junit 'build/reports/**/*.xml'
}
}
}
And I get thiss error: 我得到这个错误:
[Pipeline] // stage
[Pipeline] stage
[Pipeline] { (Declarative: Post Actions)
[Pipeline] junit
Recording test results
[Pipeline] }
[Pipeline] // stage
[Pipeline] }
[Pipeline] // node
[Pipeline] End of Pipeline
ERROR: No test report files were found. Configuration error?
Finished: FAILURE
Anyone know what is a problem? 有人知道有什么问题吗?
I also use node.js, lab.js for testing 我也使用node.js,lab.js进行测试
If you are running your tests in a docker container, you can get them back out to the host by either bind-mounting the directory out to the host (with docker-compose volumes. be aware this may result in strange permissions for files on the host) or by running docker cp
after the tests have completed inside the container, like this: 如果您在Docker容器中运行测试,则可以通过将目录绑定安装到主机(使用docker-compose卷)来将它们返回到主机(请注意,这可能会导致对文件的奇怪权限)主机)或在容器内部完成测试后运行
docker cp
,如下所示:
# make sure the directory exists on the host
mkdir -p build/reports
# make sure the directory we want to copy doesn't exist on the host
rm -rf build/reports/something
# copy directory from container to host
docker cp CONTAINER_NAME:build/reports/something build/reports/something
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.