【问题标题】:Travis and Coverity Scan - Everything builds but coverity does not seem to runTravis 和 Coverity 扫描 - 一切都在构建,但 Coverity 似乎没有运行
【发布时间】:2019-08-12 10:14:22
【问题描述】:

这是我非常简单的 C++/CMake .travis.yml


env:
  global:
   # The next declaration is the encrypted COVERITY_SCAN_TOKEN, created
   #   via the "travis encrypt" command using the project repo's public key
   - secure: "<very long encrypted token>"

addons:
  coverity_scan:
    project:
      name: "tinverse/tsm"
    build_command_prepend: cmake .
    build_command: make
    branch_pattern: coverity_scan
  script:
    - echo -n | openssl s_client -CApath /etc/ssl/certs -connect scan.coverity.com:443 | sed -ne '/-BEGIN CERTIFICATE-/,/-END CERTIFICATE-/p' | sudo tee -a /etc/ssl/certs/ca-

  apt:
    sources:
    - ubuntu-toolchain-r-test
    packages:
    - gcc-5
    - g++-5
    - clang

compiler:
  - gcc
  - clang

install:
# Use g++5.4 and not 4.6 (C++11 missing)
  - if [ "$CXX" = "g++" ]; then export CXX="g++-5" CC="gcc-5"; fi

一切都很好。我没有看到覆盖运行或上传任何内容。我使用未加密的令牌在 travis 中添加了一个“COVERITY_SCAN_TOKEN”环境变量。构建日志在这里:https://travis-ci.org/tinverse/tsm/jobs/509506031。我得到一个最终的“命令“./configure && make && make test”以 0 退出。”来自 travis-ci 构建日志的消息就是这样!不知道我做错了什么。

更新: 从构建日志:

depth=1 C = BE, O = GlobalSign nv-sa, CN = GlobalSign CloudSSL CA - SHA256 - G3
verify error:num=20:unable to get local issuer certificate
verify return:0
DONE

但是,在 .travil.yml 中将 CApath 选项添加到 openssl 命令后 在脚本的 before_install 部分,我看到了

echo -n | openssl s_client -CApath /etc/ssl/certs/ -connect scan.coverity.com:443 | sed -ne '/-BEGIN CERTIFICATE-/,/-END CERTIFICATE-/p' | sudo tee -a /etc/ssl/certs/ca-certificates.crt
depth=2 C = BE, O = GlobalSign nv-sa, OU = Root CA, CN = GlobalSign Root CA
verify return:1
depth=1 C = BE, O = GlobalSign nv-sa, CN = GlobalSign CloudSSL CA - SHA256 - G3
verify return:1
depth=0 C = US, ST = Delaware, L = Dover, O = Incapsula Inc, CN = incapsula.com
verify return:1
DONE

那么这里的非零回报是否意味着成功?不过,查看 travis-ci 构建日志,我认为覆盖率扫描没有运行。

【问题讨论】:

    标签: c++ cmake travis-ci coverity


    【解决方案1】:

    我的分支名为 feature/coverity_scan,我认为 branch_pattern:coverity_scan 会起作用。它没。将我的分支重命名为coverity_scan 后,它起作用了。

    此外,将 dist: xenial 添加到 .travis.yml 文件可以消除证书错误。

    【讨论】:

      猜你喜欢
      • 2015-01-01
      • 2017-02-16
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2017-02-07
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多