Merge lp:~axwalk/juju-core/bootstrap-test-tools into lp:~go-bot/juju-core/trunk

Proposed by Andrew Wilkins
Status: Merged
Approved by: Andrew Wilkins
Approved revision: no longer in the source branch.
Merged at revision: 2640
Proposed branch: lp:~axwalk/juju-core/bootstrap-test-tools
Merge into: lp:~go-bot/juju-core/trunk
Diff against target: 77 lines (+25/-15)
1 file modified
cmd/juju/bootstrap_test.go (+25/-15)
To merge this branch: bzr merge lp:~axwalk/juju-core/bootstrap-test-tools
Reviewer Review Type Date Requested Status
Juju Engineering Pending
Review via email: mp+216237@code.launchpad.net

Commit message

cmd/juju: fix test expecting trusty tools

The tests were recently changed to use the
latest LTS release, however the fake tools
list wasn't updated to match. One of the
tests was failing on my Trusty machine; this
fixes it.

https://codereview.appspot.com/88730043/

Description of the change

cmd/juju: fix test expecting trusty tools

The tests were recently changed to use the
latest LTS release, however the fake tools
list wasn't updated to match. One of the
tests was failing on my Trusty machine; this
fixes it.

https://codereview.appspot.com/88730043/

To post a comment you must log in.
Revision history for this message
Andrew Wilkins (axwalk) wrote :

Reviewers: mp+216237_code.launchpad.net,

Message:
Please take a look.

Description:
cmd/juju: fix test expecting trusty tools

The tests were recently changed to use the
latest LTS release, however the fake tools
list wasn't updated to match. One of the
tests was failing on my Trusty machine; this
fixes it.

https://code.launchpad.net/~axwalk/juju-core/bootstrap-test-tools/+merge/216237

(do not edit description out of merge proposal)

Please review this at https://codereview.appspot.com/88730043/

Affected files (+17, -4 lines):
   A [revision details]
   M cmd/juju/bootstrap_test.go

Index: [revision details]
=== 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-20140416141527-e0lie6a18wlup1kx
+New revision: <email address hidden>

Index: cmd/juju/bootstrap_test.go
=== modified file 'cmd/juju/bootstrap_test.go'
--- cmd/juju/bootstrap_test.go 2014-04-11 11:28:04 +0000
+++ cmd/juju/bootstrap_test.go 2014-04-17 01:47:57 +0000
@@ -663,6 +663,8 @@
   v120p64 = version.MustParseBinary("1.2.0-precise-amd64")
   v120q32 = version.MustParseBinary("1.2.0-quantal-i386")
   v120q64 = version.MustParseBinary("1.2.0-quantal-amd64")
+ v120t32 = version.MustParseBinary("1.2.0-trusty-i386")
+ v120t64 = version.MustParseBinary("1.2.0-trusty-amd64")
   v190p32 = version.MustParseBinary("1.9.0-precise-i386")
   v190q64 = version.MustParseBinary("1.9.0-quantal-amd64")
   v200p64 = version.MustParseBinary("2.0.0-precise-amd64")
@@ -670,12 +672,21 @@
    v100d64, v100p64, v100q64, v100q32,
   }
   v120All = []version.Binary{
- v120d64, v120p64, v120q64, v120q32,
+ v120d64, v120p64, v120q64, v120q32, v120t32, v120t64,
   }
- vAll = []version.Binary{
- v100d64, v100p64, v100q32, v100q64,
- v120d64, v120p64, v120q32, v120q64,
+ v190All = []version.Binary{
    v190p32, v190q64,
+ }
+ v200All = []version.Binary{
    v200p64,
   }
+ vAll = joinBinaryVersions(v100All, v120All, v190All, v200All)
  )
+
+func joinBinaryVersions(versions ...[]version.Binary) []version.Binary {
+ var all []version.Binary
+ for _, versions := range versions {
+ all = append(all, versions...)
+ }
+ return all
+}

Revision history for this message
Tim Penhey (thumper) wrote :

LGTM

although we really should get better at isolating this.

https://codereview.appspot.com/88730043/

Revision history for this message
Dave Cheney (dave-cheney) wrote :

