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
This commit is contained in:
Paul Van Eck 2015-09-28 14:26:23 -07:00
parent 4c69e1764e
commit 2de6fb4b13
2 changed files with 3 additions and 3 deletions

View File

@ -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']:

View File

@ -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