Skip to content
This repository was archived by the owner on Nov 30, 2024. It is now read-only.

Fix coveralls and a brittle test #935

Merged
merged 4 commits into from
Jun 8, 2013
Merged

Fix coveralls and a brittle test #935

merged 4 commits into from
Jun 8, 2013

Conversation

myronmarston
Copy link
Member

  • #debug? depends on whether or not the debugger is loaded. The tests for it were brittle and could start to fail if you were running the specs with the debugger loaded.
  • On the coveralls UI I'm seeing the same file listed many times. I think it's because we run all the specs together and then run each individually and the multiple test runs confuses it.

rspec_rspec-core build 1225 coveralls - code coverage history and statistics

`#debug?` depends on whether or not the debugger is loaded. The tests for
it were brittle and could start to fail if you were running the specs with
the debugger loaded.
On the coveralls UI I'm seeing the same file listed many times.  I think it's because we run all the specs together and then run each individually and the
multiple test runs confuses it.
@coveralls
Copy link

Coverage Status

Coverage increased (+0%) when pulling 88c1747 on fix_coveralls into badfb72 on master.

That last commit improved the coveralls percent but the results
are still a bit odd. In our cukes, the rspec code is only run in a
separate process started by aruba using the rspec command. I don't
think that our cukes provide useful info about the coverage percent
due to the separate processes.
@coveralls
Copy link

Coverage Status

Coverage increased (+0%) when pulling faf4b53 on fix_coveralls into badfb72 on master.

We really only care about the coverage of our lib files.
@coveralls
Copy link

Coverage Status

Coverage increased (+0%) when pulling 24e4d72 on fix_coveralls into badfb72 on master.

@JonRowe
Copy link
Member

JonRowe commented Jun 8, 2013

On mocks I ended up using wear_merged! which is supposed to sorts the multiple files confusion, the downside is it requires an uber-rescue (which mock's needed anyway) to get it to run on 1.9.2. I've tried the same on exceptions to see if it improves the stats.

I'd quite like to keep the cucumber as part of the coverage stats and if something is covered in them which isnt in specs I'd still like that chalked up as a win, but I'm open to removing it.

@myronmarston
Copy link
Member Author

On mocks I ended up using wear_merged! which is supposed to sorts the multiple files confusion, the downside is it requires an uber-rescue (which mock's needed anyway) to get it to run on 1.9.2. I've tried the same on exceptions to see if it improves the stats.

It's not working on rspec-mocks. It's having the same problems:

rspec_rspec-mocks build 626 coveralls - code coverage history and statistics

Under the hood, I believe it's using Simplecov's merging, which generally works w/o additional configuration when the multiple runs are different binaries (e.g. rspec and cucumber) but requires that you configure SimpleCov.command_name when it's the same binary (as it is for the full rspec suite plus running each individual spec).

On top of that, there's no benefit to using coveralls/simplecov while running the individual spec files -- even if we got the merging to work, it's not going to provide us any more or less coverage.

I'd quite like to keep the cucumber as part of the coverage stats and if something is covered in them which isnt in specs I'd still like that chalked up as a win, but I'm open to removing it.

The problem is that there's no way the basic cucumber setup you had can possibly work. Here's why:

  • You were loading coveralls within the cucumber process. On a project that runs all the code in that process (e.g. a typical cucumber suite using capybara) that would work fine.
  • However, with our setup, all the cucumber process does is create files, shell out to start a new project (by running the rspec command), and then sets expectations about the exit statuses and output of the rspec processes.
  • Each rspec process is a fresh memory space that doesn't have simplecov/coveralls loaded (how could it?), and so it's not going to be able to track the code coverage achieved by the rspec processes.

@JonRowe
Copy link
Member

JonRowe commented Jun 8, 2013

Fair enough

JonRowe added a commit that referenced this pull request Jun 8, 2013
Fix coveralls and a brittle test
@JonRowe JonRowe merged commit bbc83ce into master Jun 8, 2013
@myronmarston myronmarston deleted the fix_coveralls branch June 9, 2013 03:23
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants