Fixes to feature test suites. #2015

Merged
merged 1 commit into from Apr 1, 2015
Jump to file or symbol
Failed to load files and symbols.
+6 −64
Split
@@ -17,8 +17,6 @@ type annotationsSuite struct {
annotationsClient *annotations.Client
}
-var _ = gc.Suite(&annotationsSuite{})
-
func (s *annotationsSuite) SetUpTest(c *gc.C) {
s.JujuConnSuite.SetUpTest(c)
s.annotationsClient = annotations.NewClient(s.APIState)
@@ -21,8 +21,6 @@ type apiEnvironmentSuite struct {
client *api.Client
}
-var _ = gc.Suite(&apiEnvironmentSuite{})
-
func (s *apiEnvironmentSuite) SetUpTest(c *gc.C) {
s.JujuConnSuite.SetUpTest(c)
var err error
@@ -18,8 +18,6 @@ type blockSuite struct {
blockClient *block.Client
}
-var _ = gc.Suite(&blockSuite{})
-
func (s *blockSuite) SetUpTest(c *gc.C) {
s.JujuConnSuite.SetUpTest(c)
s.blockClient = block.NewClient(s.APIState)
@@ -17,8 +17,6 @@ type apiCharmsSuite struct {
charmsClient *charms.Client
}
-var _ = gc.Suite(&apiCharmsSuite{})
-
func (s *apiCharmsSuite) SetUpTest(c *gc.C) {
s.JujuConnSuite.SetUpTest(c)
s.charmsClient = charms.NewClient(s.APIState)
@@ -23,8 +23,6 @@ type cmdEnvironmentSuite struct {
jujutesting.RepoSuite
}
-var _ = gc.Suite(&cmdEnvironmentSuite{})
-
func (s *cmdEnvironmentSuite) SetUpTest(c *gc.C) {
s.RepoSuite.SetUpTest(c)
s.SetFeatureFlags(feature.JES)
@@ -1,41 +0,0 @@
-// Copyright 2015 Canonical Ltd.
-// Licensed under the AGPLv3, see LICENCE file for details.
-
-// TODO(dimitern) Remove this file once bug http://pad.lv/1425788 is
-// resolved. For now in order to exclude the problematic
-// cmdjuju_test.go from compiling on gccgo (amd64 and ppc64 are both
-// affected), while also running the other tests which pass on gccgo
-// we need 2 package_test files: this one needs to be called
-// package_gccgo_test.go, not package_test_gccgo.go in order to be
-// considered at all by 'go test' which ignores non *_test.go files.
-
-// +build gccgo
-
-package featuretests
-
-import (
- "flag"
- "testing"
-
- gc "gopkg.in/check.v1"
-
- coretesting "github.com/juju/juju/testing"
-)
-
-var runFeatureTests = flag.Bool("featuretests", true, "Run long-running feature tests.")
-
-func init() {
-
- flag.Parse()
-
- if *runFeatureTests == false {
- return
- }
- // Initialize all suites here.
- gc.Suite(&leadershipSuite{})
- gc.Suite(&uniterLeadershipSuite{})
-}
-
-func Test(t *testing.T) {
- coretesting.MgoTestPackage(t)
-}
@@ -1,17 +1,6 @@
// Copyright 2015 Canonical Ltd.
// Licensed under the AGPLv3, see LICENCE file for details.
-// TODO(dimitern) Disabled on gccgo (PPC64 in particular) due
-// to build failures. See bug http://pad.lv/1425788.
-//
-// NOTE: This file is built only with the default gc compiler. We
-// can't use runtime.Compiler to exclude only the problematic
-// gc.Suite(&cmdJujuSuite{}) statement below because runtime.Compiler
-// is a const, whereas the +build directives are honored by -compiler
-// gccgo as well. See also the comment in package_gccgo_test.go.
-
-// +build !gccgo
-
package featuretests
import (
@@ -36,6 +25,12 @@ func init() {
gc.Suite(&cmdJujuSuite{})
gc.Suite(&leadershipSuite{})
gc.Suite(&uniterLeadershipSuite{})
+ gc.Suite(&annotationsSuite{})
+ gc.Suite(&apiEnvironmentSuite{})
+ gc.Suite(&blockSuite{})
+ gc.Suite(&apiCharmsSuite{})
+ gc.Suite(&cmdEnvironmentSuite{})
+ gc.Suite(&cmdStorageSuite{})
}
func Test(t *testing.T) {
@@ -66,8 +66,6 @@ type cmdStorageSuite struct {
jujutesting.RepoSuite
}
-var _ = gc.Suite(&cmdStorageSuite{})
-
func (s *cmdStorageSuite) SetUpTest(c *gc.C) {
s.RepoSuite.SetUpTest(c)
s.SetFeatureFlags(feature.Storage)