Skip to content
Permalink
Browse files

Merge pull request #3961 from mwhudson/metricsadder-vars

fix api/metricsadder & apiserver/environment test compilation with ne…

…w gccgo

gccgo (in xenial at least) is stricter than gc when it comes to a certain
class of declared but not used variable, see:

    golang/go#6415
    golang/go#3059
  • Loading branch information...
jujubot committed Dec 15, 2015
2 parents 3639d7a + cff2cb9 commit f81ca41d6fdad0290d7bed9f8a926dacd0f5fbd7
Showing with 1 addition and 11 deletions.
  1. +1 −3 api/metricsadder/client_test.go
  2. +0 −8 apiserver/environment/toolsversionupdate_test.go
@@ -65,11 +65,9 @@ func (s *metricsAdderSuite) TestAddMetricBatches(c *gc.C) {

func (s *metricsAdderSuite) TestAddMetricBatchesFails(c *gc.C) {
var called bool
var callParams params.MetricBatchParams
metricsadder.PatchFacadeCall(s, s.adder, func(request string, args, response interface{}) error {
p, ok := args.(params.MetricBatchParams)
_, ok := args.(params.MetricBatchParams)
c.Assert(ok, jc.IsTrue)
callParams = p
called = true
c.Assert(request, gc.Equals, "AddMetricBatches")
result := response.(*params.ErrorResults)
@@ -38,15 +38,11 @@ func (s *updaterSuite) TestCheckTools(c *gc.C) {
}
s.PatchValue(&newEnvirons, fakeNewEnvirons)
var (
calledWithEnviron environs.Environ
calledWithMajor, calledWithMinor int
calledWithFilter coretools.Filter
)
fakeToolFinder := func(e environs.Environ, maj int, min int, stream string, filter coretools.Filter) (coretools.List, error) {
calledWithEnviron = e
calledWithMajor = maj
calledWithMinor = min
calledWithFilter = filter
ver := version.Binary{Number: version.Number{Major: maj, Minor: min}}
t := coretools.Tools{Version: ver, URL: "http://example.com", Size: 1}
c.Assert(calledWithMajor, gc.Equals, 2)
@@ -74,16 +70,12 @@ func (s *updaterSuite) TestCheckToolsNonReleasedStream(c *gc.C) {
}
s.PatchValue(&newEnvirons, fakeNewEnvirons)
var (
calledWithEnviron environs.Environ
calledWithMajor, calledWithMinor int
calledWithFilter coretools.Filter
calledWithStreams []string
)
fakeToolFinder := func(e environs.Environ, maj int, min int, stream string, filter coretools.Filter) (coretools.List, error) {
calledWithEnviron = e
calledWithMajor = maj
calledWithMinor = min
calledWithFilter = filter
calledWithStreams = append(calledWithStreams, stream)
if stream == "released" {
return nil, coretools.ErrNoMatches

0 comments on commit f81ca41

Please sign in to comment.
You can’t perform that action at this time.