Permalink
Browse files

Bucket names globally unique. Require that one be provided to run rem…

…ote tests
  • Loading branch information...
1 parent 5926923 commit 91a022cf3459cc410529ed9d6e141b69564557d8 @packagethief packagethief committed Oct 16, 2009
Showing with 12 additions and 2 deletions.
  1. +11 −1 Rakefile
  2. +1 −1 test/remote/test_helper.rb
View
@@ -212,7 +212,17 @@ namespace :test do
show_test_coverage_results
end
- Rake::TestTask.new(:remote) do |test|
+ namespace :remote do
+ task :preflight_check do
+ required_vars = %w(AMAZON_ACCESS_KEY_ID AMAZON_SECRET_ACCESS_KEY TEST_BUCKET)
+
+ if (missing_vars = required_vars.select { |k| ENV[k].nil? }).any?
+ abort 'You must set ' + missing_vars.join(', ')
+ end
+ end
+ end
+
+ Rake::TestTask.new(:remote => 'remote:preflight_check') do |test|
test.pattern = 'test/remote/*_test.rb'
test.verbose = true
end
@@ -7,7 +7,7 @@
rescue LoadError
end
-TEST_BUCKET = 'aws-s3-tests'
+TEST_BUCKET = ENV['TEST_BUCKET']
TEST_FILE = File.dirname(__FILE__) + '/test_file.data'
class Test::Unit::TestCase

0 comments on commit 91a022c

Please sign in to comment.