[英]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.