← Back to team overview

openstack team mailing list archive

Re: [nova-testing] Efforts for Essex

 

Hi folks

>Jay
Thank you for your pointing this!:)
Hey OpenStackers,please help forward-porting :P

>Soren
>Anything else around unit testing anyone wants to get into The Great
Big Plan[tm]?

And also, we should have a policy for unit test.
Something like this

- New code should have a concrete specification doc , and all unit
test should be written based on the specs
- New code should include negative test case for each parameters.
- New code don't lower coverages

Cheers
Nati

2011/11/29 Jay Pipes <jaypipes@xxxxxxxxx>:
> On Tue, Nov 29, 2011 at 3:21 PM, Soren Hansen <soren@xxxxxxxxxxx> wrote:
>> Anything else around unit testing anyone wants to get into The Great
>> Big Plan[tm]?
>
> Well, NTT has written well over a thousand new unit tests for Nova. It
> would be great to get some more help from everyone in forward-porting
> them. To date, we've been a bit stymied by lack of resources to do the
> forward-porting, so if anyone has some spare cycles, there are an
> absolute ton of both new tests and bug fixes needing
> forward-porting...
>
> >From another email, here is instructions for how to do the
> forward-porting for those interested in helping out.
>
> This is the NTT bug fix + unit test branch. Note that this is the
> branch that is based on stable/diablo:
>
> https://github.com/ntt-pf-lab/nova/branches
>
> All the bugs in the OpenStack QA project (and Nova project) that need
> forward-porting are tagged with "forward-port-needed". You can see a
> list of the unassigned ones needing forward-porting here:
>
> http://bit.ly/rPVjCf
>
>
> The workflow for forward-porting these fixes/new tests is like this:
>
> A. Pick a bug from above list (http://bit.ly/rPVjCf)
>
> B. Assign yourself to bug
>
> C. Fix problem and review request
>
> I believe folks need some further instructions on this step.
> Basically, the NTT team has *already* fixed the bug, but we need to
> apply the bug fix to trunk and propose this fix for merging into
> trunk.
>
> The following steps are how to do this. I'm going to take a bug fix as
> an example, and show the steps needed to forward port it to trunk.
> Here is the bug and associated fix I will forward port:
>
> https://bugs.launchpad.net/openstack-qa/+bug/883293
>
> Nati's original bug fix branch is linked on the bug report:
>
> https://github.com/ntt-pf-lab/nova/tree/openstack-qa-nova-883293
>
> When looking at the branch, you can see the latest commits by clicking
> the "Commits" tab near the top of the page:
>
> https://github.com/ntt-pf-lab/nova/commits/openstack-qa-nova-883293
>
> As you can see, the top 2 commits form the bug fix from Nati -- the
> last commit being a test case, and the second to last commit being a
> fix for the infinite loop references in the bug report. The two
> commits have the following two SHA1 identifiers:
>
> 9cf5945c9e64d1c6a2eb6d9499e80d6c19aed058
> 2a95311263cbda5886b9409284fea2d155b3cada
>
> These are the two commits I need to apply to my local *trunk* branch
> of Nova. To do so, I do the following locally:
>
> 1) Before doing anything, we first need to set up a remote for the NTT
> team repo on GitHub:
>
> jpipes@uberbox:~/repos/nova$ git remote add ntt
> https://github.com/ntt-pf-lab/nova.git
> jpipes@uberbox:~/repos/nova$ git fetch ntt
> remote: Counting objects: 2255, done.
> remote: Compressing objects: 100% (432/432), done.
> remote: Total 2120 (delta 1694), reused 2108 (delta 1686)
> Receiving objects: 100% (2120/2120), 547.09 KiB | 293 KiB/s, done.
> Resolving deltas: 100% (1694/1694), completed with 81 local objects.
> >From https://github.com/ntt-pf-lab/nova
>  * [new branch]      int001     -> ntt/int001
>  * [new branch]      int001_base -> ntt/int001_base
>  * [new branch]      int002.d1  -> ntt/int002.d1
>  * [new branch]      int003     -> ntt/int003
>  * [new branch]      ntt/stable/diablo -> ntt/ntt/stable/diablo
>  * [new branch]      openstack-qa-api-validation ->
> ntt/openstack-qa-api-validation
> <snip>
>  * [new branch]      openstack-qa-nova-888229 -> ntt/openstack-qa-nova-888229
>  * [new branch]      openstack-qa-test-branch -> ntt/openstack-qa-test-branch
>  * [new branch]      stable/diablo -> ntt/stable/diablo
>
> 2) Now that we have fetched the NTT branches (containing all the bug
> fixes we need to forward-port), we create a local branch based off of
> Essex trunk. On my machine, this local Essex trunk branch is called
> master:
>
> jpipes@uberbox:~/repos/nova$ git branch
> * diablo
>  master
> jpipes@uberbox:~/repos/nova$ git checkout master
> Switched to branch 'master'
> jpipes@uberbox:~/repos/nova$ git checkout -b bug883293
> Switched to a new branch 'bug883293'
>
> 3) We now need to cherry-pick the two commits from above. I do so in
> reverse order, as I want to apply the patch with the bug fix first and
> then the patch with the test case:
>
> jpipes@uberbox:~/repos/nova$ git cherry-pick
> 2a95311263cbda5886b9409284fea2d155b3cada
> [bug883293 81e49b7] combination of log_notifier and
> log.PublishErrorsHandler causes infinite loop Fixes bug 883293.
>  Author: Nachi Ueno <ueno.nachi@xxxxxxxxxxxxx>
>  1 files changed, 4 insertions(+), 0 deletions(-)
> jpipes@uberbox:~/repos/nova$ git cherry-pick
> 9cf5945c9e64d1c6a2eb6d9499e80d6c19aed058
> [bug883293 032f2c2] Add testcases for nova/log.py Fixes bug 883293.
>  Author: Nachi Ueno <ueno.nachi@xxxxxxxxxxxxx>
>  1 files changed, 66 insertions(+), 0 deletions(-)
>
> 4) OK, at this point, I have now applied the two commits against Essex
> trunk. I now need to rebase against master, squash the two commits
> into a single changeset, and ensure that a ChangeId is attached to the
> rebased changeset:
>
> jpipes@uberbox:~/repos/nova$ git rebase -i master
>
> This opens up my editor. It shows the two commits from Nati on two
> lines, both with the word "pick" at the beginning of each line.
>
> I squash the commits by changing the second line "pick" to "squash"
> and change the first line "pick" to "reword". When I save and close, a
> new editor window will open containing the commit messages of the
> original two commits. I consolidate them into a single commit message
> that references the bug # and save and close. If all goes well, you
> will see something like this:
>
> [detached HEAD 37d3fbe] Fixes bug 883293.
>  Author: Nachi Ueno <ueno.nachi@xxxxxxxxxxxxx>
>  1 files changed, 4 insertions(+), 0 deletions(-)
> [detached HEAD 95802c6] Fixes bug 883293.
>  Author: Nachi Ueno <ueno.nachi@xxxxxxxxxxxxx>
>  2 files changed, 70 insertions(+), 0 deletions(-)
> Successfully rebased and updated refs/heads/bug883293.
>
> 5) Now all I need to do is push my changeset to Gerrit's trunk:
>
> jpipes@uberbox:~/repos/nova$ git review
> Successfully rebased and updated refs/heads/bug883293.
> Counting objects: 11, done.
> Delta compression using up to 12 threads.
> Compressing objects: 100% (5/5), done.
> Writing objects: 100% (6/6), 1.59 KiB, done.
> Total 6 (delta 5), reused 1 (delta 1)
> remote: Resolving deltas:   0% (0/5)
> remote:
> remote: New Changes:
> remote:   https://review.openstack.org/1743
> remote:
> To ssh://jaypipes@xxxxxxxxxxxxxxxxxxxx:29418/openstack/nova.git
>  * [new branch]      HEAD -> refs/for/master/bug/883293
>
> _______________________________________________
> Mailing list: https://launchpad.net/~openstack
> Post to     : openstack@xxxxxxxxxxxxxxxxxxx
> Unsubscribe : https://launchpad.net/~openstack
> More help   : https://help.launchpad.net/ListHelp


References