keystone tox -epy27 fail in devstack environment

Bug #1574493 reported by ZhiQiang Fan on 2016-04-25
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
OpenStack Identity (keystone)
Medium
ZhiQiang Fan

Bug Description

reproduce steps:

1. clone devstack, enable keystone
2. cd /opt/stack/keystone && tox -epy27

==============================
Failed 1 tests - output below:
==============================

keystone.tests.unit.test_cli.CliNoConfigTestCase.test_cli
---------------------------------------------------------

Captured traceback:
~~~~~~~~~~~~~~~~~~~
    Traceback (most recent call last):
      File "keystone/tests/unit/test_cli.py", line 71, in test_cli
        self.assertThat(self.logging.output, matchers.Contains(expected_msg))
      File "/tmp/keystone/.tox/py27/local/lib/python2.7/site-packages/testtools/testcase.py", line 493, in assertThat
        raise mismatch_error
    testtools.matchers._impl.MismatchError: 'Config file not found, using default configs.' not in u''

If I remove /etc/keystone/keystone.conf then it will succeed

As a developer, I always run devstack on my workstation, and as unit test code shouldn't rely on or affected by real environment, I think this is a bug which should be fixed

already have a solution, I will fix it by myself

ZhiQiang Fan (aji-zqfan) on 2016-04-25
Changed in keystone:
assignee: nobody → ZhiQiang Fan (aji-zqfan)
status: New → In Progress
Changed in keystone:
milestone: none → newton-1
importance: Undecided → Medium

Reviewed: https://review.openstack.org/309882
Committed: https://git.openstack.org/cgit/openstack/keystone/commit/?id=2183b47af24adc224a45e5ddfdbca1166a39a059
Submitter: Jenkins
Branch: master

commit 2183b47af24adc224a45e5ddfdbca1166a39a059
Author: ZhiQiang Fan <email address hidden>
Date: Tue Apr 26 00:15:09 2016 +0800

    do not search file on real environment

    Keystone cannot pass tox -epy27 on an environment which has
    installed keystone service because we do not prevent oslo.config
    searching all possible directories for configuration file, the
    failed test is:

    keystone.tests.unit.test_cli.CliNoConfigTestCase.test_cli

    Unit test code should not rely on or be affected by real
    environment, this patch mocks the oslo.config find_config_files to
    empty as we expected, so it can succeed in every environment.

    Change-Id: I0e8ade7414dbc92ca9334242c1369e0f51d2eba5
    Closes-Bug: #1574493

Changed in keystone:
status: In Progress → Fix Released

This issue was fixed in the openstack/keystone 10.0.0.0b1 development milestone.

To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Other bug subscribers