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

#114553545 Merging Coverall Test Results #50

Merged
merged 3 commits into from
Apr 4, 2016

Conversation

fighterii
Copy link
Contributor

https://www.pivotaltracker.com/story/show/114553545

Rakefile task added, .simplecov for options added, modified env.rb and rails_helper.rb

By modifiying the .simplecov file with additional "add_filter" methods we can specify which files should not be tested (regarding to the second point of the story, that we only want to test files within the app folder)

@fighterii
Copy link
Contributor Author

@tochman : When you want to merge this in, you have to change the Semaphore task to:
bundle exec rake test_with_coveralls

(in contrast to the failing bundle exec rake :test_with_coveralls with a doublepoint, from PR#44)

@fighterii
Copy link
Contributor Author

However, i noticed a significant drop in coverage.

bad_coverage_report

example_file_uncovered_lines
Because the blank lines and "end" lines are counted as relevant lines.

This is an issue of SimpleCov Issue #444

I tried the suggested fix with changing line 7 of the merge_helpers.rb of the SimpleCov lib locally and got the following improvements:

coverage_with_fix

As you can see, unrelevant lines are now correctly displayed in grey and not counted as uncovered:
example_file_with_fix

@tochman
Copy link
Member

tochman commented Mar 24, 2016

Hmm.. I see. Weird. Are the cucumber tests taken into consideration in the above coverage calculations?

@fighterii
Copy link
Contributor Author

Let me check this again..

@fighterii
Copy link
Contributor Author

Weird. It seems like this are only the cucumber scores.

I tested this behavior by changing the test_with_coverall task

For task :test_with_coveralls => [:spec, :cucumber, 'coveralls:push'] i get the scores from above (58.95%)

For only rspec (task :test_with_coveralls => [:spec, 'coveralls:push']) i get 0.0% coverage.

For only cucumber (task :test_with_coveralls => [:cucumber, 'coveralls:push']) i get the scores as in the combined tests (58.95%)

@fighterii
Copy link
Contributor Author

@tochman : Seems its working (at least locally) now.
I get test coverage of ~90%.

Maybe we could test this within the CI now by changing the Semaphore task to:
bundle exec rake test_with_coveralls

The problem was, that SimpleCov needs to know which spec files belong to which "group" of testing.
So we have to add SimpleCov.command_name 'test:xyz' to ONE file of each Rspec folder.
I chosed the two user_spec.rb in models and requests\api\v1

@tochman
Copy link
Member

tochman commented Apr 3, 2016

I'll merge this in if you feel it's ready to be tested on semaphore.

@fighterii
Copy link
Contributor Author

I think this should work now :)

@tochman tochman merged commit 6260263 into AgileVentures:develop Apr 4, 2016
@fighterii fighterii deleted the merging-coverall branch April 5, 2016 06:24
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

Successfully merging this pull request may close these issues.

2 participants