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:
@@ -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())
|
||||
})
|
||||
})
|
||||
|
Reference in New Issue
Block a user