Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

empty reports under test-loop #40

Closed
sunaku opened this issue Apr 30, 2011 · 3 comments
Closed

empty reports under test-loop #40

sunaku opened this issue Apr 30, 2011 · 3 comments

Comments

@sunaku
Copy link
Contributor

sunaku commented Apr 30, 2011

Hello,

I'm getting empty reports (no files listed; all sections 100% coverage) when running my Rails 3.0.7 app's test suite in parallel with test-loop and SimpleCov 0.4.2. This problem was also described previously in issue #30.

I tried the following ways of invoking SimpleCov in my test suite.

Starting SimpleCov at the top of my test/test_helper.rb in the master process:

require 'simplecov'
SimpleCov.start 'rails'

ENV["RAILS_ENV"] = "test"
require File.expand_path('../../config/environment', __FILE__)
require 'rails/test_help'

Test::Loop.before_each_test.push lambda {
  |test_file, log_file, test_names|

  SimpleCov.root File.dirname(log_file)
  SimpleCov.coverage_dir File.basename(test_file) + '.cov'
}

Starting SimpleCov in a worker process just before it loads and runs a test/**_test.rb file from my Rails app test suite:

ENV["RAILS_ENV"] = "test"
require File.expand_path('../../config/environment', __FILE__)
require 'rails/test_help'

Test::Loop.before_each_test.push lambda {
  |test_file, log_file, test_names|

  require 'simplecov'
  SimpleCov.start 'rails'
  SimpleCov.root File.dirname(log_file)
  SimpleCov.coverage_dir File.basename(test_file) + '.cov'
}

Starting SimpleCov (after configuring its output locations) in a worker process just before it loads and runs a test/**_test.rb file from my Rails app test suite:

ENV["RAILS_ENV"] = "test"
require File.expand_path('../../config/environment', __FILE__)
require 'rails/test_help'

Test::Loop.before_each_test.push lambda {
  |test_file, log_file, test_names|

  require 'simplecov'
  SimpleCov.root File.dirname(log_file)
  SimpleCov.coverage_dir File.basename(test_file) + '.cov'
  SimpleCov.start 'rails'
}

None of these worked; I always get empty reports. Any ideas?

Thanks for your consideration.

@colszowka
Copy link
Collaborator

I think this issue might be related to the stuff I wrote about using SimpleCov with Spork over at #42 - could you please have a look there and check out whether there's a way to load simplecov before your whole app's environment is loaded on each run?

@colszowka
Copy link
Collaborator

Idle timeout. Please re-open when neccessary.

@sunaku
Copy link
Contributor Author

sunaku commented Feb 8, 2012

After watching @tenderlove's Hidden Gems of Ruby 1.9 presentation, I rolled my own coverage reporting for Ruby 1.9+. So this request is no longer necessary. Cheers.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants