简体   繁体   English

在 Jenkins 声明性 groovy 脚本中从“机器人发布”访问变量?

[英]Accessing the variables from "robot publish" in a Jenkins declarative groovy script?

I'd like to print some of the variables coming from robot's publish function, such as ROBOT_PASSRATIO, in the output of a Jenkins declarative script.我想在 Jenkins 声明脚本的 output 中打印一些来自机器人发布 function 的变量,例如 ROBOT_PASSRATIO。 This is of course written in Groovy.这当然是Groovy写的。

However, when attempting to interpolate ${ROBOT_PASSRATIO} it comes out as null.但是,当尝试对 ${ROBOT_PASSRATIO} 进行插值时,结果为 null。

That values and others are also not in the environment variables, either.该值和其他值也不在环境变量中。 In non-declarative scripts, they've always been accessible just by calling them with ${}.在非声明性脚本中,始终只需使用 ${} 调用它们即可访问它们。 So where are my variables?那么我的变量在哪里? Do I need to do something specific to get robot to set them in env?我需要做一些特定的事情来让机器人在环境中设置它们吗?

Check that Editable Email Notification is enabled in your project configuration.检查您的项目配置中是否启用了可编辑的 Email 通知

Also make sure to interpolate ROBOT_PASSRATIO in a separate stage after Robot collects test results.还要确保在 Robot 收集测试结果后在单独的阶段插入ROBOT_PASSRATIO

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 访问为Jenkins Groovy插件脚本指定的变量 - Accessing Variables Specified for Jenkins Groovy Plugin Script Jenkins Groovy 声明性脚本无法将文件发布到 Confluence 并出现“错误类型”错误 - Jenkins Groovy Declarative Script fails to publish files to Confluence with 'bad types' error 从Groovy脚本访问Jenkins插件包 - Accessing a Jenkins plugin package from a Groovy script 从Jenkins Groovy脚本访问GitLab JSON - Accessing GitLab JSON from Jenkins Groovy script 在jenkins声明式管道文件中重用groovy脚本 - Reusing groovy script in jenkins Declarative pipeline file Jenkins 声明式管道添加 groovy postbuild 脚本 - Jenkins declarative pipeline add groovy postbuild script 从 Jenkins 中的 Groovy 脚本设置环境变量 - Set environment variables from Groovy script in Jenkins Jenkins 声明式管道:如何从“主动选择反应引用参数的 Groovy 脚本”调用函数? - Jenkins Declarative Pipeline: How to call functions from "Active choices reactive reference parameter's Groovy script"? Jenkins:从Active Choices参数groovy脚本访问其他插件 - Jenkins: Accessing other plugins from Active Choices Parameter groovy script 如何在Jenkins声明性管道中导入的groovy脚本中使用@Library? - How to use @Library in an imported groovy script in Jenkins declarative pipeline?
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM