持续集成 有没有兄弟碰到过这个 Pipeline Allure 报告构建的报错信息,4 个小时了还没解决我人麻了

人形贪吃蛇 · 2022年10月07日 · 最后由 人形贪吃蛇 回复于 2022年10月09日 · 6862 次阅读

Jenkinsfile

pipeline {
   agent { docker { image 'aquichita/playwright-python-poetry-allure:v1' } }
   stages {
     stage('api-tests') {
         steps {
            echo 'api-tests'
         }
      }
      stage('e2e-tests') {
         steps {
            sh 'poetry install'
            sh 'poetry update'
            // sh 'poetry run playwright install chrome'
            sh 'poetry run pytest --alluredir=allure-results'
         }
      }
   }
   post {
      success {
        allure includeProperties: false, jdk: '', results: [[path: 'allure-results']]
      }
   }
}

报错信息:

共收到 7 条回复 时间 点赞

OCI runtime ? 昨晚遇到了,操作系统的事,排查下试试。

检查下配置吧,我之前遇到的是 allure 路径太长了,导致没办法使用

一个猜想:是不是没有在 pipeline 里配置 allure 的环境变量?导致 jenkins 使用默认的配置,默认的你又没装

是不是 allure 没有配置对,allure 在 pipeine 中使用时,要先配置下路径或者每次都安装个新的, 你这边 agent 用的是 docker,所以和非 docker 时使用时有些区别

你这个是用容器去跑,应该是 脚本跑完之后 生成的 allure 报告路径没有 映射到你得目标路径下,建议你在容器里面看看挂载路径下的文件

兄弟们我真厉害,找到问题了,pipline 里面的执行 post 的环境有问题,不应该在执行测试的容器里面 allure 而是在共享工作目录 jenkins 节点全局工具执行,目前这样问题得到解决了

人形贪吃蛇 关闭了讨论 10月09日 23:43
需要 登录 后方可回复, 如果你还没有账号请点击这里 注册