詹金斯的诱惑工作空间问题



我正试图从詹金斯那里获得诱惑。我已经安装了诱惑詹金斯插件版本2.30.2,我目前的Jenkins版本是Jenkins 2.346.1。

日志:

[Pipeline] { (Declarative: Post Actions)
[Pipeline] script
[Pipeline] {
[Pipeline] allure
[useruk_pipeline-2_develop] $ /var/lib/jenkins/tools/ru.yandex.qatools.allure.jenkins.tools.AllureCommandlineInstallation/allure/bin/allure generate -c -o /var/lib/jenkins/workspace/useruk_pipeline-2_develop/allure-report
allure-results does not exist
Report successfully generated to /var/lib/jenkins/workspace/useruk_pipeline-2_develop/allure-report
Allure report was successfully generated.
Creating artifact for the build.
Artifact was added to the build.
[Pipeline] }

代码:

post {
always {
script {
allure([
includeProperties: false,
jdk: '',
properties: [],
reportBuildPolicy: 'ALWAYS',
results: [[path: " ${env.WORKSPACE}/allure-results"]]
//results: [[path: " ${ALLURE_DIR}/allure-results"]]
])
}
deleteDir()
}

它试图在"/var/lib/jenkins/workspace/useruk_pipeline-2_develop/laulty report"下找到该报告。有一次,我通过putty登录到Jenkins box,但在工作空间useruk_pipeline-2_develop中找不到吸引人的结果。

jenkins@ip-xxx.xx.x.xx:~/workspace/useruk_pipeline-2_develop$ ls
Dockerfile  Jenkinsfile  behave.ini  features  requirements.txt  amt

但我可以在useruk_pipeline-2_develop@2工作空间。

jenkins@ip-xxx.xx.x.xx:~/workspace/useruk_pipeline-2_develop@2$ ls -l | grep "all*"
total 4332
drwxr-xr-x 2 jenkins jenkins  282624 Aug 18 12:14 allure-results
-rw-r--r-- 1 jenkins jenkins     889 Aug  3 11:49 allure.py
drwxr-xr-x 3 jenkins jenkins    4096 Aug  3 11:49 allure_behave
drwxr-xr-x 2 jenkins jenkins    4096 Aug  3 11:49 allure_behave-2.5.2.dist-info
drwxr-xr-x 3 jenkins jenkins    4096 Aug  3 11:49 allure_commons
drwxr-xr-x 2 jenkins jenkins    4096 Aug  3 11:49 allure_python_commons-2.5.2.dist-info

有人能帮忙并提供一些建议吗?我应该把调查放在哪里?任何链接也将不胜感激。

我最终可以通过手动创建target/allure-results文件夹来加载测试结果。看起来Jenkins基础设施文件夹是基于管道节点创建的(在我的案例中,有6个节点+1个基础设施,最新运行代理并尝试创建吸引结果,将结果和报告拆分到不同的路径(。

作为变通办法,我在生成allure-reports的地方添加了target/allure-results,并在上复制文件夹

  • 文件夹结构:
./home/fyre/home/fyre/workspace/Jobs/Sandbox/Eduardo/copy_sw_test_validation_test@2/target/allure-results
./home/fyre/home/fyre/workspace/Jobs/Sandbox/Eduardo/copy_sw_test_validation_test@2/target/allure-report
  • 管道脚本:
stage('Allure Report') {
agent{
node{
label "node-sw-slave${BUILD_NUMBER}"
}
}
steps {
ws("/home/fyre/workspace/Jobs/Sandbox/Eduardo/copy_sw_test_validation_test@2/"){
script {
allure([
includeProperties: false,
jdk: '',
properties: [],
reportBuildPolicy: 'ALWAYS',
results: [[path: "target/allure-results"]]
])              
}
}
}
}   

希望这也是你最后的詹金斯问题。

最新更新