Revert "Revert "Use native Ginkgo test runner instead of cmd/e2e (attempt N)""

This reverts commit f4bb6aa37d.
This commit is contained in:
Jeff Grafton
2015-05-19 09:13:08 -07:00
parent 2c81050e6f
commit bf1de72f4a
9 changed files with 195 additions and 293 deletions

View File

@@ -19,7 +19,6 @@ package e2e
import (
"bytes"
"fmt"
"io/ioutil"
"os/exec"
"path/filepath"
@@ -27,36 +26,19 @@ import (
)
var _ = Describe("Shell", func() {
bashE2ERoot := filepath.Join(testContext.RepoRoot, "hack/e2e-suite")
defer GinkgoRecover()
// Slurp up all the tests in hack/e2e-suite
files, err := ioutil.ReadDir(bashE2ERoot)
if err != nil {
Fail(fmt.Sprintf("Error reading test suites from %v %v", bashE2ERoot, err.Error()))
}
for _, file := range files {
fileName := file.Name() // Make a copy
It(fmt.Sprintf("tests that %v passes", fileName), func() {
// A number of scripts only work on gce
if !providerIs("gce", "gke") {
By(fmt.Sprintf("Skipping Shell test %s, which is only supported for provider gce and gke (not %s)",
fileName, testContext.Provider))
return
}
runCmdTest(filepath.Join(bashE2ERoot, fileName))
})
}
It(fmt.Sprintf("tests that services.sh passes"), func() {
// The services script only works on gce/gke
if !providerIs("gce", "gke") {
By(fmt.Sprintf("Skipping Shell test services.sh, which is only supported for provider gce and gke (not %s)",
testContext.Provider))
return
}
runCmdTest(filepath.Join(testContext.RepoRoot, "hack/e2e-suite/services.sh"))
})
})
func absOrDie(path string) string {
out, err := filepath.Abs(path)
if err != nil {
panic(err)
}
return out
}
// Runs the given cmd test.
func runCmdTest(path string) {
By(fmt.Sprintf("Running %v", path))