pipeline docker中运行cypress+allure踩坑记录

552 阅读1分钟

jenkinsfile中代码

image.png

1. 控制台输出cypress结果乱码

image.png

解决办法:添加 NO_COLOR=1

2. java.io.IOException: Can't find allure commandline

解决办法:

image.png jenkins 全局配置 allure  这里, 采用自动安装, 不要配置路径

3. allure-results does not exists

results: [[path: '`target/allure-results`']]  这样的配置,会报 allure-results does not exists 我实际的结果文件xml 是在results下的

但是当我配置成 results时,会报

java.nio.file.AccessDeniedException: /home/jenkins/aaaa/bbbb/*****/results/testrun.json

解决办法: results: [[path: '$WORKSPACE/results']]     要加 $WORKSPACE

results  是生成 xml 的路径

4.  安装完 allure插件之后, 需要重启jenkins, 否则在流水线语法那里找不到 allure

5.  控制台有报错,不影响运行,暂时忽略了

Opening Cypress... 
[``1845``:``0817``/``074950.379244``:ERROR:zygote_host_impl_linux.cc(``263``)] Failed to adjust OOM score of renderer with pid ``2072``: Permission denied (``13``) 
[``2072``:``0817``/``074950.408371``:ERROR:sandbox_linux.cc(``377``)] InitializeSandbox() called with multiple threads in process gpu-process. 
[``2072``:``0817``/``074950.411985``:ERROR:gpu_memory_buffer_support_x11.cc(``44``)] dri3 extension not supported.