Improve functional tests

Registered by Mark Washenberger

Functional tests in glance run the glance api and registry servers in separate processes. This causes a number of problems:

- race conditions around port selection
- other unknown sources of indeterminacy
- slowness
- process logs are hidden away or lost, so there are difficulties when debugging
- dead processes are left around in certain failure scenarios

Each of these items can be addressed individually. But under the aegis of this blueprint, I propose that we simply stop functionally testing at the process level, and instead test some slightly smaller but almost equivalent abstraction that can be managed in the same process as the test runner (say, at the wsgi app level).

Blueprint information

Status:
Complete
Approver:
None
Priority:
Undefined
Drafter:
None
Direction:
Needs approval
Assignee:
None
Definition:
Obsolete
Series goal:
None
Implementation:
Unknown
Milestone target:
None
Completed by
Nikhil Komawar

Whiteboard

One thing that might be nice would be to have the scripts under ./bin as proper python modules. We could then use the setup directive 'entry_points' to create scripts for them. One we have that we could import them as modules and make direct calls to their main() functions. This will only be part of the solution but it will greatly help for testing things like glance-manage.

<markwash>
Cleaning up to use entrypoints sounds great even just on its own. And I think it makes a lot of sense to test using main() for some of our tests. Whether or not that is the right approach for all of our functional test adjustments remains to be seen, but I like this idea.
</markwash>

<jbresnah>
In order to run everything in the same process we are going to have to make the global CONF object localized to each process. On my initial run through this I found this effort non-trivial.
</jbresnah>

<flaper87>
Hey, I wanted to propose this blueprint as a task for Gnome's Outreach program for Women. What do you think?

https://wiki.openstack.org/wiki/OutreachProgramForWomen/Ideas#New_Functional_Test_Suit_for_Glance
</flaper87>

Gerrit topic: https://review.openstack.org/#q,topic:bp/refactoring-better-faster-stronger-functional-tests,n,z

Addressed by: https://review.openstack.org/26018
    Convert scripts to entry points

Gerrit topic: https://review.openstack.org/#q,topic:bug/1172475,n,z

Addressed by: https://review.openstack.org/27450
    Functional tests use a clean cached db that is only created once.

Gerrit topic: https://review.openstack.org/#q,topic:bug/1068051,n,z

Addressed by: https://review.openstack.org/27611
    Remove glance-control from the test suite

Addressed by: https://review.openstack.org/28214
    Remove glance-control from the test suite

Addressed by: https://review.openstack.org/30512
    WIP: Faster more stable V1 functional tests

Gerrit topic: https://review.openstack.org/#q,topic:bug/1195423,n,z

Addressed by: https://review.openstack.org/34798
    Unit tests for scrubber.

markwash abandoned 2014-02-15

(?)

Work Items

This blueprint contains Public information 
Everyone can see this information.