Skip to content
This repository was archived by the owner on Dec 18, 2020. It is now read-only.

Conversation

etagwerker
Copy link
Member

@etagwerker etagwerker commented Aug 25, 2020

Hey,

This is a post about Ruby on Rails's code coverage. It comes with a static website to show some of my research: https://fastruby.github.io/coverage/

WIP: I still need to re-calculated some of the coverage data for the first components. During the process of writing this article, I realized that I had been using the wrong SimpleCov code (it wasn't automatically merging results for different commands) 😢

Other than that, this article is ready for review.

Please check it out.

Thanks!

@etagwerker etagwerker added the WIP label Aug 26, 2020
@etagwerker etagwerker removed the WIP label Aug 26, 2020
@etagwerker etagwerker requested review from rdormer and FionaDL August 26, 2020 20:57
Copy link
Member

@FionaDL FionaDL left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@etagwerker great article. What an interesting idea and topic! Just a few comments.


## Process

In order to calculate code coverage, I used [SimpleCov](https://github.com/simplecov-ruby/simplecov) and
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I wonder if you should link to @lubc 's new article here.

In order to calculate code coverage, I used [SimpleCov](https://github.com/simplecov-ruby/simplecov) and
analyzed Rails at [f22dd39](https://github.com/rails/rails/commit/f22dd39cb2adf85d3deeca61f9465206f7bd8df3).

I didn't run the entire test suite from Rails's root directory, I went into
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

consider saying "the Rails"

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

or just "root directory"

When you run ActionCable you will need to increase your `ulimit` and you will
need to have Redis running in your environment.

Before running each test suite, I went ahead and added this snippet at the
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

consider removing "went ahead and"


I had to add the `SimpleCov.command_name` to make sure that all the test rake
tasks are considered and automatically merged by `SimpleCov`. Without that line
I was getting unexpected results when running more than one _test_ rake task (e.g.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

is the extra space after "e.g" there on purpose?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

no, I'll fix it

Copy link
Contributor

@rdormer rdormer left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

very thorough write up :)

I used [SimpleCov](https://github.com/simplecov-ruby/simplecov) and
analyzed Rails at [f22dd39](https://github.com/rails/rails/commit/f22dd39cb2adf85d3deeca61f9465206f7bd8df3).

<<<<<<< HEAD:_posts/2020-09-01-what-is-code-coverage-ruby-on-rails.md
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@etagwerker This seems to be a git conflict, so I'm not sure which sentence to review. Could you fix them before I proceed?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@cleicar Just addressed your comment. Good catch! 💯

Copy link
Contributor

@cleicar cleicar left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Way to go @etagwerker. This is a very interesting and thorough article! Thanks

Copy link
Contributor

@lubc lubc left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@etagwerker Looks like you added the article twice

@etagwerker
Copy link
Member Author

@lubc oops, done.

@lubc lubc merged commit 991317d into main Sep 2, 2020
@lubc lubc deleted the post/what-is-rails-code-coverage-per-component branch September 2, 2020 14:18
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.

5 participants