Merge lp://staging/~jimmiebtlr/juju-core/add_machines_tag into lp://staging/~go-bot/juju-core/trunk
Proposed by
Jimmie Butler
Status: | Merged |
---|---|
Approved by: | William Reade |
Approved revision: | no longer in the source branch. |
Merged at revision: | 2817 |
Proposed branch: | lp://staging/~jimmiebtlr/juju-core/add_machines_tag |
Merge into: | lp://staging/~go-bot/juju-core/trunk |
Diff against target: |
125 lines (+34/-23) 1 file modified
cmd/juju/addmachine_test.go (+34/-23) |
To merge this branch: | bzr merge lp://staging/~jimmiebtlr/juju-core/add_machines_tag |
Related bugs: |
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
Juju Engineering | Pending | ||
Review via email: mp+221013@code.staging.launchpad.net |
Commit message
cmd/juju: add-machine tests now check output
Description of the change
Change add-machine tests to include output tests.
To post a comment you must log in.
Reviewers: mp+221013_ code.launchpad. net,
Message:
Please take a look.
Description:
juju add-machine now displays tag instead of id.
Also add tests to check output.
https:/ /code.launchpad .net/~jimmiebtl r/juju- core/add_ machines_ tag/+merge/ 221013
(do not edit description out of merge proposal)
Please review this at https:/ /codereview. appspot. com/98610044/
Affected files (+45, -23 lines): addmachine. go addmachine_ test.go
A [revision details]
M cmd/juju/
M cmd/juju/
Index: [revision details] 20140527050326- y76dbybaykpv5lc 8
=== 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: cmd/juju/ addmachine. go addmachine. go' addmachine. go 2014-05-12 05:23:59 +0000 addmachine. go 2014-05-27 04:20:30 +0000
=== modified file 'cmd/juju/
--- cmd/juju/
+++ cmd/juju/
@@ -158,9 +158,9 @@
machineId := machineInfo.Machine
if names.IsContain erMachine( machineId) { g(machineId) ) g(machineId) )
- ctx.Infof("created container %v", machineId)
+ ctx.Infof("created container %v", names.MachineTa
} else {
- ctx.Infof("created machine %v", machineId)
+ ctx.Infof("created machine %v", names.MachineTa
}
return nil
}
Index: cmd/juju/ addmachine_ test.go addmachine_ test.go' addmachine_ test.go 2014-05-22 06:03:06 +0000 addmachine_ test.go 2014-05-27 05:25:52 +0000 com/juju/ testing/ checkers" net/gocheck"
=== modified file 'cmd/juju/
--- cmd/juju/
+++ cmd/juju/
@@ -10,6 +10,7 @@
jc "github.
gc "launchpad.
+ "launchpad. net/juju- core/cmd" net/juju- core/cmd/ envcmd" net/juju- core/constraint s" net/juju- core/instance"
"launchpad.
"launchpad.
"launchpad.
@@ -24,25 +25,27 @@
var _ = gc.Suite( &AddMachineSuit e{})
-func runAddMachine(c *gc.C, args ...string) error { RunCommand( c, envcmd. Wrap(&AddMachin eCommand{ }), RunCommand( c, envcmd. Wrap(&AddMachin eCommand{ }),
- _, err := testing.
args...)
- return err
+func runAddMachine(c *gc.C, args ...string) (*cmd.Context, error) {
+ cxt, err := testing.
args...)
+ return cxt, err
}
func (s *AddMachineSuite) TestAddMachine(c *gc.C) { testing. Stderr( cxt), gc.Equals, "created machine machine-0\n") Machine( "0") m.Life( ), gc.Equals, state.Alive) m.Series( ), gc.DeepEquals, "precise") m.Series( ), gc.Equals, "precise") IsEmpty)
- err := runAddMachine(c)
+ cxt, err := runAddMachine(c)
+ c.Assert(
c.Assert(err, gc.IsNil)
m, err := s.State.
c.Assert(err, gc.IsNil)
c.Assert(
- c.Assert(
+ c.Assert(
mcons, err := m.Constraints()
c.Assert(err, gc.IsNil)
c.Assert(&mcons, jc.Satisfies, constraints.
}
func (s *AddMachineSuite) TestAddMachineW ithSeries( c *gc.C) { testing. Stderr( cxt), gc.Equals, "created machine machine-0\n") Machine( "0")
- err := runAddMachine(c, "--series", "series")
+ cxt, err := runAddMachine(c, "--series", "series")
+ c.Assert(
c.Assert(err, gc.IsNil)
m, err := s.State.
c.Assert(err, gc.IsNil)
@@ -50,7 +53,8 @@
}
func (s *AddMachineSuite) TestAddMachineW ithConstraints( c *gc.C) {
- err := runAddMachine(c, "--constraints", "mem=4G")
+ cxt, err := runAddMachine(c, "--constraints", "me...