Refactor domain usage in test_backend

Bug #1373865 reported by Henry Nash on 2014-09-25
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
OpenStack Identity (keystone)
Wishlist
Unassigned

Bug Description

The way test_backend uses domains leads to either many of the tests being over overridden in test_backend_ldap, or just skipped (leading to a risk that we are not sufficiently testing certain functionality - see bug 1373113 as an example).

There is already a construct for getting the default domain in backend_ldap, but we should use a more flexible scheme for getting test domains so that tests can run whether there is one domain, multiple domains, read-only domains etc.

Henry Nash (henry-nash) on 2014-09-25
Changed in keystone:
importance: Undecided → Wishlist
tags: added: test-improvement
Changed in keystone:
status: New → Confirmed
Steve Martinelli (stevemar) wrote :

Is this still an issue?

Henry Nash (henry-nash) wrote :

I think it probably is still any issue, although the sequence is probably something like:

- Clean up current backend_ldap (I'll do this)
- split the test_backend apart (samuel is doing this)
- at this point it will be obvious that a lot of what is in test_backend doesn't need multiple domains, so can use a new test fixture
- those that really do need multiple domains can be refactored

Steve Martinelli (stevemar) wrote :

Henry, sounds like a plan, samuel has already split test_backend apart. Looking at https://github.com/openstack/keystone/blob/master/keystone/tests/unit/test_backend_ldap.py there is a lot of room for improvement on how we go about testing things. I'll keep this open until we sufficiently refactor that file

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

Changed in keystone:
assignee: nobody → Gage Hugo (gagehugo)
status: Confirmed → In Progress

Reviewed: https://review.openstack.org/507694
Committed: https://git.openstack.org/cgit/openstack/keystone/commit/?id=de9546b4ef2c7a8baab539cc7ae0e205601b23dd
Submitter: Zuul
Branch: master

commit de9546b4ef2c7a8baab539cc7ae0e205601b23dd
Author: Gage Hugo <email address hidden>
Date: Tue Sep 26 17:05:39 2017 -0500

    Refactor test_backend_ldap tests

    Currently, the testing backend for LDAP relies on multiple inheritance
    of many base and testing classes, which results in many of these
    tests being ran multiple times needlessly. This change removes the
    base TestCase unit test class from LDAPIdentity, which is inherited
    by multiple other test classes.

    Change-Id: Iee0a0942e49295081437306d3942109c4132b704
    Partial-Bug: #1373865

Gage Hugo (gagehugo) on 2019-03-11
Changed in keystone:
status: In Progress → Triaged
assignee: Gage Hugo (gagehugo) → nobody
To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Other bug subscribers