【问题标题】:coveralls fails on AppVeyor in some builds but not in others在某些版本中,工作服在 AppVeyor 上失败,但在其他版本中没有
【发布时间】:2016-01-31 18:31:41
【问题描述】:

我正在尝试让pytest 发布来自 AppVeyor 的覆盖率报告。我已经按照here 的说明添加了存储库的加密令牌。这是appveyor.yml 文件:

environment:
  COVERALLS_REPO_TOKEN:
    secure: 2NJ5Ct55cHJ9WEg3xbSqCuv0rdgzzb6pnzOIG5OkMbTndw3wOBrXntWFoQrXiMFi
    # this is pytest's token in coveralls.io, encrypted
    # using pytestbot account as detailed here:
    # https://www.appveyor.com/docs/build-configuration#secure-variables

install:
  - echo Installed Pythons
  - dir c:\Python*

  # install pypy using choco (redirect to a file and write to console in case
  # choco install returns non-zero, because choco install python.pypy is too
  # noisy)
  - choco install python.pypy > pypy-inst.log 2>&1 || (type pypy-inst.log & exit /b 1)
  - set PATH=C:\tools\pypy\pypy;%PATH% # so tox can find pypy
  - echo PyPy installed
  - pypy --version

  - C:\Python35\python -m pip install tox

build: false  # Not a C# project, build stuff at the test step instead.

test_script:
  # - C:\Python35\python -m tox  
  - C:\Python35\python -m tox -e coveralls  # coveralls is not in tox's envlist

现在奇怪的是,有些构建通过了其他构建却没有。 PR 上用于持续集成的 GH 面板显示,continuous-integration/appveyor/branch 的构建按预期通过并发布了覆盖范围,但 continuous-integration/appveyor/pr 构建失败并显示以下消息:

You have to provide either repo_token in .coveralls.yml, or launch via Travis or CircleCI
ERROR: InvocationError: 'C:\\projects\\pytest\\.tox\\coveralls\\Scripts\\coveralls.EXE' 

有人知道发生了什么吗?

【问题讨论】:

    标签: coveralls appveyor


    【解决方案1】:

    出于安全原因,在 PR 构建期间未设置安全变量。

    【讨论】:

    • 感谢您的回复。我怀疑……但这是否意味着从现在开始所有 PR 都会失败?
    • 嗯,是的。除非 AppVeyor 提供了上传 coveralls.io 结果的内置机制。是否可以使用 python 解耦运行测试并以某种形式保存结果,然后将这些结果发送到 coveralls.io?
    • 如果COVERALLS_REPO_TOKEN 不可用,我采用的解决方案是简单地跳过上传工作服结果......时间会证明这是否会带来其他问题。再次感谢您的回复,我接受了。
    猜你喜欢
    • 2011-12-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2011-04-12
    • 1970-01-01
    • 2019-07-03
    • 1970-01-01
    • 2015-11-18
    相关资源
    最近更新 更多