test_migrations test does not do what it is supposed to do
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
Aodh |
Fix Released
|
Critical
|
Liusheng |
Bug Description
aodh/tests/
* it is not isolated from /etc/aodh/aodh.conf so will attempt to use the config located there to run the test. When this happens if the database pointed to by aodh.conf exists then the test will fail because the alarm_history table already exists:
raise InternalError(
oslo_db.
* If you get rid of the aodh.conf, such that there is no config then the test will do this:
{0} aodh.tests.
Presumably the test should be subclassing the db.TestBase and doing some form of scenario or mixin handling to use the db URL that is provided in the environment by the setup-*.sh script?
(I'm not entirely sure about this actually, but the test uses a mock that reference something I cannot see from the test so I have no idea what's _actually_ supposed to happen in the test.)
Changed in aodh: | |
importance: | Undecided → Critical |
status: | New → Triaged |
milestone: | none → 1.0.0rc1 |
Changed in aodh: | |
milestone: | 1.0.0rc1 → 1.0.0 |
Changed in aodh: | |
status: | Fix Committed → Fix Released |
It is similar with Gnocchi, I wonder if this test need to create table ? I can run this test OK in my environment with aodh installed and running. the database connection is set with "connection = mysql:/ /root:password@ 127.0.0. 1/aodh? charset= utf8" in aodh.conf
see:
root@monasca: /opt/stack/ aodh# python setup.py testr --testr-args aodh.tests. storage. sqlalchemy. test_migrations .ModelsMigratio nsSync OS_STDOUT_ CAPTURE= ${OS_STDOUT_ CAPTURE: -1} \ CAPTURE= ${OS_STDERR_ CAPTURE: -1} \ TIMEOUT= ${OS_TEST_ TIMEOUT: -600} \ PATH:-. /aodh/tests} -t . --list OS_STDOUT_ CAPTURE= ${OS_STDOUT_ CAPTURE: -1} \ CAPTURE= ${OS_STDERR_ CAPTURE: -1} \ TIMEOUT= ${OS_TEST_ TIMEOUT: -600} \ PATH:-. /aodh/tests} -t . --load-list /tmp/tmpWau2_I /opt/stack/ aodh# vi tox.ini /opt/stack/ aodh# python setup.py testr --slowest --testr-args aodh.tests. storage. sqlalchemy. test_migrations .ModelsMigratio nsSync OS_STDOUT_ CAPTURE= ${OS_STDOUT_ CAPTURE: -1} \ CAPTURE= ${OS_STDERR_ CAPTURE: -1} \ TIMEOUT= ${OS_TEST_ TIMEOUT: -600} \ PATH:-. /aodh/tests} -t . --list OS_STDOUT_ CAPTURE= ${OS_STDOUT_ CAPTURE: -1} \ CAPTURE= ${OS_STDERR_ CAPTURE: -1} \ TIMEOUT= ${OS_TEST_ TIMEOUT: -600} \ PATH:-. /aodh/tests} -t . --load-list /tmp/tmpq0HTKu ------- ------- ------- ------- ------- ------- ------- ------- ------- ------- ------ ----------- storage. sqlalchemy. test_migrations .ModelsMigratio nsSync. test_models_ sync 0.082
running testr
running=
OS_STDERR_
OS_TEST_
${PYTHON:-python} -m subunit.run discover ${OS_TEST_
running=
OS_STDERR_
OS_TEST_
${PYTHON:-python} -m subunit.run discover ${OS_TEST_
Ran 1 tests in 0.087s (-0.003s)
PASSED (id=4)
root@monasca:
root@monasca:
running testr
running=
OS_STDERR_
OS_TEST_
${PYTHON:-python} -m subunit.run discover ${OS_TEST_
running=
OS_STDERR_
OS_TEST_
${PYTHON:-python} -m subunit.run discover ${OS_TEST_
Ran 1 tests in 0.084s (-0.002s)
PASSED (id=5)
Slowest Tests
Test id Runtime (s)
-------
aodh.tests.
I will try to find a way to try to make this test run with real backend scenario.