Initial adoption of ginkgo in e2e tests

In order to adopt ginkgo incrementally, let's start by replacing
test/e2e/driver.go with a call to ginkgo runner and convert each of the
other tests to a small Decscribe() snippet that simply calls the legacy
TestXYZ function.

From this basis we can take further incremental steps by converting
individual tests to native ginkgo format, using Fail() for all failure
cases, using By() for logs, enabling JUnit reports, etc.

Tested:
- cmd/e2e builds and `make check` passes.
- Running _output/bin/.../e2e on an alive cluster works.
- Running the full hack/e2e-test.sh works as expected.
This commit is contained in:
Filipe Brandenburger
2015-01-27 16:38:48 -08:00
parent dd8ada849e
commit 1c028de03a
11 changed files with 131 additions and 110 deletions

View File

@@ -23,6 +23,9 @@ import (
"github.com/GoogleCloudPlatform/kubernetes/pkg/client"
"github.com/GoogleCloudPlatform/kubernetes/pkg/util"
"github.com/golang/glog"
. "github.com/onsi/ginkgo"
. "github.com/onsi/gomega"
)
func TestNetwork(c *client.Client) bool {
@@ -138,3 +141,11 @@ func TestNetwork(c *client.Client) bool {
return false
}
var _ = Describe("TestNetwork", func() {
It("should pass", func() {
// TODO: Instead of OrDie, client should Fail the test if there's a problem.
// In general tests should Fail() instead of glog.Fatalf().
Expect(TestNetwork(loadClientOrDie())).To(BeTrue())
})
})