LGTM. Although it smells like version.Current was leaking in there
somewhere if upgrading the host caused tests to fail.

On Thu, Apr 17, 2014 at 11:57 AM, Tim Penhey <email address hidden> wrote:
> LGTM
>
> although we really should get better at isolating this.
>
> https://codereview.appspot.com/88730043/
>
> --
> https://code.launchpad.net/~axwalk/juju-core/bootstrap-test-tools/+merge/216237
> You are subscribed to branch lp:juju-core.

Revision history for this message
Go Bot (go-bot) wrote :
Download full text (26.3 KiB)

The attempt to merge lp:~axwalk/juju-core/bootstrap-test-tools into lp:juju-core failed. Below is the output from the failed tests.

ok launchpad.net/juju-core 0.014s
ok launchpad.net/juju-core/agent 1.725s
ok launchpad.net/juju-core/agent/mongo 1.331s
ok launchpad.net/juju-core/agent/tools 0.190s
ok launchpad.net/juju-core/bzr 5.272s
ok launchpad.net/juju-core/cert 2.372s
ok launchpad.net/juju-core/charm 0.432s
? launchpad.net/juju-core/charm/hooks [no test files]
? launchpad.net/juju-core/charm/testing [no test files]
ok launchpad.net/juju-core/cloudinit 0.028s
ok launchpad.net/juju-core/cloudinit/sshinit 0.800s
ok launchpad.net/juju-core/cmd 0.165s
ok launchpad.net/juju-core/cmd/charm-admin 0.709s
? launchpad.net/juju-core/cmd/charmd [no test files]
? launchpad.net/juju-core/cmd/charmload [no test files]
ok launchpad.net/juju-core/cmd/envcmd 0.169s

----------------------------------------------------------------------
FAIL: bootstrap_test.go:525: BootstrapSuite.TestAutoUploadAfterFailedSync

