我面临以下问题,试图在 .travis.yml 上执行代码气候报告:
Code Climate 遇到异常:CodeClimate::TestReporter::InvalidPayload No source files were found in the test report payload
这里有人可以帮助我吗?
我面临以下问题,试图在 .travis.yml 上执行代码气候报告:
Code Climate 遇到异常:CodeClimate::TestReporter::InvalidPayload No source files were found in the test report payload
这里有人可以帮助我吗?
添加
require "codeclimate-test-reporter"
CodeClimate::TestReporter.start
在文件的开头spec_helper.rb
。
您可以发布您的 spec_helper.rb 文件吗?这个错误可能是由于很多原因:
调用 SimpleCov.start 和 CodeClimate::TestReporter.start
添加 SimpleCov.formatter = SimpleCov::Formatter::MultiFormatter[ SimpleCov::Formatter::HTMLFormatter, CodeClimate::TestReporter::Formatter ]
所以,最终的 spec_helper.rb 是这样的:
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