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

Issue 10891044: upgrader: new WatchForEnvironConfigChanges

Can't Edit
Can't Publish+Mail
Start Review
Created:
10 years, 10 months ago by jameinel
Modified:
10 years, 10 months ago
Reviewers:
gz, mp+172977, fwereade
Visibility:
Public.

Description

upgrader: new WatchForEnvironConfigChanges This is a NotifyWatcher which matches more what we want to expose in the API https://code.launchpad.net/~jameinel/juju-core/upgrader-api-watcher/+merge/172977 (do not edit description out of merge proposal)

Patch Set 1 #

Total comments: 6

Patch Set 2 : upgrader: new WatchForEnvironConfigChanges #

Total comments: 1

Patch Set 3 : upgrader: new WatchForEnvironConfigChanges #

Unified diffs Side-by-side diffs Delta from patch set Stats (+59 lines, -22 lines) Patch
A [revision details] View 1 2 1 chunk +2 lines, -0 lines 0 comments Download
M environs/jujutest/livetests.go View 1 2 1 chunk +1 line, -3 lines 0 comments Download
M state/apiserver/upgrader/upgrader.go View 1 1 chunk +1 line, -1 line 0 comments Download
M state/apiserver/upgrader/upgrader_test.go View 1 3 chunks +5 lines, -18 lines 0 comments Download
M state/state_test.go View 1 2 1 chunk +43 lines, -0 lines 0 comments Download
M state/watcher.go View 1 2 1 chunk +7 lines, -0 lines 0 comments Download

Messages

Total messages: 5
jameinel
Please take a look.
10 years, 10 months ago (2013-07-04 09:10:33 UTC) #1
jameinel
Please take a look.
10 years, 10 months ago (2013-07-04 11:07:01 UTC) #2
gz
LGTM https://codereview.appspot.com/10891044/diff/1/state/apiserver/upgrader/upgrader_test.go File state/apiserver/upgrader/upgrader_test.go (right): https://codereview.appspot.com/10891044/diff/1/state/apiserver/upgrader/upgrader_test.go#newcode85 state/apiserver/upgrader/upgrader_test.go:85: wc.AssertOneChange() Much nicer. This might also fall under ...
10 years, 10 months ago (2013-07-04 11:09:02 UTC) #3
fwereade
LGTM modulo question below https://codereview.appspot.com/10891044/diff/1/state/apiserver/upgrader/upgrader_test.go File state/apiserver/upgrader/upgrader_test.go (right): https://codereview.appspot.com/10891044/diff/1/state/apiserver/upgrader/upgrader_test.go#newcode83 state/apiserver/upgrader/upgrader_test.go:83: defer statetesting.AssertStop(c, w) Can we ...
10 years, 10 months ago (2013-07-04 12:51:03 UTC) #4
jameinel
10 years, 10 months ago (2013-07-04 14:13:24 UTC) #5
Please take a look.

https://codereview.appspot.com/10891044/diff/1/state/apiserver/upgrader/upgra...
File state/apiserver/upgrader/upgrader_test.go (right):

https://codereview.appspot.com/10891044/diff/1/state/apiserver/upgrader/upgra...
state/apiserver/upgrader/upgrader_test.go:83: defer statetesting.AssertStop(c,
w)
On 2013/07/04 12:51:03, fwereade wrote:
> Can we depend on the ResourceRegistry cleanup for this? If not, should we be
> able to?

There is a StopAll call in teardown, though it intentionally ignores errors
(during cleanup time).

This AssertStop is asserting that things get shut down cleanly.

I like having both. The TearDown ensures test cases are isolated, the AssertStop
asserts that this particular thing stops cleanly after the test is done using
it.

https://codereview.appspot.com/10891044/diff/1/state/apiserver/upgrader/upgra...
state/apiserver/upgrader/upgrader_test.go:85: wc.AssertOneChange()
On 2013/07/04 11:09:02, gz wrote:
> Much nicer. This might also fall under William's desire to have the initial
> event automatically consumed, in which case it would need to switch this
assert
> to AssertNoChange.

When and if NotifyWatcherC changes that, this will certainly be a place we need
to fix it. :)

https://codereview.appspot.com/10891044/diff/1/state/state_test.go
File state/state_test.go (right):

https://codereview.appspot.com/10891044/diff/1/state/state_test.go#newcode1108
state/state_test.go:1108: }
On 2013/07/04 12:51:03, fwereade wrote:
> cfg, err = cfg.Apply(map[string]interface{"agent-version": vers.String()})
> 
> ?

I was copying it from elsewhere, if we have cfg.Apply that makes this code much
simpler, thanks.

I updated environs/jujutest/livetests.go as well.

Though having written this a couple times, we might want to put it somewhere
more general. state/testing perhaps?
Sign in to reply to this message.

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