【问题标题】:Build step 'Execute shell' marked build as failure on Jenkins CI without any error构建步骤“执行 shell”在 Jenkins CI 上将构建标记为失败,没有任何错误
【发布时间】:2020-05-12 05:42:10
【问题描述】:

我已将 jenkins CI 集成到我的项目中,因此每当我将更改推送到 github 时,它会自动启动测试用例并构建项目并将其部署到服务器。通过所有测试用例后,我收到了这个奇怪的错误。它还说“测试失败”,但没有显示测试失败。我可以明确地解决主要问题,因为我不知道出了什么问题。

堆栈跟踪到底:

Tests Failed
1416 examples, 0 failures

Took 187 seconds (3:07)
Build step 'Execute shell' marked build as failure
$ ssh-agent -k
unset SSH_AUTH_SOCK;
unset SSH_AGENT_PID;
echo Agent pid 78221 killed;
[ssh-agent] Stopped.
[Slack Notifications] found #203 as previous completed, non-aborted build
[Slack Notifications] will send OnRepeatedFailureNotification because build matches and user preferences allow it
Finished: FAILURE

我的主要脚本如下:

#!/bin/bash -ex

bundle exec rubocop
./script/setup_test $@
bundle exec parallel_rspec $@ spec/
bundle exec yarn test:ci

【问题讨论】:

    标签: ruby-on-rails jenkins build continuous-integration


    【解决方案1】:

    非零退出代码检测到失败。您的脚本中有多个命令。其中一个命令必须返回非零退出代码。

    【讨论】:

    • 嗨@Shashank V,你能告诉我如何检查执行命令的退出代码吗?它在堆栈跟踪中是如何显示的?
    猜你喜欢
    • 2016-02-21
    • 2017-10-09
    • 2017-06-19
    • 2019-12-01
    • 2019-11-25
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2017-03-18
    相关资源
    最近更新 更多