-
Notifications
You must be signed in to change notification settings - Fork 137
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
Improve the test suite #143
Changes from 1 commit
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -13,4 +13,5 @@ end | |
group :test do | ||
gem 'webmock', require: false | ||
gem 'vcr', require: false | ||
gem 'codecov', :require => false | ||
end |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,7 @@ | ||
#!/bin/bash | ||
|
||
if [ "$TRAVIS_SECURE_ENV_VARS" == "true" ]; then | ||
MODE=full bundle exec rake all | ||
bundle exec rake all | ||
else | ||
bundle exec rake spec | ||
fi |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,17 @@ | ||
require 'pry' | ||
require 'rack/test' | ||
require 'faker' | ||
require 'auth0' | ||
|
||
require 'simplecov' | ||
SimpleCov.start do | ||
add_filter '/spec/' | ||
add_filter '/spec/integration' | ||
end | ||
|
||
require 'codecov' | ||
SimpleCov.formatter = SimpleCov::Formatter::Codecov if ENV['TRAVIS'] | ||
|
||
require 'dotenv' | ||
Dotenv.load | ||
|
||
|
@@ -6,6 +20,7 @@ | |
|
||
require 'vcr' | ||
VCR.configure do |config| | ||
# Uncomment the line below to record new cassettes | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. what does that mean? should it be clarified? |
||
# config.allow_http_connections_when_no_cassette = true | ||
config.cassette_library_dir = 'spec/fixtures/vcr_cassettes' | ||
config.configure_rspec_metadata! | ||
|
@@ -14,25 +29,30 @@ | |
config.filter_sensitive_data('API_TOKEN') { ENV['MASTER_JWT'] } | ||
end | ||
|
||
mode = ENV['MODE'] || 'unit' | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Removed the test mode now that we're using VCR There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. VCR? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. |
||
|
||
$LOAD_PATH.unshift File.expand_path('..', __FILE__) | ||
$LOAD_PATH.unshift File.expand_path('../../lib', __FILE__) | ||
|
||
require 'rspec' | ||
require 'rack/test' | ||
require 'faker' | ||
require 'auth0' | ||
|
||
Dir['./lib/**/*.rb'].each { |f| require f } | ||
Dir['./spec/support/**/*.rb'].each { |f| require f } | ||
Dir['./spec/support/*.rb'].each { |f| require f } | ||
|
||
require 'rspec' | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. cosmetic but, shouldn't this be on the top of the file instead of flying here? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Actually no ... |
||
RSpec.configure do |config| | ||
config.filter_run focus: true | ||
config.run_all_when_everything_filtered = true | ||
config.include Credentials | ||
end | ||
|
||
def wait(time, increment = 5, elapsed_time = 0, &block) | ||
yield | ||
rescue RSpec::Expectations::ExpectationNotMetError => e | ||
raise e if elapsed_time >= time | ||
sleep increment | ||
wait(time, increment, elapsed_time + increment, &block) | ||
end | ||
|
||
def entity_suffix | ||
'rubytest' | ||
end | ||
|
||
puts "Entity suffix is #{entity_suffix}" | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Moving test mode-specific code |
||
puts "Running in mode #{mode}" | ||
|
||
require_relative "spec_helper_#{mode}.rb" | ||
puts "Entity suffix is #{entity_suffix}" |
This file was deleted.
This file was deleted.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
why the arrow?