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

Issue 13633045: Add a base cleaner suite to add cleanup methods

Can't Edit
Can't Publish+Mail
Start Review
Created:
10 years, 8 months ago by thumper
Modified:
10 years, 8 months ago
Reviewers:
mp+185199, axw1, wallyworld, rog
Visibility:
Public.

Description

Add a base cleaner suite to add cleanup methods Also made the LoggerSuite embed it, so most existing tests get the magic. https://code.launchpad.net/~thumper/juju-core/cleanup-suite/+merge/185199 (do not edit description out of merge proposal)

Patch Set 1 #

Total comments: 2
Unified diffs Side-by-side diffs Delta from patch set Stats (+112 lines, -9 lines) Patch
A [revision details] View 1 chunk +2 lines, -0 lines 0 comments Download
A testing/cleanup.go View 1 chunk +46 lines, -0 lines 1 comment Download
A testing/cleanup_test.go View 1 chunk +57 lines, -0 lines 1 comment Download
M testing/log.go View 2 chunks +7 lines, -9 lines 0 comments Download

Messages

Total messages: 4
thumper
Please take a look.
10 years, 8 months ago (2013-09-12 05:05:17 UTC) #1
axw1
On 2013/09/12 05:05:17, thumper wrote: > Please take a look. LGTM.
10 years, 8 months ago (2013-09-12 05:10:12 UTC) #2
wallyworld
LGTM but I'd like some tests to ensure there's no cross contamination between suite and ...
10 years, 8 months ago (2013-09-12 05:11:13 UTC) #3
rog
10 years, 8 months ago (2013-09-12 07:09:41 UTC) #4
LGTM with a couple of minor suggestions.

Embedding this into LoggingSuite makes me
feel twitchy though. This a marriage entirely
of convenience - LoggingSuite previously
was about a single thing only, and now has
this functionality shoehorned in just because
lots of things use LoggingSuite.

I would be more inclined to embed it in some
of the "kitchen-sink" suites: JujuConnSuite;
or rename LoggingSuite to LoggingAndCleanupSuite
perhaps throughout.

I like the functionality in general though.

https://codereview.appspot.com/13633045/diff/1/testing/cleanup.go
File testing/cleanup.go (right):

https://codereview.appspot.com/13633045/diff/1/testing/cleanup.go#newcode14
testing/cleanup.go:14: testStack  []func()
One possibility is to use jc.Restorer instead of func() here, which perhaps
makes the purpose of the functions more clear.

It doesn't really make any difference, just a thought.

https://codereview.appspot.com/13633045/diff/1/testing/cleanup_test.go
File testing/cleanup_test.go (right):

https://codereview.appspot.com/13633045/diff/1/testing/cleanup_test.go#newcode10
testing/cleanup_test.go:10: testing.CleanupSuite
I'm not sure we need to embed this - you can just
declare it in each test, which I think will make the
tests a little clearer as it avoids shared state.
Sign in to reply to this message.

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