14717: Fixups since tests now use config.yml
authorPeter Amstutz <pamstutz@veritasgenetics.com>
Thu, 25 Jul 2019 13:41:09 +0000 (09:41 -0400)
committerPeter Amstutz <pamstutz@veritasgenetics.com>
Thu, 25 Jul 2019 15:01:21 +0000 (11:01 -0400)
Also add curl oneliner to submit the current git head to developer-run-tests

Arvados-DCO-1.1-Signed-off-by: Peter Amstutz <pamstutz@veritasgenetics.com>

apps/workbench/test/controllers/healthcheck_controller_test.rb
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
apps/workbench/test/integration_helper.rb
services/api/test/functional/arvados/v1/healthcheck_controller_test.rb
services/crunch-run/git_mount_test.go
tools/jenkins/submit-ci-dev.sh [new file with mode: 0755]

index 45726e5a646f8aea9f7b8d855ab880cde1135d74..c3a0ddea906886e6b6e556cfb4a73375897d9c05 100644 (file)
@@ -16,7 +16,11 @@ class HealthcheckControllerTest < ActionController::TestCase
     [true, 'Bearer configuredmanagementtoken', 200, '{"health":"OK"}'],
   ].each do |enabled, header, error_code, error_msg|
     test "ping when #{if enabled then 'enabled' else 'disabled' end} with header '#{header}'" do
     [true, 'Bearer configuredmanagementtoken', 200, '{"health":"OK"}'],
   ].each do |enabled, header, error_code, error_msg|
     test "ping when #{if enabled then 'enabled' else 'disabled' end} with header '#{header}'" do
-      Rails.configuration.ManagementToken = 'configuredmanagementtoken' if enabled
+      if enabled
+        Rails.configuration.ManagementToken = 'configuredmanagementtoken'
+      else
+        Rails.configuration.ManagementToken = ""
+      end
 
       @request.headers['Authorization'] = header
       get :ping
 
       @request.headers['Authorization'] = header
       get :ping
index c414f8a7ad76e4a5c3844c0ce61a088fe5fcd403..d3f08c62bf2e54b046f5a5967a1f108596398670 100644 (file)
@@ -5,8 +5,6 @@
 require 'integration_helper'
 
 class AnonymousAccessTest < ActionDispatch::IntegrationTest
 require 'integration_helper'
 
 class AnonymousAccessTest < ActionDispatch::IntegrationTest
-  include KeepWebConfig
-
   # These tests don't do state-changing API calls. Save some time by
   # skipping the database reset.
   reset_api_fixtures :after_each_test, false
   # These tests don't do state-changing API calls. Save some time by
   # skipping the database reset.
   reset_api_fixtures :after_each_test, false
index 6dd3c526968f3f574ee4b5fcba5746f78fe57a5e..024a14605a239efde44ec094489a619f2dbc7199 100644 (file)
@@ -6,8 +6,6 @@ require 'integration_helper'
 require_relative 'integration_test_utils'
 
 class CollectionsTest < ActionDispatch::IntegrationTest
 require_relative 'integration_test_utils'
 
 class CollectionsTest < ActionDispatch::IntegrationTest
-  include KeepWebConfig
-
   setup do
     need_javascript
   end
   setup do
     need_javascript
   end
index b19c00dae99c9b8839ff904dec648e45833149e2..e2d3dc8ef374a49ce7005ec5771c20b80886c161 100644 (file)
@@ -6,8 +6,6 @@ require 'integration_helper'
 require 'helpers/download_helper'
 
 class DownloadTest < ActionDispatch::IntegrationTest
 require 'helpers/download_helper'
 
 class DownloadTest < ActionDispatch::IntegrationTest
-  include KeepWebConfig
-
   @@wrote_test_data = false
 
   setup do
   @@wrote_test_data = false
 
   setup do
index b54a31380ce93f9cbb0ae726a47a636e4ed57981..5dcdab748f6b1631d722850eca3295315c10ab0a 100644 (file)
@@ -8,8 +8,6 @@ require 'tmpdir'
 require 'integration_helper'
 
 class JobsTest < ActionDispatch::IntegrationTest
 require 'integration_helper'
 
 class JobsTest < ActionDispatch::IntegrationTest
-  include KeepWebConfig
-
   setup do
       need_javascript
   end
   setup do
       need_javascript
   end
index 34ee1f479a6a2a9a9eacd8402d79dd343bbaf08a..0c66e59c8cce0d3e03ed90e9952be8ff264c647e 100644 (file)
@@ -156,19 +156,6 @@ module HeadlessHelper
   end
 end
 
   end
 end
 
