Merge lp://qastaging/~justin-fathomdb/nova/justinsb-openstack-api-volumes into lp://qastaging/~hudson-openstack/nova/trunk

Proposed by justinsb
Status: Work in progress
Proposed branch: lp://qastaging/~justin-fathomdb/nova/justinsb-openstack-api-volumes
Merge into: lp://qastaging/~hudson-openstack/nova/trunk
Prerequisite: lp://qastaging/~justin-fathomdb/nova/servicify-nova-api
Diff against target: 1411 lines (+1117/-53)
18 files modified
nova/api/ec2/cloud.py (+14/-40)
nova/api/keys.py (+93/-0)
nova/api/openstack/__init__.py (+14/-0)
nova/api/openstack/keys.py (+122/-0)
nova/api/openstack/volumes.py (+160/-0)
nova/cloudpipe/pipelib.py (+2/-1)
nova/compute/api.py (+2/-1)
nova/db/api.py (+2/-2)
nova/db/sqlalchemy/api.py (+17/-6)
nova/tests/integrated/__init__.py (+20/-0)
nova/tests/integrated/api/__init__.py (+20/-0)
nova/tests/integrated/api/client.py (+184/-0)
nova/tests/integrated/integrated_helpers.py (+184/-0)
nova/tests/integrated/test_keys.py (+84/-0)
nova/tests/integrated/test_volumes.py (+130/-0)
nova/tests/test_api.py (+2/-1)
nova/tests/test_cloud.py (+3/-2)
nova/volume/driver.py (+64/-0)
To merge this branch: bzr merge lp://qastaging/~justin-fathomdb/nova/justinsb-openstack-api-volumes
Reviewer Review Type Date Requested Status
Vish Ishaya (community) Needs Information
Review via email: mp+50868@code.qastaging.launchpad.net

This proposal supersedes a proposal from 2011-02-23.

Description of the change

Create unit tests for volumes and (for-testing-eyes-only) OpenStack API bindings to support the unit tests

To post a comment you must log in.
Revision history for this message
Vish Ishaya (vishvananda) wrote : Posted in a previous version of this proposal

looks like this requires your api service branch. I would resubmit it using that as a prerequisite branch so it doesn't pollute the diff (it is in extra options when you propose merge)

Revision history for this message
justinsb (justin-fathomdb) wrote :

Added prerequisite branch

Revision history for this message
Jay Pipes (jaypipes) wrote :

It looks like there are changes in this merge proposal that are in your Keys branch? If your servicify-nova-api already has the changes from the Keys branch in it, then you need to mark the merge proposal for the servicify-nova-api as having a pre-requisite on the keys branch... otherwise, the merge proposal diffs from dependent branches contain the changes from their parent branches...

Revision history for this message
justinsb (justin-fathomdb) wrote :

The api-keys and api-volumes patch became all intertwined with servicify and some other branches, so I'm just proposing merging them both together in this patch.

Revision history for this message
Vish Ishaya (vishvananda) wrote :

I like where this is going. I'd like to give this a test. Is there a command line utility somewhere that you are using to try this out? Can we get some instructions for how to put it through its paces?

Vish

review: Needs Information
Revision history for this message
justinsb (justin-fathomdb) wrote :

I've primarily been using the stub-API implementation in the unit test
suite, as right now I'm just adding these APIs in support of unit testing.

However, I did add volumes to (my fork of) jk0's openstack python bindings
on github:
https://github.com/justinsb/python-novatools (my fork)
https://github.com/justinsb/python-novatools/commit/13a58c7a7f0ecb451e272e9b5b0b099bcef3c0f0
(the
patch)

I'm not really sure what the state of play is on the bindings. Are we
bringing jk0's bindings into the core project? Should I submit a pull
request to jk0 in the meantime and we can work on github until this is
brought into the main tree? Should I be extending django-nova instead?

I'm happy to add support for zones & test that the volume support actually
works outside of unit tests though - just let me know where I should be
pushing code!

On Sat, Feb 26, 2011 at 2:07 AM, Vish Ishaya <email address hidden> wrote:

