Last active
June 19, 2018 00:33
-
-
Save jesperronn/5800bf032ca743407dd1 to your computer and use it in GitHub Desktop.
CircleCI Simplecov artifact (https://circleci.com/docs/code-coverage)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
SimpleCov.coverage_dir('tmp/coverage') | |
# save to CircleCI's artifacts directory if we're on CircleCI | |
# see https://circleci.com/docs/code-coverage | |
if ENV['CIRCLE_ARTIFACTS'] | |
dir = File.join(ENV['CIRCLE_ARTIFACTS'], 'coverage') | |
SimpleCov.coverage_dir(dir) | |
end | |
require 'simplecov-csv' | |
require 'simplecov-cobertura' | |
require 'simplecov-json' | |
require 'simplecov-text' | |
SimpleCov.formatters = [ | |
SimpleCov::Formatter::HTMLFormatter, | |
SimpleCov::Formatter::CSVFormatter, | |
SimpleCov::Formatter::CoberturaFormatter, | |
SimpleCov::Formatter::JSONFormatter, | |
SimpleCov::Formatter::TextFormatter | |
] | |
SimpleCov.start 'rails' |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
group :test do | |
gem 'simplecov', require: false | |
gem 'simplecov-cobertura', require: false | |
gem 'simplecov-csv', require: false | |
gem 'simplecov-json', require: false | |
gem 'simplecov-text', require: false | |
end |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# This file is copied to spec/ when you run 'rails generate rspec:install' | |
ENV['RAILS_ENV'] ||= 'test' | |
require File.expand_path('../../config/environment', __FILE__) | |
# Prevent database truncation if the environment is production | |
abort("The Rails environment is running in production mode!") if Rails.env.production? | |
require 'spec_helper' | |
require 'rspec/rails' | |
Dir[Rails.root.join("spec/support/**/*.rb")].each { |f| require f } | |
# Checks for pending migrations before tests are run. | |
# If you are not using ActiveRecord, you can remove this line. | |
ActiveRecord::Migration.maintain_test_schema! | |
RSpec.configure do |config| | |
# The different available types are documented in the features, such as in | |
# https://relishapp.com/rspec/rspec-rails/docs | |
config.infer_spec_type_from_file_location! | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment