如何在Jenkins中进行测试工作以将构建标记为稳定且不是不稳定

如何在Jenkins中进行测试工作以将构建标记为稳定且不是不稳定

本文介绍了如何在Jenkins中进行测试工作以将构建标记为稳定且不是不稳定?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

目前,我正在Jenkins中构建和测试我的应用.如果作业中的测试失败,则将构建标记为不稳定".即使测试失败,能否将构建标记为稳定"?如果代码无法编译,则将构建标记为失败".

Currently I am building and testing my app in Jenkins. If a test fails in the job then the build is marked as Unstable. Is it possible to have the build be marked as Stable even though tests fail? The build is marked as Failed if code does not compile, and that is fine.

推荐答案

有一个名为Jenkins Text Finder的插件:
https://wiki.jenkins-ci.org/display/JENKINS/Text-finder+Plugin

There is a plugin called Jenkins Text Finder:
https://wiki.jenkins-ci.org/display/JENKINS/Text-finder+Plugin

它允许在控制台日志中搜索正则表达式匹配项,如果找到,则可以将构建设置为各种状态,包括将其设置为成功"(即不稳定).

It allows to search console log for regular expression matches, and if found, it can set the build to various states, including setting it as "success" (i.e. not unstable).

在构建成功后,只需在控制台输出中回显一个唯一的标签/行,并使用此插件查找该行.使用插件中的"成功找到"选项将构建标记为成功.

Just echo a unique label/line into your console output after the build is successful, and look for that line with this plugin. Use "Succeed if found" option in the plugin to mark build successful.

这篇关于如何在Jenkins中进行测试工作以将构建标记为稳定且不是不稳定?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

08-01 06:28