Skip to content

Commit f202918

Browse files
committed
Merge pull request #947 from deis/integration-test-fixes
fix(test): don't fail if already registered, and pause for builder
2 parents 1174bf0 + 90c73d0 commit f202918

1 file changed

Lines changed: 14 additions & 5 deletions

File tree

test/Rakefile

Lines changed: 14 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ end
2222
namespace :tests do
2323
task :all => ['register','login','add_key','create_cluster','create_app','push_app','scale_app','verify_app']
2424
task :register do
25-
run_command("deis register http://#{HOSTNAME}:8000 --username=test --email=test@test.co.nz --password=asdf1234")
25+
run_command("deis register http://#{HOSTNAME}:8000 --username=test --email=test@test.co.nz --password=asdf1234 || true")
2626
end
2727
task :login do
2828
run_command("deis login http://#{HOSTNAME}:8000 --username=test --password=asdf1234")
@@ -34,13 +34,20 @@ namespace :tests do
3434
run_command("deis init dev #{HOSTNAME} --hosts=#{HOSTS} --auth=#{SSH_KEY}")
3535
end
3636
task :create_app do
37-
run_command("cd #{EXAMPLE_APP} && deis apps:create testing")
37+
Dir.chdir(EXAMPLE_APP) do
38+
sleep 6 # give builder git time to wake up
39+
run_command('deis apps:create testing')
40+
end
3841
end
3942
task :push_app do
40-
run_command("cd #{EXAMPLE_APP} && git push deis master")
43+
Dir.chdir(EXAMPLE_APP) do
44+
run_command('git push deis master')
45+
end
4146
end
4247
task :scale_app do
43-
run_command("cd #{EXAMPLE_APP} && deis scale web=2")
48+
Dir.chdir(EXAMPLE_APP) do
49+
run_command('deis scale web=2')
50+
end
4451
end
4552
task :verify_app do
4653
run_command("curl -s http://testing.#{HOSTNAME} | grep -q 'Powered by Deis'")
@@ -50,7 +57,9 @@ end
5057
namespace :cleanup do
5158
task :all => ['destroy_app','destroy_cluster','remove_key','logout']
5259
task :destroy_app do
53-
run_command("cd #{EXAMPLE_APP} && deis apps:destroy --app=testing --confirm=testing")
60+
Dir.chdir(EXAMPLE_APP) do
61+
run_command('deis apps:destroy --app=testing --confirm=testing')
62+
end
5463
end
5564
task :destroy_cluster do
5665
run_command("deis clusters:destroy dev --confirm=dev")

0 commit comments

Comments
 (0)