Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Is there a way to exempt files / folders from Coveralls test coverage scoring?

My team is using coveralls.io in our CI process to give us an rspec coverage score. We're also using the ActiveAdmin gem for internal use and the decision was made to not cover ActiveAdmin functionality in our test coverage. Does anyone know how we can exempt the /app/admin folder from coveralls so that it doesn't drag our score down?

like image 867
roginc Avatar asked Aug 07 '13 21:08

roginc


People also ask

How do I ignore generated files from Go test coverage?

By using "_test" in the name definitions If you would like to ignore files which are used in the tests then make sense use _test at the end of the name. For example, my_service_mock_test.go . The files with _test at the end of the name will be ignored by default.

What is coveralls software?

Coveralls is a web service that allows users to track the code coverage of their application over time in order to optimize the effectiveness of their unit tests.

What is coveralls io?

Coveralls is a web service to help you track your code coverage over time, and ensure that all your new code is fully covered.


1 Answers

How I was able to solve this:

  1. Added file '.simplecov' to project root
  2. In '.simplecov' added code:

    require 'simplecov'
    require 'coveralls'
    
    SimpleCov.formatter = Coveralls::SimpleCov::Formatter
    SimpleCov.start do
       add_filter 'app/admin'
    end
    

Basic instructions on this functionality is described at https://github.com/colszowka/simplecov#string-filter

like image 54
roginc Avatar answered Sep 20 '22 11:09

roginc