哪个库包含基本的Jenkins Workflow Groovy功能?
我正在为我的詹金斯(Jenkins)Groovy脚本编写Junit测试。我正在测试的Jenkins脚本包含这样的方法调用:
error "Foo"
当我尝试从IDE(Intellij Idea)运行测试时,我会收到这样的错误:
没有方法的签名:static xxx.error()适用于参数类型:( org.codehaus.groovy.runtime.gstringimpl)value [foo]
所以我想,我需要在我的类中添加一些库来使此<代码错误
运行时已知的功能。我尝试了这种Maven依赖性
<dependency>
<groupId>org.jenkins-ci.plugins.workflow</groupId>
<artifactId>workflow-aggregator</artifactId>
<version>2.5</version>
</dependency>
,但没有帮助。
因此,我正在努力寻找包含这些基本jenkins的工作流函数: https://www.jenkins.io/doc/pipeline/steps/workflow-basic-steps
有什么想法吗?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
解决方案是使用 jenkins pipeline unit 使所有这些函数/方法都像
echo echo /code>或
错误
:在这种情况下,每个测试都应将我们试图测试的代码结合在一起,该代码将通过
jenkinspipelineunit
引擎执行。The solution is to use Jenkins Pipeline Unit library that makes all those functions/methods like
echo
orerror
available and known to the pipeline context:In this case every test should wrap-up the piece of code we are trying to test into a small jenkins script that will be executed by the
JenkinsPipelineUnit
engine.源位于在这里。因此,基于
The source is located here. So based on the pom I would say it's in the following dependency.