Skip to content

Commit

Permalink
Moved task skip logic from helper into taskfile.
Browse files Browse the repository at this point in the history
  • Loading branch information
trevorrowe committed Jul 30, 2015
1 parent 0e81558 commit 88694af
Show file tree
Hide file tree
Showing 3 changed files with 27 additions and 25 deletions.
26 changes: 5 additions & 21 deletions aws-sdk-core/features/integration-test-config.rb
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
class IntegrationTestConfig

def initialize(path)
@path = path
@cfg = File.exists?(path) ? Aws::Json.load_file(path) : {}
def initialize(values)
@cfg = values
end

def value_at(*path)
Expand All @@ -22,13 +21,11 @@ def value_at(*path)
end

def load!
if ENV['AWS_INTEGRATION']
@cfg = new(path)
else
skip_integration_tests
end
@cfg = new(File.exists?(path) ? Aws::Json.load_file(path) : {})
end

private

def path
File.expand_path(File.join([
File.dirname(__FILE__),
Expand All @@ -38,19 +35,6 @@ def path
]))
end

private

def skip_integration_tests
msg = <<-MSG
*** skipping aws-sdk-resource integration tests ***
Export AWS_INTEGRATION=1 to enable integration tests
MSG
puts msg
exit(0)
end

end
end

Expand Down
13 changes: 11 additions & 2 deletions aws-sdk-core/tasks/test.rake
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,17 @@ task 'test:unit' => 'test:unit:aws-sdk-core'

desc 'aws-sdk-core integration tests'
task 'test:integration:aws-sdk-core' do |t|
Dir.chdir('aws-sdk-core') do
exec("bundle exec cucumber -t ~@veryslow")
if ENV['AWS_INTEGRATION']
Dir.chdir('aws-sdk-core') do
exec("bundle exec cucumber -t ~@veryslow")
end
else
puts(<<-MSG)
*** skipping aws-sdk-core integration tests ***
export AWS_INTEGRATION=1 to enable integration tests
MSG
end
end
task 'test:integration' => 'test:integration:aws-sdk-core'
13 changes: 11 additions & 2 deletions aws-sdk-resources/tasks/test.rake
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,17 @@ task 'test:unit' => 'test:unit:resource-name-collisions'

desc 'aws-sdk-resource integration tests'
task 'test:integration:aws-sdk-resources' do |t|
Dir.chdir('aws-sdk-resources') do
exec("bundle exec cucumber -t ~@veryslow")
if ENV['AWS_INTEGRATION']
Dir.chdir('aws-sdk-resources') do
exec("bundle exec cucumber -t ~@veryslow")
end
else
puts(<<-MSG)
*** skipping aws-sdk-core integration tests ***
export AWS_INTEGRATION=1 to enable integration tests
MSG
end
end
task 'test:integration' => 'test:integration:aws-sdk-resources'

0 comments on commit 88694af

Please sign in to comment.