Openwisp-utils: [增强] 常用 CI 脚本

创建于 2019-02-13  ·  13评论  ·  资料来源: openwisp/openwisp-utils

我们需要一个通用的 CI 脚本来运行所有 CI 测试,这样如果有小改动或添加/删除了新检查,我们不需要用小改动更新所有存储库。

阅读更多: https :

testing

所有13条评论

这些都是应该运行的脚本吗?

  • checkcommit
  • runcheckendline
  • runcheckmigration
  • runflake8
  • runisort

但是,其中一些检查不适用于所有存储库,您将如何解决该问题?
例如, runcheckmigration不会真正应用于openwisp-website ,但checkcommitruncheckendline仍应运行。

@dwang我在想命令行变量,默认情况下,所有任务都会运行,
但是,如果我想避免runcheckmigration ,我可以简单地执行--no-runcheckmigration来避免运行该脚本,您对此有何看法? :微笑:

听起来不错!

@atb00ker这听起来很棒! 你在研究这个吗?

不,我目前没有工作。 :微笑:

好的,我现在正在处理

@atb00ker脚本应该按什么顺序运行?
我看到checkcommitruncheckendline应该在每个 repo 上运行。
所以我将最多采用 3 个参数

测试不相互依赖,因此顺序无关紧要。
您可以检出每个存储库中的.travis.yml文件,以检出该特定存储库上正在运行的测试。
为以下存储库签出相同的内容:

- django-ipam
- openwisp-ipam
- django-freeradius
- openwisp-freeradius
- openwisp-users
- openwisp-utils
- openwisp-config
- openwisp-controller
- django-loci
- django-netjsonconfig
- django-x509

@atb00ker我看到每个存储库中的 .travis.yml 文件分为 3 部分

  • before_install:这里./runflake8 , ./runisort , ./runcheckmigration等被调用
  • 安装:这里是所有安装命令...
  • 脚本: checkcommit在这里运行并调用存储库特定的测试,即 jshint、./runtest、 coverage等。

每个 .travis.yml 中也有不同的命令来安装 openwisp-utils

  • pip install openwisp-utils[qa]>=0.2.1在 openwisp-config 中
  • pip install https://github.com/openwisp/openwisp-utils/tarball/master在 OpenWISP 网站
  • pip install https://github.com/openwisp/openwisp-utils/tarball/master#egg=openwisp_utils --upgrade在 openwisp-users
  • pip install -U https://github.com/openwisp/openwisp-utils/tarball/master在 django-freeradius
  • pip install --user https://github.com/openwisp/openwisp-utils/tarball/master在 ansible-openwisp 中

有些在requirements-test.txt中有一行也是存储库中存在的测试文件的副本我想包括openwisp-utils

几个问题:

  1. 只在脚本部分运行测试可以吗? 而不是 before_install (见 https://github.com/openwisp/django-ipam/blob/master/.travis.yml)
  2. 我将参数视为--no testname1 testname2 testname2 .....可以吗?

请让我知道您对此的看法:)

@ankit-kumar-dwivedi 不在“脚本”部分运行“before_install”脚本。 这是我试图解释原因(感谢更正)-

之前运行一些脚本可能需要正确运行主脚本。
& 如果任何“before_script”或“after_script”失败,它不会影响整体构建“状态”。

“例如,runcheckmigration 不会真正适用于 openwisp-website,但仍应运行 checkcommit 和 runcheckendline。”
我认为我们需要为排除存储库添加变量。 @dwang

@ankit-kumar-dwivedi

  1. 是的,CI 测试也可以在其他测试之后运行,所以只要它有效,我看不出有什么问题。 :微笑:
  2. 是的,看起来不错。 如果有什么东西准备好了,你能不能提出一个 [正在进行中] 拉取请求,以便我们在你工作的时候看看?
    谢谢。 :微笑:

由 #45 关闭

此页面是否有帮助?
0 / 5 - 0 等级

相关问题

nemesisdesign picture nemesisdesign  ·  9评论

atb00ker picture atb00ker  ·  9评论

nemesisdesign picture nemesisdesign  ·  5评论

ispmarin picture ispmarin  ·  3评论

jacquev6 picture jacquev6  ·  3评论