14717: More test fixes. Configure correct websockets address.
authorPeter Amstutz <pamstutz@veritasgenetics.com>
Thu, 25 Jul 2019 18:28:08 +0000 (14:28 -0400)
committerPeter Amstutz <pamstutz@veritasgenetics.com>
Thu, 25 Jul 2019 18:28:08 +0000 (14:28 -0400)
Arvados-DCO-1.1-Signed-off-by: Peter Amstutz <pamstutz@veritasgenetics.com>

apps/workbench/test/integration/anonymous_access_test.rb
apps/workbench/test/integration/collections_test.rb
apps/workbench/test/integration/download_test.rb
apps/workbench/test/integration/jobs_test.rb
sdk/python/tests/run_test_server.py
services/api/config/application.default.yml

index d3f08c62bf2e54b046f5a5967a1f108596398670..0842635f603ff00ad93dbb15581950f860c37567 100644 (file)
@@ -117,8 +117,6 @@ class AnonymousAccessTest < ActionDispatch::IntegrationTest
   end
 
   test 'view file' do
-    use_keep_web_config
-
     magic = rand(2**512).to_s 36
     owner = api_fixture('groups')['anonymously_accessible_project']['uuid']
     col = upload_data_and_get_collection(magic, 'admin', "Hello\\040world.txt", owner)
index 024a14605a239efde44ec094489a619f2dbc7199..87d3d678d174c99e03f527c58a6970f05c122f11 100644 (file)
@@ -53,8 +53,6 @@ class CollectionsTest < ActionDispatch::IntegrationTest
   end
 
   test "can download an entire collection with a reader token" do
-    use_keep_web_config
-
     token = api_token('active')
     data = "foo\nfile\n"
     datablock = `echo -n #{data.shellescape} | ARVADOS_API_TOKEN=#{token.shellescape} arv-put --no-progress --raw -`.strip
index e2d3dc8ef374a49ce7005ec5771c20b80886c161..6ae9f29274eb27a135c64a1d9492fc4161ae1534 100644 (file)
@@ -9,8 +9,6 @@ class DownloadTest < ActionDispatch::IntegrationTest
   @@wrote_test_data = false
 
   setup do
-    use_keep_web_config
-
     # Make sure Capybara can download files.
     need_selenium 'for downloading', :selenium_with_download
     DownloadHelper.clear
index 5dcdab748f6b1631d722850eca3295315c10ab0a..a66dfd80301c0ca7cbcf35c4e4075b38da456a38 100644 (file)
@@ -39,7 +39,6 @@ class JobsTest < ActionDispatch::IntegrationTest
 
   test 'view partial job log' do
     need_selenium 'to be able to see the CORS response headers (PhantomJS 1.9.8 does not)'
-    use_keep_web_config
 
     # This config will be restored during teardown by ../test_helper.rb:
     Rails.configuration.Workbench.LogViewerMaxBytes = 100
@@ -59,8 +58,6 @@ class JobsTest < ActionDispatch::IntegrationTest
   end
 
   test 'view log via keep-web redirect' do
-    use_keep_web_config
-
     token = api_token('active')
     logdata = fakepipe_with_log_data.read
     logblock = `echo -n #{logdata.shellescape} | ARVADOS_API_TOKEN=#{token.shellescape} arv-put --no-progress --raw -`.strip
index b073eff40d1bb7e0d446cea4feeb3ee0bfbeceb8..6c3585dd8a10c379a1b4c46bcf5a3ca06e4baf5c 100644 (file)
@@ -26,6 +26,11 @@ import time
 import unittest
 import yaml
 
+try:
+    from urllib.parse import urlparse
+except ImportError:
+    from urlparse import urlparse
+
 MY_DIRNAME = os.path.dirname(os.path.realpath(__file__))
 if __name__ == '__main__' and os.path.exists(
       os.path.join(MY_DIRNAME, '..', 'arvados', '__init__.py')):
@@ -395,10 +400,12 @@ def get_config():
         return yaml.safe_load(f)
 
 def internal_port_from_config(service):
-    return int(list(get_config()["Clusters"]["zzzzz"]["Services"][service]["InternalURLs"].keys())[0].split(":")[2])
+    return int(urlparse(
+        list(get_config()["Clusters"]["zzzzz"]["Services"][service]["InternalURLs"].keys())[0]).
+               netloc.split(":")[1])
 
 def external_port_from_config(service):
-    return int(get_config()["Clusters"]["zzzzz"]["Services"][service]["ExternalURL"].split(":")[2])
+    return int(urlparse(get_config()["Clusters"]["zzzzz"]["Services"][service]["ExternalURL"]).netloc.split(":")[1])
 
 def run_controller():
     if 'ARVADOS_TEST_PROXY_SERVICES' in os.environ:
@@ -691,7 +698,7 @@ def setup_config():
             "InternalURLs": { }
         },
         "Websocket": {
-            "ExternalURL": "https://localhost:%s" % websocket_external_port,
+            "ExternalURL": "wss://localhost:%s/websocket" % websocket_external_port,
             "InternalURLs": { }
         },
         "GitHTTP": {
index 3ad3cac2b27e3f750c8607856d3092d72ff6e669..4e1936b7716c65561d7592debbe9a3d5c5cfb51e 100644 (file)
@@ -86,6 +86,5 @@ test:
   workbench_address: https://localhost:3001/
   git_repositories_dir: <%= Rails.root.join 'tmp', 'git', 'test' %>
   git_internal_dir: <%= Rails.root.join 'tmp', 'internal.git' %>
-  websocket_address: "wss://0.0.0.0:<%= ENV['ARVADOS_TEST_WSS_PORT'] %>/websocket"
   trash_sweep_interval: -1
   docker_image_formats: ["v1"]