summaryrefslogtreecommitdiff
path: root/tests/white-box/webapp.rb
diff options
context:
space:
mode:
authorelijah <elijah@riseup.net>2014-12-17 16:22:29 -0800
committerelijah <elijah@riseup.net>2014-12-17 16:22:29 -0800
commitb49fc6c4a864c6e42a4fd4deae25c0ab2eb564ea (patch)
tree896ba1487d395cc15e14c8176846019a05de69cd /tests/white-box/webapp.rb
parent25569d4598d86c6b992c35d8bbede8510483cdc6 (diff)
tests: don't run soledad test if there are no soledad nodes
Diffstat (limited to 'tests/white-box/webapp.rb')
-rw-r--r--tests/white-box/webapp.rb24
1 files changed, 15 insertions, 9 deletions
diff --git a/tests/white-box/webapp.rb b/tests/white-box/webapp.rb
index d5d41833..9f104899 100644
--- a/tests/white-box/webapp.rb
+++ b/tests/white-box/webapp.rb
@@ -50,12 +50,14 @@ class Webapp < LeapTest
soledad_config = property('definition_files.soledad_service')
if soledad_config && !soledad_config.empty?
soledad_server = pick_soledad_server(soledad_config)
- assert_tmp_user do |user|
- assert_user_db_exists(user)
- command = File.expand_path "../../helpers/soledad_sync.py", __FILE__
- soledad_url = "https://#{soledad_server}/user-#{user.id}"
- assert_run "#{command} #{user.id} #{user.session_token} #{soledad_url}"
- pass
+ if soledad_server
+ assert_tmp_user do |user|
+ assert_user_db_exists(user)
+ command = File.expand_path "../../helpers/soledad_sync.py", __FILE__
+ soledad_url = "https://#{soledad_server}/user-#{user.id}"
+ assert_run "#{command} #{user.id} #{user.session_token} #{soledad_url}"
+ pass
+ end
end
else
skip 'No soledad service configuration'
@@ -78,9 +80,13 @@ class Webapp < LeapTest
def pick_soledad_server(soledad_config_json_str)
soledad_config = JSON.parse(soledad_config_json_str)
host_name = soledad_config['hosts'].keys.shuffle.first
- hostname = soledad_config['hosts'][host_name]['hostname']
- port = soledad_config['hosts'][host_name]['port']
- return "#{hostname}:#{port}"
+ if host_name
+ hostname = soledad_config['hosts'][host_name]['hostname']
+ port = soledad_config['hosts'][host_name]['port']
+ return "#{hostname}:#{port}"
+ else
+ return nil
+ end
end
#