[ARVADOS] created: 1.3.0-1311-gf9953acbb

Git user git at public.curoverse.com
Mon Jul 15 18:10:27 UTC 2019


        at  f9953acbb4ca9c82296a9053da29a6d6842450b2 (commit)


commit f9953acbb4ca9c82296a9053da29a6d6842450b2
Author: Peter Amstutz <pamstutz at veritasgenetics.com>
Date:   Mon Jul 15 14:02:51 2019 -0400

    Fix testing on master
    
    Arvados-DCO-1.1-Signed-off-by: Peter Amstutz <pamstutz at veritasgenetics.com>

diff --git a/build/run-tests.sh b/build/run-tests.sh
index 85504db03..4027f9748 100755
--- a/build/run-tests.sh
+++ b/build/run-tests.sh
@@ -255,12 +255,12 @@ sanity_checks() {
     echo -n 'libpq libpq-fe.h: '
     find /usr/include -path '*/postgresql/libpq-fe.h' | egrep --max-count=1 . \
         || fatal "No libpq libpq-fe.h. Try: apt-get install libpq-dev"
-    echo -n 'services/api/config/database.yml: '
-    if [[ ! -f "$WORKSPACE/services/api/config/database.yml" ]]; then
-	    fatal "Please provide a database.yml file for the test suite"
-    else
-	    echo "OK"
-    fi
+    #echo -n 'services/api/config/database.yml: '
+    #if [[ ! -f "$WORKSPACE/services/api/config/database.yml" ]]; then
+	#    fatal "Please provide a database.yml file for the test suite"
+    #else
+	#    echo "OK"
+    #fi
     echo -n 'postgresql: '
     psql --version || fatal "No postgresql. Try: apt-get install postgresql postgresql-client-common"
     echo -n 'phantomjs: '
@@ -626,11 +626,26 @@ initialize() {
 
     unset http_proxy https_proxy no_proxy
 
-
     # Note: this must be the last time we change PATH, otherwise rvm will
     # whine a lot.
     setup_ruby_environment
 
+    if [[ -s "$CONFIGSRC/config.yml" ]] ; then
+	cp "$CONFIGSRC/config.yml" "$temp/test-config.yml"
+    else
+	if [[ -s /etc/arvados/config.yml ]] ; then
+	    python > "$temp/test-config.yml" <<EOF
+import yaml
+import json
+v = list(yaml.safe_load(open('/etc/arvados/config.yml'))['Clusters'].values())[0]['PostgreSQL']
+v['Connection']['dbname'] = 'arvados_test'
+print(json.dumps({"Clusters": { "zzzzz": {'PostgreSQL': v}}}))
+EOF
+	    test_database=$(cat $temp/db.yml)
+	fi
+    fi
+    export ARVADOS_CONFIG="$temp/test-config.yml"
+
     echo "PATH is $PATH"
 }
 
diff --git a/lib/config/load_test.go b/lib/config/load_test.go
index eea3efbd9..340eb0a0a 100644
--- a/lib/config/load_test.go
+++ b/lib/config/load_test.go
@@ -231,7 +231,9 @@ func (s *LoadSuite) checkSAMPLEKeys(c *check.C, path string, x interface{}) {
 }
 
 func (s *LoadSuite) TestDefaultConfigHasAllSAMPLEKeys(c *check.C) {
-	cfg, err := Load(bytes.NewBuffer(DefaultYAML), ctxlog.TestLogger(c))
+	var logbuf bytes.Buffer
+	loader := testLoader(c, string(DefaultYAML), &logbuf)
+	cfg, err := loader.Load()
 	c.Assert(err, check.IsNil)
 	s.checkSAMPLEKeys(c, "", cfg)
 }
diff --git a/sdk/python/tests/run_test_server.py b/sdk/python/tests/run_test_server.py
index 9b0676b59..d11c393d3 100644
--- a/sdk/python/tests/run_test_server.py
+++ b/sdk/python/tests/run_test_server.py
@@ -440,8 +440,8 @@ Clusters:
             beta14287=('true' if '14287' in os.environ.get('ARVADOS_EXPERIMENTAL', '') else 'false'),
             loglevel=('info' if os.environ.get('ARVADOS_DEBUG', '') in ['','0'] else 'debug'),
             dbhost=_dbconfig('host'),
-            dbname=_dbconfig('database'),
-            dbuser=_dbconfig('username'),
+            dbname=_dbconfig('dbname'),
+            dbuser=_dbconfig('user'),
             dbpass=_dbconfig('password'),
             controllerport=port,
             railsport=rails_api_port,
@@ -484,8 +484,8 @@ Postgres:
                    port,
                    ('info' if os.environ.get('ARVADOS_DEBUG', '') in ['','0'] else 'debug'),
                    _dbconfig('host'),
-                   _dbconfig('database'),
-                   _dbconfig('username'),
+                   _dbconfig('dbname'),
+                   _dbconfig('user'),
                    _dbconfig('password')))
     logf = open(_logfilename('ws'), 'a')
     ws = subprocess.Popen(
@@ -750,9 +750,14 @@ def _getport(program):
 def _dbconfig(key):
     global _cached_db_config
     if not _cached_db_config:
-        _cached_db_config = yaml.safe_load(open(os.path.join(
-            SERVICES_SRC_DIR, 'api', 'config', 'database.yml')))
-    return _cached_db_config['test'][key]
+        if "ARVADOS_CONFIG" in os.environ:
+            _cached_db_config = list(yaml.safe_load(open(os.environ["ARVADOS_CONFIG"]))["Clusters"].values())[0]["PostgreSQL"]["Connection"]
+        else:
+            _cached_db_config = yaml.safe_load(open(os.path.join(
+                SERVICES_SRC_DIR, 'api', 'config', 'database.yml')))["test"]
+            _cached_db_config["dbname"] = _cached_db_config["database"]
+            _cached_db_config["username"] = _cached_db_config["user"]
+    return _cached_db_config[key]
 
 def _apiconfig(key):
     global _cached_config
diff --git a/services/api/test/functional/arvados/v1/schema_controller_test.rb b/services/api/test/functional/arvados/v1/schema_controller_test.rb
index e62faa331..53421a4cb 100644
--- a/services/api/test/functional/arvados/v1/schema_controller_test.rb
+++ b/services/api/test/functional/arvados/v1/schema_controller_test.rb
@@ -84,7 +84,7 @@ class Arvados::V1::SchemaControllerTest < ActionController::TestCase
     group_index_params = discovery_doc['resources']['groups']['methods']['index']['parameters']
     group_contents_params = discovery_doc['resources']['groups']['methods']['contents']['parameters']
 
-    assert_equal group_contents_params.keys.sort, (group_index_params.keys - ['select'] + ['uuid', 'recursive']).sort
+    assert_equal group_contents_params.keys.sort, (group_index_params.keys - ['select'] + ['uuid', 'recursive', 'include']).sort
 
     recursive_param = group_contents_params['recursive']
     assert_equal 'boolean', recursive_param['type']

-----------------------------------------------------------------------


hooks/post-receive
-- 




More information about the arvados-commits mailing list