From 2de6fb4b13d246d88c2a48a4a62419fdbf1e6958 Mon Sep 17 00:00:00 2001 From: Paul Van Eck Date: Mon, 28 Sep 2015 14:26:23 -0700 Subject: [PATCH] Fix functional tests Trying to run 'tox -v -epy27-func-mysql' yields errors. Changed the connection string to contain '+pymysql' like the real connection string. Also a test failure was resolved as one of the tests was still expecting CPID when it shouldn't. Change-Id: I507ef60758ca80d9ec2d47cef5dd4542c920171f --- refstack/tests/api/test_api.py | 4 ++-- setup-mysql-tests.sh | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/refstack/tests/api/test_api.py b/refstack/tests/api/test_api.py index 2451504c..3ec3ecaa 100644 --- a/refstack/tests/api/test_api.py +++ b/refstack/tests/api/test_api.py @@ -73,8 +73,8 @@ class TestResultsController(api.FunctionalTest): results = json.dumps(FAKE_TESTS_RESULT) post_response = self.post_json(self.URL, params=results) get_response = self.get_json(self.URL + post_response.get('test_id')) - self.assertEqual(FAKE_TESTS_RESULT['cpid'], - get_response['cpid']) + # CPID is only exposed to the owner. + self.assertNotIn('cpid', get_response) self.assertEqual(FAKE_TESTS_RESULT['duration_seconds'], get_response['duration_seconds']) for test in FAKE_TESTS_RESULT['results']: diff --git a/setup-mysql-tests.sh b/setup-mysql-tests.sh index 1729a0f4..4d2b37d2 100755 --- a/setup-mysql-tests.sh +++ b/setup-mysql-tests.sh @@ -24,7 +24,7 @@ PATH=$PATH:/usr/libexec mysqld --no-defaults --datadir=${MYSQL_DATA} --pid-file=${MYSQL_DATA}/mysql.pid --socket=${MYSQL_DATA}/mysql.socket --skip-networking --skip-grant-tables &> ${MYSQL_DATA}/out & # Wait for MySQL to start listening to connections wait_for_line "mysqld: ready for connections." ${MYSQL_DATA}/out -export REFSTACK_TEST_MYSQL_URL="mysql://root@localhost/test?unix_socket=${MYSQL_DATA}/mysql.socket&charset=utf8" +export REFSTACK_TEST_MYSQL_URL="mysql+pymysql://root@localhost/test?unix_socket=${MYSQL_DATA}/mysql.socket&charset=utf8" mysql --no-defaults -S ${MYSQL_DATA}/mysql.socket -e 'CREATE DATABASE test;' # Yield execution to venv command