From 815b44b9a89ae19299d2ba6171a32ae6d34cefa1 Mon Sep 17 00:00:00 2001 From: Sally O'Malley Date: Wed, 1 Aug 2018 18:34:17 -0400 Subject: [PATCH] Remove bazel from test process CORS-749, CORS-750 --- .travis.yml | 4 ++++ hack/gotest.sh | 14 ++++++++++++++ hack/tf-fmt.sh | 17 +++++++++++++++++ 3 files changed, 35 insertions(+) create mode 100755 hack/gotest.sh create mode 100755 hack/tf-fmt.sh diff --git a/.travis.yml b/.travis.yml index 2eea4624b4f..b71eb914716 100644 --- a/.travis.yml +++ b/.travis.yml @@ -18,6 +18,10 @@ jobs: name: YAML lint - script: ./hack/shellcheck.sh name: shellcheck + - script: ./hack/tf-fmt.sh + name: Terraform format + - script: ./hack/gotest.sh + name: go test - script: "docker run -v $PWD:/go/src/github.com/openshift/installer -w /go/src/github.com/openshift/installer quay.io/coreos/golang-testing go vet ./installer/..." name: Go vet - script: "docker run -v $PWD:$PWD -w $PWD quay.io/coreos/golang-testing golint -set_exit_status installer/..." diff --git a/hack/gotest.sh b/hack/gotest.sh new file mode 100755 index 00000000000..eafdabefac6 --- /dev/null +++ b/hack/gotest.sh @@ -0,0 +1,14 @@ +#!/bin/sh + +# :) is there a better way to set up the path here in prow? +if [ "$IS_CONTAINER" != "" ]; then + NEEDPATH='/usr/local/go/src/github.com/openshift/installer' + mkdir -p $NEEDPATH + cp -R . $NEEDPATH/. + cd $NEEDPATH || exit 1 + CGO_ENABLED=0 go test ./installer/... +else + #in prow, have to figure out how to set workingdir so can just use this instead + #docker run -e IS_CONTAINER='TRUE' -v "$(pwd)":/usr/local/go/src/github.com/openshift/installer -w /usr/local/go/src/github.com/openshift/installer quay.io/coreos/golang-testing ./hack/gotest.sh + docker run -e IS_CONTAINER='TRUE' -v "$(pwd)":"$(pwd)" -w "$(pwd)" quay.io/coreos/golang-testing ./hack/gotest.sh +fi diff --git a/hack/tf-fmt.sh b/hack/tf-fmt.sh new file mode 100755 index 00000000000..9064168ba8d --- /dev/null +++ b/hack/tf-fmt.sh @@ -0,0 +1,17 @@ +#!/bin/sh + +# in prow, already in container, so no 'docker run' +if [ "$IS_CONTAINER" != "" ]; then + export PATH=/tmp:$PATH + INSTALLER_REPO=$(pwd) + cd /tmp || exit 1 + wget https://releases.hashicorp.com/terraform/0.11.7/terraform_0.11.7_linux_amd64.zip + unzip terraform_0.11.7_linux_amd64.zip + set -x + cd "$INSTALLER_REPO" || exit 1 + /tmp/terraform fmt -list -check -write=false +else + docker run -e IS_CONTAINER='TRUE' \ + --rm -v "$PWD":"$PWD":ro -w "$PWD" -v /tmp:/tmp:rw \ + -w "$PWD" quay.io/coreos/golang-testing ./hack/tf-fmt.sh +fi