CodeClimate::TestReporter::InvalidPayload

363 views Asked by At

I'm facing with the following problem, trying to execute code climate reporter on .travis.yml:

Code Climate encountered an exception: CodeClimate::TestReporter::InvalidPayload No source files were found in the test report payload

Is there anybody here who could help me?

2

There are 2 answers

1
Artem P On

Add

require "codeclimate-test-reporter"
CodeClimate::TestReporter.start

at the beginning of file spec_helper.rb.

0
Isha Aggarwal On

Can you post your spec_helper.rb file? This error can be because of quite a few reasons :

  • Calling SimpleCov.start and CodeClimate::TestReporter.start

    • Instead try SimpleCov.start CodeClimate::TestReporter.configuration.profile
  • Add SimpleCov.formatter = SimpleCov::Formatter::MultiFormatter[ SimpleCov::Formatter::HTMLFormatter, CodeClimate::TestReporter::Formatter ]

  • So, the final spec_helper.rb is something like this :

    require "codeclimate-test-reporter" <br>
    require 'simplecov'
    
    SimpleCov.formatter = SimpleCov::Formatter::MultiFormatter[SimpleCov::Formatter::HTMLFormatter,CodeClimate::TestReporter::Formatter]
    
    dir = File.join("..", "coverage")
    SimpleCov.coverage_dir(dir)
    SimpleCov.start CodeClimate::TestReporter.configuration.profile