詹金斯如何强制任务运行,即使其中一个任务失败



嗨,我正在使用 Jenkins 运行一些任务。在那里,我有 5 个任务要按顺序运行,如下所示:

test --tests apptest.WP_RecuperarSenha.testTeste_recuperar_senha_e_logar 
test --tests apptest.WP_CadastroInvalido.testTeste_cadastro_campos_invalidos  
test --tests apptest.WP_CadastroEmBranco.testedecadastrobranco 
test --tests apptest.WP_InteracaoProduto.testeinteracaoproduto

我想知道如何强制 Jenkins 继续运行构建,例如,如果test --tests apptest.WP_RecuperarSenha.testTeste_recuperar_senha_e_logar失败了。如何继续运行它?

如果您使用的是自由样式的工作,则可以为每个任务使用条件步骤插件,并将每个步骤设置为始终运行。

如果您使用管道插件,您可以将每个任务包围在try/catch块中,然后在catch内部写入currentBuild.result = 'FAILURE'(或者currentBuild.result = 'UNSTABLE'如果它对您更有意义(。

最新更新