Closed jhnvz closed 10 years ago
Thanks for all the version info, that's always useful. So, one question.. which version of rails?
And what I assume is happening.. The instrumentation probably isn't loading or working because assets are getting precompiled. For the coverage to work, it must instrument the javascripts that are being tested, and for that to happen, there's a middleware/sprockets hack in the instrumentation part of teaspoon. So, precompiling assets for tests is probably not the best case if you need coverage reports.
Thanks for the quick response! We're running rails 4.0.3. I don't think assets are getting precompiled since the commands we run on our ci server are pretty much the same as locally.
Is there I way I can check/debug if instrumentation isn't loading/working correctly?
try:
RAILS_ENV=test bundle exec teaspoon
Already tried that. When I run RAILS_ENV=test bundle exec teaspoon
locally it also doesn't generate coverage.
When your run bundle exec teaspoon
(locally) the ENV['RAILS_ENV']
is nil. Rails defaults to the development environment so config/environments/development.rb is loaded.
When your run bundle exec teaspoon
on circleci ENV['RAILS_ENV']
is 'test' so config/environments/test.rb is loaded. When you change config.cache_classes
to false in for the test environment instrumentation works.
Thanks for pointing me to the right direction.
I just spent too long trying to diagnose this same problem. Can anyone possibly explain to me why config.cache_classes = false
in my test environment allows coverage to run properly? I don't see the connection. Cucumber emits a warning about class caching being enabled if I do this...
I have both phantomjs and istanbul installed locally and on CircleCI.
teaspoon_env.rb:
local:
circleci:
I've modified 'teaspoon/runner' to:
Locally the coverage attribute is filled with data on circleci I get the following output:
Any ideas on what might go wrong?