Skip to content

Commit c205210

Browse files
committed
Merge pull request #889 from deis/test_hosts
fix(test): specify machine IPs
2 parents df58361 + fb38eb6 commit c205210

2 files changed

Lines changed: 8 additions & 6 deletions

File tree

test/README.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,5 +25,6 @@ $ bundle exec rake tests:create_cluster
2525
The test environment uses several environment variables, which can be set to customize the run:
2626
* `DEIS_TEST_AUTH_KEY` - SSH key used to register with the Deis controller -- will be generated if it doesn't exist (default: `~/.ssh/deis`)
2727
* `DEIS_TEST_KEY` - SSH key used to login to the controller machine (default: `~/.vagrant.d/insecure_private_key`)
28-
* `DEIS_TEST_HOST` - hostname which resolves to the controller host (default: `local.deisapp.com`)
28+
* `DEIS_TEST_HOSTNAME` - hostname which resolves to the controller host (default: `local.deisapp.com`)
29+
* `DEIS_TEST_HOSTS` - comma-separated list of IPs for nodes in the cluster -- should be internal IPs for cloud providers (default: `172.17.8.100`)
2930
* `DEIS_TEST_APP` - name of the Deis example app to use, which is cloned from GitHub (default: `example-ruby-sinatra`)

test/Rakefile

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,8 @@ require 'rainbow/ext/string'
55

66
AUTH_KEY = ENV['DEIS_TEST_KEY'] || '~/.ssh/deis'
77
SSH_KEY = ENV['DEIS_TEST_SSH_KEY'] || '~/.vagrant.d/insecure_private_key'
8-
HOST = ENV['DEIS_TEST_HOST'] || 'local.deisapp.com'
8+
HOSTS = ENV['DEIS_TEST_HOSTS'] || '172.17.8.100'
9+
HOSTNAME = ENV['DEIS_TEST_HOSTNAME'] || 'local.deisapp.com'
910
EXAMPLE_APP = ENV['DEIS_TEST_APP'] || 'example-ruby-sinatra'
1011

1112
namespace :setup do
@@ -21,16 +22,16 @@ end
2122
namespace :tests do
2223
task :all => ['register','login','add_key','create_cluster','create_app','push_app','scale_app','verify_app']
2324
task :register do
24-
run_command("deis register http://#{HOST}: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")
2526
end
2627
task :login do
27-
run_command("deis login http://#{HOST}:8000 --username=test --password=asdf1234")
28+
run_command("deis login http://#{HOSTNAME}:8000 --username=test --password=asdf1234")
2829
end
2930
task :add_key do
3031
run_command("deis keys:add #{AUTH_KEY}.pub")
3132
end
3233
task :create_cluster do
33-
run_command("deis init dev #{HOST} --hosts=#{HOST} --auth=#{SSH_KEY}")
34+
run_command("deis init dev #{HOSTNAME} --hosts=#{HOSTS} --auth=#{SSH_KEY}")
3435
end
3536
task :create_app do
3637
run_command("cd #{EXAMPLE_APP} && deis apps:create testing")
@@ -42,7 +43,7 @@ namespace :tests do
4243
run_command("cd #{EXAMPLE_APP} && deis scale web=2")
4344
end
4445
task :verify_app do
45-
run_command("curl -s http://testing.#{HOST} | grep -q 'Powered by Deis'")
46+
run_command("curl -s http://testing.#{HOSTNAME} | grep -q 'Powered by Deis'")
4647
end
4748
end
4849

0 commit comments

Comments
 (0)