continuous-integration - 如何故意破坏代码构建?

标签 continuous-integration codeship

我已经编写了一个测试脚本,我想在我的 codeship 构建的设置命令中运行。如果它失败了,我希望它导致整个构建失败,这是单元测试之类的正常行为。

在 Travis CI 中,这似乎是 well documented :

If any of the commands in the first four stages of the build lifecycle return a non-zero exit code, the build is broken

我怎样才能在 codeship 中实现同样的行为?我尝试使用代码 1 退出我的脚本,但 codeship 保持在 a-sailin' 上。

最佳答案

以代码 1 退出确实导致构建失败,但仅在“测试命令”或“测试管道”框中。

我在“设置命令”框中错误地运行了测试。

现在我的 python 测试套件中的最后一行在代码传输中具有正确的行为:

sys.exit(0 if success else 1)

关于continuous-integration - 如何故意破坏代码构建?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/33029785/

相关文章:

git - TeamCity:来自 git 的代理端 checkout 失败

javascript - Node.js - 等价的traceroute

ruby-on-rails - 如何在 CodeShip 上设置 selenium firefox 测试?

bash - 可以使用脚本下载和配置jenkins吗?

swift - 如何在部署在 Windows Server 上的 Jenkins 上运行 Swift 单元测试

redis - 在 Codeship Basic 中,redis 内存是在每次构建之后/之前刷新的吗?

node.js - Jest JS 测试覆盖率数据未从 Codeship 发布到 Code Climate

mysql - 如何在 CodeShip Basic 的测试管道中为 Laravel 应用程序运行自定义 mysql 脚本?

Teamcity 升级后 GIT VCS 不更新源

gradle - 我可以在gitlab-ci文件中使用Gradle配置变量吗?