Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code | Sign in
(3470)

Issue 7873046: Add cleanup to several api_test.go tests.

Can't Edit
Can't Publish+Mail
Start Review
Created:
11 years, 1 month ago by teknico
Modified:
11 years, 1 month ago
Reviewers:
dimitern, mp+155540, rog
Visibility:
Public.

Description

Add cleanup to several api_test.go tests. Several state-changing op* tests in state/apiserver/api_test.go do not return a reset() function, causing problems to other tests. This branch adds those missing reset() functions. Thanks to rogpeppe for guidance and fixes. https://code.launchpad.net/~teknico/juju-core/fix-cleanup-in-api-tests/+merge/155540 (do not edit description out of merge proposal)

Patch Set 1 #

Total comments: 4

Patch Set 2 : Add cleanup to several api_test.go tests. #

Unified diffs Side-by-side diffs Delta from patch set Stats (+26 lines, -31 lines) Patch
A [revision details] View 1 1 chunk +2 lines, -0 lines 0 comments Download
M state/apiserver/api_test.go View 1 4 chunks +24 lines, -31 lines 0 comments Download

Messages

Total messages: 5
teknico
Please take a look.
11 years, 1 month ago (2013-03-26 16:00:06 UTC) #1
rog
LGTM assuming the change below too. https://codereview.appspot.com/7873046/diff/1/state/apiserver/api_test.go File state/apiserver/api_test.go (right): https://codereview.appspot.com/7873046/diff/1/state/apiserver/api_test.go#newcode432 state/apiserver/api_test.go:432: err := st.Client().AddServiceUnits("wordpress", ...
11 years, 1 month ago (2013-03-26 16:22:32 UTC) #2
dimitern
LGTM https://codereview.appspot.com/7873046/diff/1/state/apiserver/api_test.go File state/apiserver/api_test.go (right): https://codereview.appspot.com/7873046/diff/1/state/apiserver/api_test.go#newcode413 state/apiserver/api_test.go:413: units, err := svc.AllUnits() it's a pity implementing ...
11 years, 1 month ago (2013-03-26 16:30:04 UTC) #3
teknico
*** Submitted: Add cleanup to several api_test.go tests. Several state-changing op* tests in state/apiserver/api_test.go do ...
11 years, 1 month ago (2013-03-26 17:28:52 UTC) #4
teknico
11 years, 1 month ago (2013-03-26 17:39:45 UTC) #5
Changes applied and landed, thanks.

https://codereview.appspot.com/7873046/diff/1/state/apiserver/api_test.go
File state/apiserver/api_test.go (right):

https://codereview.appspot.com/7873046/diff/1/state/apiserver/api_test.go#new...
state/apiserver/api_test.go:413: units, err := svc.AllUnits()
dimitern wrote:
> it's a pity implementing this with sort(units)+get last index
> is actually not so trivial.

Well, I'm removing this function anyway.

https://codereview.appspot.com/7873046/diff/1/state/apiserver/api_test.go#new...
state/apiserver/api_test.go:432: err := st.Client().AddServiceUnits("wordpress",
1)
rog wrote:
> LGTM assuming the change below too.

Added, thanks.
Sign in to reply to this message.

Powered by Google App Engine
RSS Feeds Recent Issues | This issue
This is Rietveld f62528b