Closed grempe closed 8 years ago
At first glance I would say that coco and simplecov are not compatible. I don't know coveralls but can you try to disable simplecov to see what's happen?
Well, coveralls is responsible for loading simplecov into the environment and I didn't find a way to stop it from doing that. But I poked inside the coveralls gem and found some internal checks it was doing for the environment to determine whether or not to run. So I added those same checks to my test_helper.rb which so far seemed to do the trick.
# coveralls.io and coco are incompatible. Run each in their own env.
if ENV['TRAVIS'] || ENV["CI"] || ENV["JENKINS_URL"] || ENV['TDDIUM'] || ENV["COVERALLS_RUN_LOCALLY"]
# coveralls.io : web based code coverage
require 'coveralls'
Coveralls.wear!
else
# coco : local code coverage
require 'coco'
end
$LOAD_PATH.unshift File.expand_path('../../lib', __FILE__)
require 'tss'
require 'minitest/autorun'
require 'minitest/pride'
Please do note though that I still see the following warning when I run my mintest specs locally with only coco
being loaded:
/usr/local/var/rbenv/versions/2.2.4/lib/ruby/gems/2.2.0/gems/coco-0.14.0/lib/coco/cover/summary.rb:36: warning: private attribute?
I'm glad you found a way to use coveralls + coco :smile:
I'll look closer to this warning.
I have been using coveralls.io to have an internet accessible place for code coverage results to be shown. But coveralls does not really provide me with any guidance as to coverage when I run my minutest suite locally.
I wanted to add in coco support for local coverage reports that I can see before I commit and push.
When I added coco support locally w/ version 0.14.0 I get the following RuntimeError (but it does generate a coverage/index.html report). Note also the
warning: private_attribute?
at the beginning of the test run.My test_helper.rb file looks like the following (I tried reversing the order of require between coveralls and coco, no difference):
Any thoughts? Or are the two simply incompatible with each other and I must do conditional inclusion based on environment (rather avoid)?