Travis CI 和 tox 结果不一致 [英] Inconsistent results with Travis CI and tox

查看:40
本文介绍了Travis CI 和 tox 结果不一致的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在 Travis 为我的开源项目设置了持续集成.tox 似乎命令中的引号有些问题,所以我设置了一个临时分支来调试问题.在这一点上,我遇到了一个非常奇怪的问题.

I have set up continuous integration for my open source project at Travis. tox seems to be having some problems with quotes in the commands, so I set up a temporary branch for debugging the problem. At this point I am encountering a very strange issue.

最近 3 次提交及其在 Travis 上的构建状态:

The last 3 commits and their build status on Travis:

  • Bla - build 32 passed
  • eklzjfljkze - build 32 failed
  • Revert "eklzjfljkze" - build 34 failed

由于最后一次提交恢复了导致失败的提交,我认为没有理由不通过构建 34.也许 Travis 正在缓存一些东西,但 Travis 的 Settings->Caching 说尚未创建缓存".由于我使用的是开源项目的免费计划,因此我认为我什至无法启用缓存.

As the last commit reverts the one that caused the failure, I see no reason why build 34 shouldn't pass. Perhaps Travis is caching some stuff, but Travis's Settings->Caching says "No caches have been created yet". As I'm using the free plan for open source projects, I don't think I can even enable caching.

从之前的尝试中,我注意到如果我使用 git push --force 将分支回滚到通过的提交 ('Bla'),构建将再次通过.

From previous attempts, I have noticed that if I roll back the branch to the passing commit ('Bla') using git push --force, the build will pass again.

所有这些提交都使用相同的 python 和 tox 版本在本地正常工作.

All of these commits work fine locally using the same python and tox versions.

怎么回事?

EDIT 现在它以类似的方式失败了.比较构建 3637.构建 37 中的提交仅对自述文件进行了更改,因此它不会以任何方式影响构建.Travis 和 Tox 肯定有什么冲突.

EDIT Now it's failing in a simular way. Compare builds 36 and 37. The commit in build 37 only makes a change to the README, so it doesn't affect the build in any way. There must be some kind of conflict with Travis and Tox.

推荐答案

Travis 进行浅层克隆,将其限制为最后 50 次提交.在我的 setup.py 脚本中,我调用 git describe 如果克隆中没有标签,它就会失败.因此,当浅克隆不包含任何标签时,就会出现问题...

Travis makes a shallow clone, limiting it to the last 50 commits. In my setup.py script, I call git describe which fails if no tags are present in the clone. Hence, the problem occurs when the shallow clone does not contain any tags...

这篇关于Travis CI 和 tox 结果不一致的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