-module KeepWebConfig
-  def getport service
-    File.read(File.expand_path("../../../../tmp/#{service}.port", __FILE__))
-  end
-
-  def use_keep_web_config
-    @kwport = getport 'keep-web-ssl'
-    @kwdport = getport 'keep-web-dl-ssl'
-    Rails.configuration.Services.WebDAV.ExternalURL = URI("https://localhost:#{@kwport}")
-    Rails.configuration.Services.WebDAVDownload.ExternalURL = URI("https://localhost:#{@kwdport}")
-  end
-end
-
 class ActionDispatch::IntegrationTest
   # Make the Capybara DSL available in all integration tests
   include Capybara::DSL
 class ActionDispatch::IntegrationTest
   # Make the Capybara DSL available in all integration tests
   include Capybara::DSL
index 551eefa8787baf10e3507a8d6768484de06fb8df..76fdb0426d35e11dd7ae1f63795d2a7dce3d6909 100644 (file)
@@ -13,7 +13,11 @@ class Arvados::V1::HealthcheckControllerTest < ActionController::TestCase
     [true, 'Bearer configuredmanagementtoken', 200, '{"health":"OK"}'],
   ].each do |enabled, header, error_code, error_msg|
     test "ping when #{if enabled then 'enabled' else 'disabled' end} with header '#{header}'" do
     [true, 'Bearer configuredmanagementtoken', 200, '{"health":"OK"}'],
   ].each do |enabled, header, error_code, error_msg|
     test "ping when #{if enabled then 'enabled' else 'disabled' end} with header '#{header}'" do
-      Rails.configuration.ManagementToken = 'configuredmanagementtoken' if enabled
+      if enabled
+        Rails.configuration.ManagementToken = 'configuredmanagementtoken'
+      else
+        Rails.configuration.ManagementToken = ""
+      end
 
       @request.headers['Authorization'] = header
       get :ping
 
       @request.headers['Authorization'] = header
       get :ping
index 4dc95bc3dfae529069595cc996ef23ab1b83cb09..5796ad7a278cfbb79df34210d3c81880e979a67b 100644 (file)
@@ -6,9 +6,11 @@ package main
 
 import (
        "io/ioutil"
 
 import (
        "io/ioutil"
+       "net/url"
        "os"
        "path/filepath"
 
        "os"
        "path/filepath"
 
+       "git.curoverse.com/arvados.git/lib/config"
        "git.curoverse.com/arvados.git/sdk/go/arvados"
        "git.curoverse.com/arvados.git/sdk/go/arvadostest"
        check "gopkg.in/check.v1"
        "git.curoverse.com/arvados.git/sdk/go/arvados"
        "git.curoverse.com/arvados.git/sdk/go/arvadostest"
        check "gopkg.in/check.v1"
@@ -203,7 +205,11 @@ func (s *GitMountSuite) checkTmpdirContents(c *check.C, expect []string) {
 func (*GitMountSuite) useTestGitServer(c *check.C) {
        git_client.InstallProtocol("https", git_http.NewClient(arvados.InsecureHTTPClient))
 
 func (*GitMountSuite) useTestGitServer(c *check.C) {
        git_client.InstallProtocol("https", git_http.NewClient(arvados.InsecureHTTPClient))
 
-       port, err := ioutil.ReadFile("../../tmp/arv-git-httpd-ssl.port")
+       loader := config.NewLoader(nil, nil)
+       cfg, err := loader.Load()
        c.Assert(err, check.IsNil)
        c.Assert(err, check.IsNil)
-       discoveryMap["gitUrl"] = "https://localhost:" + string(port)
+       cluster, err := cfg.GetCluster("")
+       c.Assert(err, check.IsNil)
+
+       discoveryMap["gitUrl"] = (*url.URL)(&cluster.Services.GitHTTP.ExternalURL).String()
 }
 }
diff --git a/tools/jenkins/submit-ci-dev.sh b/tools/jenkins/submit-ci-dev.sh
new file mode 100755 (executable)
index 0000000..7188c15
--- /dev/null
@@ -0,0 +1,9 @@
+#!/bin/sh
+# Copyright (C) The Arvados Authors. All rights reserved.
+#
+# SPDX-License-Identifier: AGPL-3.0
+
+head=$(git log --first-parent --max-count=1 --format=%H)
+curl -X POST https://ci.curoverse.com/job/developer-run-tests/build \
+  --user $(cat ~/.jenkins.ci.curoverse.com) \
+  --data-urlencode json='{"parameter": [{"name":"git_hash", "value":"'$head'"}]}'