> Review: Needs Information
> I like where this is going. I'd like to give this a test. Is there a
> command line utility somewhere that you are using to try this out? Can we
> get some instructions for how to put it through its paces?
>
> Vish
> --
>
> https://code.launchpad.net/~justin-fathomdb/nova/justinsb-openstack-api-volumes/+merge/50868
> You are the owner of
> lp:~justin-fathomdb/nova/justinsb-openstack-api-volumes.
>

Revision history for this message
justinsb (justin-fathomdb) wrote :

Sorry - I meant "support for keys & test that the volume support actually
works", rather than zones.

On Sat, Feb 26, 2011 at 2:12 PM, Justin Santa Barbara
<email address hidden>wrote:

> I've primarily been using the stub-API implementation in the unit test
> suite, as right now I'm just adding these APIs in support of unit testing.
>
> However, I did add volumes to (my fork of) jk0's openstack python bindings
> on github:
> https://github.com/justinsb/python-novatools (my fork)
>
> https://github.com/justinsb/python-novatools/commit/13a58c7a7f0ecb451e272e9b5b0b099bcef3c0f0 (the
> patch)
>
> I'm not really sure what the state of play is on the bindings. Are we
> bringing jk0's bindings into the core project? Should I submit a pull
> request to jk0 in the meantime and we can work on github until this is
> brought into the main tree? Should I be extending django-nova instead?
>
> I'm happy to add support for zones & test that the volume support actually
> works outside of unit tests though - just let me know where I should be
> pushing code!
>
>
>
>
> On Sat, Feb 26, 2011 at 2:07 AM, Vish Ishaya <email address hidden>wrote:
>
>> Review: Needs Information
>> I like where this is going. I'd like to give this a test. Is there a
>> command line utility somewhere that you are using to try this out? Can we
>> get some instructions for how to put it through its paces?
>>
>> Vish
>> --
>>
>> https://code.launchpad.net/~justin-fathomdb/nova/justinsb-openstack-api-volumes/+merge/50868
>> You are the owner of
>> lp:~justin-fathomdb/nova/justinsb-openstack-api-volumes.
>>
>
>

Revision history for this message
Jay Pipes (jaypipes) wrote :

OK, I kind of understand the serviceify branch now. In Glance, we took a completely different strategy for integration/functional-like testing by actually starting the services using the bin/glance-control server script (it's almost identical to Swift's bin/swift-init) with temporary config files, and then issuing requests against the servers using both a programmatic client class as well as things like curl.

But, I see what you're doing here and I think it's workable.

Stuff like this is alarming though:

1030 + # TODO(justinsb): Shutdown WSGI & anything else we startup
1031 + # WSGI shutdown broken :-(
1032 + # self.wsgi_server.terminate()
1033 + # self.wsgi_server = None

Also, you've got a bunch of commented-out test code in the volume stuff. Not sure if you want to uncomment that, or if you need to remove it?

Cheers!
jay

Revision history for this message
justinsb (justin-fathomdb) wrote :

Jay: I think that starting services in-process is a nice way to do this in
tests, rather than relying on a 'deus ex machina', because that way you can
start services on unused ports (particularly useful when you want multiple
services), or start them with different configs, or get access to internal
state for testing etc.

The WSGI shutdown broken thing is why I wanted known_bugs. That's a no-go,
so I can either leave it commented out or just delete it. I think commented
out is better.

Otherwise I'm going to do a cleanup when this branch's pre-reqs are approved
for merge.

On Mon, Mar 7, 2011 at 3:33 PM, Jay Pipes <email address hidden> wrote:

> OK, I kind of understand the serviceify branch now. In Glance, we took a
> completely different strategy for integration/functional-like testing by
> actually starting the services using the bin/glance-control server script
> (it's almost identical to Swift's bin/swift-init) with temporary config
> files, and then issuing requests against the servers using both a
> programmatic client class as well as things like curl.
>
> But, I see what you're doing here and I think it's workable.
>
> Stuff like this is alarming though:
>
> 1030 + # TODO(justinsb): Shutdown WSGI & anything else we startup
> 1031 + # WSGI shutdown broken :-(
> 1032 + # self.wsgi_server.terminate()
> 1033 + # self.wsgi_server = None
>
> Also, you've got a bunch of commented-out test code in the volume stuff.
> Not sure if you want to uncomment that, or if you need to remove it?
>
> Cheers!
> jay
> --
>
> https://code.launchpad.net/~justin-fathomdb/nova/justinsb-openstack-api-volumes/+merge/50868
> You are the owner of
> lp:~justin-fathomdb/nova/justinsb-openstack-api-volumes.
>

