Running individual tests in the test suite is failing

Bug #1233224 reported by David Stanek
18
This bug affects 2 people
Affects Status Importance Assigned to Milestone
OpenStack Identity (keystone)
Fix Released
Medium
David Stanek

Bug Description

Change I0fd0be98: sync oslo policy" (https://review.openstack.org/#/c/48111/) was merged over the weekend and broke test functionality for me. Our base TestCase tries to set the policy_file option before it is declared.

Really there are two reasons for this:

  1. Not all of the necessary state is setup before the test run
  2. Some of the tests depend on things that are unrelated to the functionality under test (e.g. why would XML serialization test be broken by changes to the keystone command-line options?)

When I run:

  $ ./run_tests.sh test_serializer.py

I get lots of these:

  _StringException: Traceback (most recent call last):
    File "/opt/stack/keystone/keystone/tests/core.py", line 259, in setUp
      self.opt(policy_file=etcdir('policy.json'))
    File "/opt/stack/keystone/keystone/tests/core.py", line 296, in opt
      CONF.set_override(k, v)
    File "/opt/stack/keystone/.venv/local/lib/python2.7/site-packages/oslo/config/cfg.py", line 1579, in __inner
      result = f(self, *args, **kwargs)
    File "/opt/stack/keystone/.venv/local/lib/python2.7/site-packages/oslo/config/cfg.py", line 1825, in set_override
      opt_info = self._get_opt_info(name, group)
    File "/opt/stack/keystone/.venv/local/lib/python2.7/site-packages/oslo/config/cfg.py", line 2095, in _get_opt_info
      raise NoSuchOptError(opt_name, group)
  NoSuchOptError: no such option: policy_file

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to keystone (master)

Fix proposed to branch: master
Review: https://review.openstack.org/48993

Changed in keystone:
assignee: nobody → David Stanek (dstanek)
status: New → In Progress
Dolph Mathews (dolph)
tags: added: havana-backport-potential
Changed in keystone:
importance: Undecided → Medium
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to keystone (master)

Reviewed: https://review.openstack.org/48993
Committed: http://github.com/openstack/keystone/commit/ca3a073922ef86128337314cacf14d235acbaa31
Submitter: Jenkins
Branch: master

commit ca3a073922ef86128337314cacf14d235acbaa31
Author: David Stanek <email address hidden>
Date: Mon Sep 30 15:10:30 2013 +0000

    Imports oslo policy to fix test issues

    Tests inheriting from keystone.tests.TestCase depend on having the
    policy_file command-line option declared before setUp runs. Importing
    the oslo policy module automatically declares the option.

    Fixes-Bug: 1233224
    Change-Id: I939bbdcb7df1c4a59108dced92d4d5c2e96defe2

Changed in keystone:
status: In Progress → Fix Committed
Thierry Carrez (ttx)
Changed in keystone:
milestone: none → havana-rc1
status: Fix Committed → Fix Released
Thierry Carrez (ttx)
Changed in keystone:
milestone: havana-rc1 → 2013.2
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Duplicates of this bug

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.