4

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 Answers2

2

Add

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

at the beginning of file spec_helper.rb.

Artem P
  • 5,198
  • 5
  • 40
  • 44
  • This solves the problem and should be accepted so it helps anyone else who finds this question. – gnerkus Dec 16 '15 at 19:43
1

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
    
shankar.parshimoni
  • 1,289
  • 5
  • 22
  • 42
Isha Aggarwal
  • 432
  • 5
  • 13