Skip to content

Commit

Permalink
e2e tests
Browse files Browse the repository at this point in the history
  • Loading branch information
lkingland committed Mar 31, 2022
1 parent 15f33d1 commit bc3e1db
Showing 1 changed file with 8 additions and 3 deletions.
11 changes: 8 additions & 3 deletions test/_e2e/cmd_build_test.go
Original file line number Diff line number Diff line change
@@ -1,10 +1,15 @@
//go:build e2e
// +build e2e

package e2e

import (
"os"
"regexp"
"strings"
"testing"

. "knative.dev/kn-plugin-func/testing"
)

// Build runs `func build' command for a given test project.
Expand Down Expand Up @@ -33,13 +38,13 @@ func TestBuild_S2I(t *testing.T) {
root = "testdata/e2e/testbuild"
bin, prefix = bin()
cleanup = Within(t, root) // TODO: replace with func/testing pkg
cwd, _ = os.Getwd()
cwd, _ = os.Getwd() // absolute path
)
defer cleanup()

run(t, bin, prefix, "create", "-v", "--language", "node", cwd)
output := run(t, bin, prefix, "build", "-v", "--builder", "s2i")
if !strings.Contains(output, "Function image built:") {
t.Fatal("funciton image not built")
t.Fatal("image not built")
}
project.IsBuilt = true // other tests can skip build
}

0 comments on commit bc3e1db

Please sign in to comment.