Skip to content

Commit

Permalink
Merge pull request #309 from bowei/e2e1
Browse files Browse the repository at this point in the history
Add version and gitcommit to the e2e test
  • Loading branch information
bowei authored Jun 5, 2018
2 parents 8faf657 + 959b795 commit fda3d63
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 1 deletion.
5 changes: 4 additions & 1 deletion build/build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,10 @@ if [ $GOARCH == "amd64" ]; then
fi

if echo "${TARGET}" | grep '.*-test$'; then
go test -c -o "${TARGET}" "$PKG/cmd/$(basename ${TARGET})"
go test -c \
-ldflags "-X ${PKG}/pkg/version.Version=${VERSION} -X ${PKG}/pkg/version.GitCommit=${GIT_COMMIT}" \
-o "${TARGET}" \
"$PKG/cmd/$(basename ${TARGET})"
else
go install \
-installsuffix "static" \
Expand Down
4 changes: 4 additions & 0 deletions cmd/e2e-test/main_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ import (
"k8s.io/client-go/rest"
"k8s.io/client-go/tools/clientcmd"
"k8s.io/ingress-gce/pkg/e2e"
"k8s.io/ingress-gce/pkg/version"
// Pull in the auth library for GCP.
_ "k8s.io/client-go/plugin/pkg/client/auth/gcp"
)
Expand Down Expand Up @@ -60,6 +61,9 @@ func TestMain(m *testing.M) {
return
}

fmt.Printf("Version: %q\n", version.Version)
fmt.Printf("Commit: %q\n", version.GitCommit)

var err error
var kubeconfig *rest.Config

Expand Down

0 comments on commit fda3d63

Please sign in to comment.