Merge "switch mysql functional tests to PyMySQL"

This commit is contained in:
Zuul 2018-07-02 12:46:49 +00:00 committed by Gerrit Code Review
commit bfe6c895fa
2 changed files with 12 additions and 6 deletions

View File

@ -241,6 +241,9 @@ class SchedulerServiceTest(base.DbTestCase):
self._assert_single_item(calls, target_method_name=TARGET_METHOD_PATH)
self.queue.get()
eventlet.sleep(0.1)
self.assertRaises(
exc.DBEntityNotFoundError,
db_api.get_delayed_call,
@ -335,7 +338,4 @@ class SchedulerServiceTest(base.DbTestCase):
for _ in range(number_delayed_calls):
self.queue.get()
self.assertEqual(
[2, 2, 1],
processed_calls_at_time
)
self.assertListEqual([1, 2, 2], sorted(processed_calls_at_time))

View File

@ -139,7 +139,7 @@ function setup_db_pylib {
;;
mysql )
echo "Installing python library for MySQL"
${wrapper} pip install mysql-python
${wrapper} pip install PyMySQL
;;
esac
}
@ -149,12 +149,18 @@ function setup_db_cfg {
sqlite )
rm -f .mistral.conf
;;
"postgresql" | "mysql" )
"postgresql" )
oslo-config-generator --config-file \
./tools/config/config-generator.mistral.conf \
--output-file .mistral.conf
sed -i "s/#connection = <None>/connection = $db_type:\/\/$username:$password@localhost\/$dbname/g" .mistral.conf
;;
"mysql" )
oslo-config-generator --config-file \
./tools/config/config-generator.mistral.conf \
--output-file .mistral.conf
sed -i "s/#connection = <None>/connection = mysql+pymysql:\/\/$username:$password@localhost\/$dbname/g" .mistral.conf
;;
esac
}