1

Rails アプリケーション用の std travis coverity セットアップを探しています。

現在の .travis.yml ファイルは次のようになります。

# environment settings
env:
  - DB=sqlite
  - DB=mysql
  - DB=postgresql
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: "<SECURE>"

# project language
language: ruby
rvm:
  - 2.3.1

# branches to build (whitelist)
branches:
  only:
    - master
    - coverity_scan
    - testing

# command to run before install
before_install:
      - echo -n | openssl s_client -connect scan.coverity.com:443 | sed -ne '/-BEGIN CERTIFICATE-/,/-END CERTIFICATE-/p' | sudo tee -a /etc/ssl/certs/ca-

# arguments for the bundler
bundler_args: --without production development

# addons
addons:
  coverity_scan:
    project:
      name: "<PROJECT_NAME>"
      description: "Build submitted via Travis CI"
    notification_email: <MY_EMAIL>
    build_command_prepend: ""
    build_command: "--no-command"
    branch_pattern: coverity_scan

# script
script:
  - RAILS_ENV=test bundle exec rake db:migrate --trace
  - bundle exec rake db:test:prepare
  - bundle exec rspec spec/
  - bundle exec cucumber

# run before script
before_script:
  - mysql -e 'create database my_app_test'
  - psql -c 'create database my_app_test' -U postgres

build_commandの部分に何を入れたらいいのかわかりませんaddons.coverity_scan--no-command、 、bundle install、および を空のままにしてみbundle install --jobs=3 --retry=3ましたが、どれも機能しませんでした。--no_commandたとえば、次のメッセージが表示されます。

Coverity Scan analysis selected for branch coverity_scan.
Coverity Scan analysis authorized per quota.
$ curl -s https://scan.coverity.com/scripts/travisci_build_coverity_scan.sh | COVERITY_SCAN_PROJECT_NAME="$PROJECT_NAME" COVERITY_SCAN_NOTIFICATION_EMAIL="<MY_EMAIL>" COVERITY_SCAN_BUILD_COMMAND="--no-command" COVERITY_SCAN_BUILD_COMMAND_PREPEND="" COVERITY_SCAN_BRANCH_PATTERN=coverity_scan bash
Note: COVERITY_SCAN_PROJECT_NAME and COVERITY_SCAN_TOKEN are available on Project Settings page on scan.coverity.com
Coverity Scan configured to run on branch coverity_scan
Coverity Scan analysis authorized per quota.
Downloading Coverity Scan Analysis Tool...
2016-09-13 23:26:36 URL:https://scan.coverity.com/download/Linux [449455458/449455458] -> "/tmp/cov-analysis-Linux.tgz" [1]
Extracting Coverity Scan Analysis Tool...
/tmp/coverity-scan-analysis ~/build/<PROJECT_NAME>
~/build/<PROJECT_NAME>
Running Coverity Scan Analysis Tool...
Coverity Build Capture (64-bit) version 8.5.0.3 on Linux 3.13.0-92-generic x86_64
Internal version numbers: db70178643 p-kent-push-26368.949
[WARNING] No files were emitted. This may be due to a problem with your configuration
or because no files were actually compiled by your build command.
Please make sure you have configured the compilers actually used in the compilation.
 For more details, please look at: 
    /home/travis/build/<PROJECT_NAME>/cov-int/build-log.txt
Extracting SCM data for 0 files...
Please see the log file '/home/travis/build/<PROJECT_NAME>/cov-int/scm_log.txt' for warnings and SCM command issues.
[WARNING] Unable to gather all SCM data - see log at /home/travis/build/<PROJECT_NAME>/cov-int/scm_log.txt for details.
Successfully added SCM data for 0 files
Tarring Coverity Scan Analysis results...
Uploading Coverity Scan Analysis results...

また、travis を使用しているため、ログ ファイルを調べることができません...

コマンドが空の場合、コマンドを指定する必要があり、何もしないというエラーで失敗します。

Rails アプリの std セットアップを手伝ってくれる人はいますか?

前もって感謝します!

4

3 に答える 3

2

Ruby は Coverity 8.5 でサポートされています。これをデバッグすることは、ログなしでは困難です。SCAN キットに Ruby の構成が欠落している可能性がありますが、これは を実行することで修正できますcov-configure --ruby

ただし、より可能性の高い問題は、Coverity が Ruby を「コンパイルされていない」言語と見なしていることです (つまり、通常、Ruby を使用する前にコンパイルするビルドはありません)。これはcov-build、Ruby ファイルがどこにあるかを知らせる必要があることを意味します。あなたの travis config を見ると、これを に追加する必要があると思いますbuild_command:--fs-capture-search /path/to/your/ruby/files

于 2016-09-24T21:31:39.327 に答える
0

Rails (一般的に解釈されたもの) プロジェクトを分析することはできないようです (間違っていたら訂正してください)。プロジェクトをコベリティから削除しました。

于 2016-09-16T11:20:40.883 に答える