Jenkins中的诱惑工作区问题

8mmmxcuj  于 2023-02-03  发布在  Jenkins
关注(0)|答案(1)|浏览(168)

我正在尝试从Jenkins运行诱惑。我已经安装了诱惑Jenkins插件版本2. 30. 2和我目前的Jenkins版本是Jenkins2. 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/allure-report "下查找报告。一旦我通过putty登录到Jenkins box,就无法在工作区useruk_pipeline-2_develop中找到allure-report。

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

有人能请协助,并提供一些关于我应该保持我的调查方向的指针?也将不胜感激的任何链接。

0g0grzrc

0g0grzrc1#

我最终可以通过手动创建target/allure-results文件夹来加载测试结果。看起来Jenkins基础架构文件夹是基于管道节点创建的(我的案例有6个节点+1个基础架构,最新运行代理并尝试创建诱惑结果,将结果和报告拆分到不同的路径)。
作为变通方案,我添加了target/allure-results,正好在生成allure-reports的位置,并将文件夹复制到i.e.

  • 文件夹结构:
./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"]]
                    ])              
                  }
                }
            }
        }

希望,这也将是你的Jenkins问题在你的结束。

相关问题