Revision history for this message
Jay Pipes (jaypipes) wrote :

> Jay: I think that starting services in-process is a nice way to do this in
> tests, rather than relying on a 'deus ex machina', because that way you can
> start services on unused ports (particularly useful when you want multiple
> services), or start them with different configs, or get access to internal
> state for testing etc.

This is exactly what we do in Glance. :) We don't start the bin/glance-api "in process" in the functional tests because I've found that there are a number of things that come up when you start a process daemonized that were being masked by the in-process stuff (like logging)

> The WSGI shutdown broken thing is why I wanted known_bugs. That's a no-go,
> so I can either leave it commented out or just delete it. I think commented
> out is better.

Ah, ok. Well, the note and commented out is fine I suppose. Just file a bug on it ;)

> Otherwise I'm going to do a cleanup when this branch's pre-reqs are approved
> for merge.

I only know of the one pre-req (servicify). Are you referring to others? (keys, perhaps?)

-jay

Revision history for this message
Jay Pipes (jaypipes) wrote :

OK, I've re-read this patch about 7 times now. I hate to do this, but I'm going to say Disapprove on this one. What is unfortunate is that this patch gloms together a whole bunch of *new* stuff along with tests of that new stuff. It doesn't actually add tests for the existing OpenStack API functionality, which is what was needed for Cactus stability. I believe this patch only destabilizes Cactus by adding "test-only" functionality to the OpenStack API that isn't even in the OpenStack API spec and then testing these new codepaths while not testing anything else.

I'm sorry, Justin, but this code just doesn't pass muster on something to go into Cactus, IMHO.

If this patch (and a number of the merge props that depend on it) were broken down into more manageable chunks, and chunks that had bugs and blueprints specific to Cactus, it may have been doable, but the string of merge proposals that this depends on as well as this patch just don't work for me.

If others feel very strongly about this, feel free to comment on this merge proposal. I have to move on to the other merge proposals tied to specific blueprints for Cactus, though.

-jay

Revision history for this message
justinsb (justin-fathomdb) wrote :

Jay and I have discussed this, and I think it boils down to a difference of interpretation of "stability":

Internal Stability - i.e. stability of the code. We minimize code changes, so that we will eventually find and fix all the bugs.

External Stability - i.e. a nova that works for users. It's OK to make big code changes as long as the goal is to produce a more reliable, less buggy product. We accept that we may sometimes introduce bugs to get to a reliable product faster.

My goal is "External Stability" - my tests try to do exactly what an external user would do. I trust that if these tests pass, nova won't blow up immediately for users. (This isn't true of the current tests.) Towards that goal, I'll refactor code, I'll introduce (flag-disabled) APIs until we have a formal API for the required functionality (e.g. keys), I'll write a simple OpenStack API client until we decide whether to merge one into lp:nova.

Of course, "Internal Stability" Jay then (rightly, based on his definition) rejects this as not being "on-goal" for Cactus.

Jay and I then argue in circles, but I believe it boils down to "What does stability mean?"

So: What does stability mean?

Unmerged revisions

727. By justinsb

Fixed unit tests to derive from standard nova unit tests; was able to use fake_rabbit and remove the flags code duplication

726. By justinsb

Add an import for a missing flag

725. By justinsb

Merged with trunk

724. By justinsb

Merged with upstream branch

723. By justinsb

ApiService has moved

722. By justinsb

Merged with pre-req branch

721. By justinsb

Re-remove the problematic sqlalchemy fix that somehow made it back into this branch

720. By justinsb

Merged servicify branch

719. By justinsb

Another style issue (2 blank lines)

718. By justinsb

PEP8 / Style issues

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
The diff is not available at this time. You can reload the page or download it.