From 6befc75da5fc5a8ef6183163be03ff2c5cfb1cd0 Mon Sep 17 00:00:00 2001 From: Daniel Smith Date: Tue, 28 Oct 2014 12:37:03 -0700 Subject: [PATCH] Build local go components as well as a release --- hack/e2e.go | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) diff --git a/hack/e2e.go b/hack/e2e.go index 334755749a4..4066105c003 100644 --- a/hack/e2e.go +++ b/hack/e2e.go @@ -72,7 +72,10 @@ func main() { } if *build { - if !runBash("build", `test-build-release`) { + if !run("build-local", "hack/build-go.sh") { + log.Fatal("Error building. Aborting.") + } + if !runBash("build-release", `test-build-release`) { log.Fatal("Error building. Aborting.") } } @@ -157,9 +160,17 @@ func Test() (failed, passed []string) { // All nonsense below is temporary until we have go versions of these things. func runBash(stepName, bashFragment string) bool { - log.Printf("Running: %v", stepName) cmd := exec.Command("bash", "-s") cmd.Stdin = strings.NewReader(bashWrap(bashFragment)) + return finishRunning(stepName, cmd) +} + +func run(stepName, cmdPath string) bool { + return finishRunning(stepName, exec.Command(filepath.Join(*root, cmdPath))) +} + +func finishRunning(stepName string, cmd *exec.Cmd) bool { + log.Printf("Running: %v", stepName) stdout, stderr := bytes.NewBuffer(nil), bytes.NewBuffer(nil) if *verbose { cmd.Stdout = os.Stdout