Comment 0 for bug 1744195

Revision history for this message
wangxiyuan (wangxiyuan) wrote :

Now Keystone runs unit test with sqlite backend by default. But sqlite doesn't enable Foreign Key function by default.
It means that we lost the case for all FK related test.
Even after enabled FK for the test. There still some problems:
1. We lost root domain (<<keystone.domian.root>>) when setup tests. So that a lot of tests will fail.
2. Some tests, such as test_sql_upgrade and identity.backens.test_sql, use global db engine. It means that the test will meet conflict if the FK is enabled for the global db engine.

So we should refactor our test code to satisfy sqilte FK function.
There are some steps:
1. Add FK support for the tests. Disable it by default
2. Enable FK for the test one by one.
3. Make sure the Fk is disabled for test_sql_upgrade and identity.backens.test_sql