Merge lp:~jameinel/juju-core/set-agent-version into lp:~go-bot/juju-core/trunk
Proposed by
John A Meinel
Status: | Merged |
---|---|
Approved by: | John A Meinel |
Approved revision: | no longer in the source branch. |
Merged at revision: | 1390 |
Proposed branch: | lp:~jameinel/juju-core/set-agent-version |
Merge into: | lp:~go-bot/juju-core/trunk |
Diff against target: |
119 lines (+29/-33) 3 files modified
environs/jujutest/livetests.go (+2/-15) state/state_test.go (+4/-18) state/testing/agent.go (+23/-0) |
To merge this branch: | bzr merge lp:~jameinel/juju-core/set-agent-version |
Related bugs: |
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
Juju Engineering | Pending | ||
Review via email: mp+173175@code.launchpad.net |
Commit message
state/testing: pull out SetAgentVersion
There were two test cases that wanted SetAgentVersion, and I wanted to add a
third. So this is a trivial "pull it out into a common testing helper".
Description of the change
state/testing: pull out SetAgentVersion
There were two test cases that wanted SetAgentVersion, and I wanted to add a
third. So this is a trivial "pull it out into a common testing helper".
To post a comment you must log in.
Reviewers: mp+173175_ code.launchpad. net,
Message:
Please take a look.
Description:
state/testing: pull out SetAgentVersion
There were two test cases that wanted SetAgentVersion, and I wanted to
add a
third. So this is a trivial "pull it out into a common testing helper".
https:/ /code.launchpad .net/~jameinel/ juju-core/ set-agent- version/ +merge/ 173175
(do not edit description out of merge proposal)
Please review this at https:/ /codereview. appspot. com/10962043/
Affected files: jujutest/ livetests. go agent.go
A [revision details]
M environs/
M state/state_test.go
A state/testing/
Index: [revision details] 20130704233548- 3tyyqq9g9ojkmbn 7
=== added file '[revision details]'
--- [revision details] 2012-01-01 00:00:00 +0000
+++ [revision details] 2012-01-01 00:00:00 +0000
@@ -0,0 +1,2 @@
+Old revision: tarmac-
+New revision: <email address hidden>
Index: state/state_test.go state_test. go' (attrs{ "fancy- new-key" : "arbitrary-value"})
=== modified file 'state/
--- state/state_test.go 2013-07-04 14:12:18 +0000
+++ state/state_test.go 2013-07-05 07:59:53 +0000
@@ -1093,23 +1093,9 @@
assertChange
}
-// setAgentVersion sets the current agent version in the state's map[string] interface{ }{"agent- version" : Errorf( "config refused agent-version: %v", err)) nfig(cfg) ironConfigChang es(c *C) { Current. Number (s.State, cur) SetAgentVersion (s.State, cur) WatchForEnviron ConfigChanges( ) AssertStop( c, w) (s.State, newVersion) SetAgentVersion (s.State, newVersion)
-// environment configuration.
-func setAgentVersion(st *state.State, vers version.Number) error {
- cfg, err := st.EnvironConfig()
- if err != nil {
- return err
- }
- cfg, err = cfg.Apply(
vers.String()})
- if err != nil {
- panic(fmt.
- }
- return st.SetEnvironCo
-}
-
func (s *StateSuite) TestWatchForEnv
cur := version.
- err := setAgentVersion
+ err := statetesting.
c.Assert(err, IsNil)
w := s.State.
defer statetesting.
@@ -1121,17 +1107,17 @@
// Multiple changes will only result in a single change notification
newVersion := cur
newVersion.Minor += 1
- err = setAgentVersion
+ err = statetesting.
c.Assert(err, IsNil)
newerVersion := newVersion .Minor += 1 (s.State, newerVersion) SetAgentVersion (s.State, newerVersion) Change( )
newerVersion
- err = setAgentVersion
+ err = statetesting.
c.Assert(err, IsNil)
wc.AssertOne
// Setting it to the same value does not trigger a change notification (s.State, newerVersion) SetAgentVersion (s.State, newerVersion) hange()
- err = setAgentVersion
+ err = statetesting.
c.Assert(err, IsNil)
wc.AssertNoC
}
Index: environs/ jujutest/ livetests. go jujutest/ livetests. go' jujutest/ livetests. go 2013-07-04 14:12:18 +0000 jujutest/ livetests. go 2013-07-05 08:03:59 +0000 net/juju- core/juju/ testing" net/juju- core/state" net/juju- core/state/ api" net/juju- core/state/ testing" net/juju- core/testing" net/juju- core/testing/ checkers" net/juju- core/utils"
=== modified file 'environs/
--- environs/
+++ environs/
@@ -20,6 +20,7 @@
"launchpad.
"launchpad.
"launchpad.
+ statetesting "launchpad.
coretesting "launchpad.
. "launchpad.
"launchpad.
@@ -581,7 +582,7 @@
// Check that the put version reall...