[LOG] 0:00.003 DEBUG juju.environs.tools no architecture specified when finding tools, looking for any
[LOG] 0:00.003 DEBUG juju.environs.tools no series specified when finding tools, looking for any
[LOG] 0:00.003 DEBUG juju.environs.simplestreams fetchData failed for "file:///tmp/jctest.F6e/gocheck-7504504064263669287/13/tools/streams/v1/index.sjson": stat /tmp/jctest.F6e/gocheck-7504504064263669287/13/tools/streams/v1/index.sjson: no such file or directory
[LOG] 0:00.003 DEBUG juju.environs.simplestreams cannot load index "file:///tmp/jctest.F6e/gocheck-7504504064263669287/13/tools/streams/v1/index.sjson": invalid URL "file:///tmp/jctest.F6e/gocheck-7504504064263669287/13/tools/streams/v1/index.sjson" not found
[LOG] 0:00.003 DEBUG juju.environs.simplestreams fetchData failed for "file:///tmp/jctest.F6e/gocheck-7504504064263669287/13/tools/streams/v1/index.json": stat /tmp/jctest.F6e/gocheck-7504504064263669287/13/tools/streams/v1/index.json: no such file or directory
[LOG] 0:00.003 DEBUG juju.environs.simplestreams cannot load index "file:///tmp/jctest.F6e/gocheck-7504504064263669287/13/tools/streams/v1/index.json": invalid URL "file:///tmp/jctest.F6e/gocheck-7504504064263669287/13/tools/streams/v1/index.json" not found
[LOG] 0:00.005 INFO juju.environs.tools Writing tools/streams/v1/index.json
[LOG] 0:00.005 INFO juju.environs.tools Writing tools/streams/v1/com.ubuntu.juju:released:tools.json
[LOG] 0:00.006 DEBUG juju.environs.tools no architecture specified when finding tools, looking for any
[LOG] 0:00.006 DEBUG juju.environs.tools no series specified when finding tools, looking for any
[LOG] 0:00.006 DEBUG juju.environs.simplestreams fetchData failed for "file:///tmp/jctest.F6e/gocheck-7504504064263669287/14/tools/streams/v1/index.sjson": stat /tmp/jctest.F6e/gocheck-7504504064263669287/14/tools/streams/v1/index.sjson: no such file or directory
[LOG] 0:00.006 DEBUG juju.environs.simplestreams cannot load index "file:///tmp/jctest.F6e/gocheck-7504504064263669287/14/tools/streams/v1/index.sjson": invalid URL "file:///tmp/jctest.F6e/gocheck-7504504064263669287/14/tools/streams/v1/index.sjson" not found
[LOG] 0:...

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'cmd/juju/bootstrap_test.go'
2--- cmd/juju/bootstrap_test.go 2014-04-11 11:28:04 +0000
3+++ cmd/juju/bootstrap_test.go 2014-04-17 03:04:05 +0000
4@@ -523,10 +523,9 @@
5 }
6
7 func (s *BootstrapSuite) TestAutoUploadAfterFailedSync(c *gc.C) {
8- otherSeries := "precise"
9- if otherSeries == version.Current.Series {
10- otherSeries = "raring"
11- }
12+ s.PatchValue(&version.Current.Series, config.LatestLtsSeries())
13+ otherSeries := "quantal"
14+
15 env := s.setupAutoUploadTest(c, "1.7.3", otherSeries)
16 // Run command and check for that upload has been run for tools matching the current juju version.
17 opc, errc := runCommand(nullContext(c), new(BootstrapCommand))
18@@ -536,17 +535,17 @@
19 c.Assert(err, gc.IsNil)
20 c.Logf("found: " + list.String())
21 urls := list.URLs()
22- expectedUrlCount := 2
23
24- // There will be distinct tools for each of these if they are different
25- if config.LatestLtsSeries() != coretesting.FakeDefaultSeries {
26- expectedUrlCount++
27- }
28- c.Assert(urls, gc.HasLen, expectedUrlCount)
29+ // We expect:
30+ // latest LTS,
31+ // the specified series (quantal),
32+ // and the environment's default series (raring).
33 expectedVers := []version.Binary{
34- version.MustParseBinary(fmt.Sprintf("1.7.3.1-%s-%s", otherSeries, version.Current.Arch)),
35+ version.MustParseBinary(fmt.Sprintf("1.7.3.1-%s-%s", "quantal", version.Current.Arch)),
36+ version.MustParseBinary(fmt.Sprintf("1.7.3.1-%s-%s", "raring", version.Current.Arch)),
37 version.MustParseBinary(fmt.Sprintf("1.7.3.1-%s-%s", version.Current.Series, version.Current.Arch)),
38 }
39+ c.Assert(urls, gc.HasLen, len(expectedVers))
40 for _, vers := range expectedVers {
41 c.Logf("seeking: " + vers.String())
42 _, found := urls[vers]
43@@ -663,6 +662,8 @@
44 v120p64 = version.MustParseBinary("1.2.0-precise-amd64")
45 v120q32 = version.MustParseBinary("1.2.0-quantal-i386")
46 v120q64 = version.MustParseBinary("1.2.0-quantal-amd64")
47+ v120t32 = version.MustParseBinary("1.2.0-trusty-i386")
48+ v120t64 = version.MustParseBinary("1.2.0-trusty-amd64")
49 v190p32 = version.MustParseBinary("1.9.0-precise-i386")
50 v190q64 = version.MustParseBinary("1.9.0-quantal-amd64")
51 v200p64 = version.MustParseBinary("2.0.0-precise-amd64")
52@@ -670,12 +671,21 @@
53 v100d64, v100p64, v100q64, v100q32,
54 }
55 v120All = []version.Binary{
56- v120d64, v120p64, v120q64, v120q32,
57+ v120d64, v120p64, v120q64, v120q32, v120t32, v120t64,
58 }
59- vAll = []version.Binary{
60- v100d64, v100p64, v100q32, v100q64,
61- v120d64, v120p64, v120q32, v120q64,
62+ v190All = []version.Binary{
63 v190p32, v190q64,
64+ }
65+ v200All = []version.Binary{
66 v200p64,
67 }
68+ vAll = joinBinaryVersions(v100All, v120All, v190All, v200All)
69 )
70+
71+func joinBinaryVersions(versions ...[]version.Binary) []version.Binary {
72+ var all []version.Binary
73+ for _, versions := range versions {
74+ all = append(all, versions...)
75+ }
76+ return all
77+}

Subscribers

People subscribed via source and target branches

to status/vote changes: