14717: Make sure tests use git http and keep-web URLs from config.yml
authorPeter Amstutz <pamstutz@veritasgenetics.com>
Thu, 25 Jul 2019 20:41:03 +0000 (16:41 -0400)
committerPeter Amstutz <pamstutz@veritasgenetics.com>
Thu, 25 Jul 2019 20:41:03 +0000 (16:41 -0400)
Arvados-DCO-1.1-Signed-off-by: Peter Amstutz <pamstutz@veritasgenetics.com>

apps/workbench/config/application.default.yml
apps/workbench/test/integration/repositories_browse_test.rb
apps/workbench/test/integration/user_settings_menu_test.rb
services/api/app/models/repository.rb

index 8d1dff995248d9f98feaea4b77ff5ba723b0a738..9456e61455c306cb7b19db7963366c34a55b1345 100644 (file)
@@ -79,18 +79,6 @@ test:
   profiling_enabled: true
   secret_token: <%= rand(2**256).to_s(36) %>
   secret_key_base: <%= rand(2**256).to_s(36) %>
-  # This setting is to allow workbench start when running tests, it should be
-  # set to a correct value when testing relevant features.
-  keep_web_url: http://example.com/c=%{uuid_or_pdh}
-
-  # When you run the Workbench's integration tests, it starts the API
-  # server as a dependency.  These settings should match the API
-  # server's Rails defaults.  If you adjust those, change these
-  # settings in application.yml to match.
-  arvados_login_base: https://localhost:3000/login
-  arvados_v1_base: https://localhost:3000/arvados/v1
-  arvados_insecure_https: true
-
   site_name: Workbench:test
 
   # Enable user profile with one required field
index e668b8ca18017ec7076f33e7de643803c10e90ea..056598ef11e1719cf92409947b12be34d6d0485a 100644 (file)
@@ -41,12 +41,9 @@ class RepositoriesTest < ActionDispatch::IntegrationTest
 
   test "browse using arv-git-http" do
     repo = api_fixture('repositories')['foo']
-    portfile =
-      File.expand_path('../../../../../tmp/arv-git-httpd-ssl.port', __FILE__)
-    gitsslport = File.read(portfile)
     Repository.any_instance.
       stubs(:http_fetch_url).
-      returns "https://localhost:#{gitsslport}/#{repo['name']}.git"
+      returns "#{Rails.configuration.Services.GitHTTP.ExternalURL.to_s}/#{repo['name']}.git"
     commit_sha1 = '1de84a854e2b440dc53bf42f8548afa4c17da332'
     visit page_with_token('active', "/repositories/#{repo['uuid']}/commit/#{commit_sha1}")
     assert_text "Date:   Tue Mar 18 15:55:28 2014 -0400"
index 562dc7d1f41cb885aee778aace35ae81d9e2d11f..5f2886c7a3a0bb7277cf3b536dc65fbc25fac136 100644 (file)
@@ -188,7 +188,7 @@ class UserSettingsMenuTest < ActionDispatch::IntegrationTest
     end
     assert_text ":active/workbenchtest.git"
     assert_match /git@git.*:active\/workbenchtest.git/, page.text
-    assert_match /https:\/\/git.*\/active\/workbenchtest.git/, page.text
+    assert_match /#{Rails.configuration.Services.GitHTTP.ExternalURL.to_s}\/active\/workbenchtest.git/, page.text
   end
 
   [
index 5e0e39f9bedb090d7b566b3ddf9389c8f10f95dd..e6a0795402b36415cc6bc4019a6b760fd4396435 100644 (file)
@@ -115,6 +115,9 @@ class Repository < ArvadosModel
     else
       base = URI(default_base_fmt % prefix)
     end
+    if base.path == ""
+      base.path = "/"
+    end
     if base.scheme == "ssh"
       '%s@%s:%s.git' % [base.user, base.host, name]
     else