-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #41 from inz/support/integration-test-suite
Setup integration test suite
- Loading branch information
Showing
40 changed files
with
4,745 additions
and
205 deletions.
There are no files selected for viewing
This file contains 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 contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
# https://github.com/colszowka/simplecov#using-simplecov-for-centralized-config | ||
# Maybe put some conditional here not to execute the code below unless ENV['COVERAGE'] == 'true' | ||
SimpleCov.start do | ||
# see https://github.com/colszowka/simplecov/blob/master/lib/simplecov/defaults.rb | ||
load_profile 'test_frameworks' | ||
coverage_dir 'coverage' | ||
command_name 'MiniTest' | ||
merge_timeout 3600 # 1 hour | ||
track_files "{app,lib}/**/*.rb" | ||
|
||
# Groups | ||
add_group 'Controllers', 'app/controllers' | ||
add_group 'Models', 'app/models' | ||
# add_group 'Mailers', 'app/mailers' | ||
add_group 'Helpers', 'app/helpers' | ||
add_group 'Jobs', %w(app/jobs app/workers) | ||
# add_group 'Libraries', 'lib' | ||
|
||
add_group 'Provider updater', 'app/provider_updater' | ||
add_group 'Long files' do |src_file| | ||
src_file.lines.count > 100 | ||
end | ||
class MaxLinesFilter < SimpleCov::Filter | ||
def matches?(source_file) | ||
source_file.lines.count < filter_argument | ||
end | ||
end | ||
add_group 'Short files', MaxLinesFilter.new(5) | ||
|
||
# Exclude these paths from analysis | ||
add_filter '/config/' | ||
add_filter '/db/' | ||
add_filter 'lib/plugins' | ||
add_filter 'vendor' | ||
add_filter 'bundle' | ||
end |
This file contains 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 contains 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 contains 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 contains 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 contains 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 contains 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 contains 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 contains 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 contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
# Recommended way to lint factories to avoid performance overhead if running few tests | ||
# https://github.com/thoughtbot/factory_girl/blob/master/GETTING_STARTED.md#linting-factories | ||
# Usage: `rake factory_girl:lint` | ||
namespace :factory_girl do | ||
desc 'Verify that all FactoryGirl factories are valid' | ||
task lint: :environment do | ||
if Rails.env.test? | ||
begin | ||
DatabaseCleaner.start | ||
FactoryGirl.lint | ||
ensure | ||
DatabaseCleaner.clean_with :transaction | ||
end | ||
else | ||
system("bundle exec rake factory_girl:lint RAILS_ENV='test'") | ||
end | ||
end | ||
end |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
# Usage: `rake test:coverage` | ||
namespace :test do | ||
task :coverage do | ||
require 'simplecov' | ||
Rake::Task['test'].execute | ||
end | ||
end |
This file contains 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 contains 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 contains 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
Oops, something went wrong.