diff --git a/.bettercodehub.yml b/.bettercodehub.yml index 1de4a1ee8..b7b243086 100644 --- a/.bettercodehub.yml +++ b/.bettercodehub.yml @@ -3,4 +3,3 @@ languages: - go exclude: - /pkg/generated/.* -- /vendor/.* diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 14b38baeb..7684bf952 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -42,7 +42,7 @@ jobs: reporter: github-pr-review path: '.' pattern: '*.sh' - exclude: './.git/*,./vendor/*' + exclude: './.git/*' unit-test: # to ignore builds on release diff --git a/.github/workflows/pull_request.yml b/.github/workflows/pull_request.yml index b8b143aab..e9db4c186 100644 --- a/.github/workflows/pull_request.yml +++ b/.github/workflows/pull_request.yml @@ -41,7 +41,6 @@ jobs: reporter: github-pr-review path: '.' pattern: '*.sh' - exclude: './vendor/*' unit-test: runs-on: ubuntu-latest diff --git a/buildscripts/test-cov.sh b/buildscripts/test-cov.sh index f4b23f25d..0f1206c44 100755 --- a/buildscripts/test-cov.sh +++ b/buildscripts/test-cov.sh @@ -17,7 +17,7 @@ set -e echo "" > coverage.txt -for d in $(go list ./... | grep -v 'vendor\|pkg/apis\|pkg/client\|tests'); do +for d in $(go list ./... | grep -v 'pkg/apis\|pkg/client\|tests'); do #TODO - Include -race while creating the coverage profile. go test -coverprofile=profile.out -covermode=atomic $d if [ -f profile.out ]; then diff --git a/buildscripts/test.sh b/buildscripts/test.sh index 24e367ef6..90fbc64b0 100755 --- a/buildscripts/test.sh +++ b/buildscripts/test.sh @@ -17,7 +17,7 @@ set -e # Create a temp dir and clean it up on exit -TEMPDIR=`mktemp -d -t csi-test.XXX` +TEMPDIR=$(mktemp -d -t csi-test.XXX) trap "rm -rf $TEMPDIR" EXIT HUP INT QUIT TERM # Build the Maya binary for the tests @@ -26,7 +26,7 @@ go build -o $TEMPDIR/maya || exit 1 # Run the tests echo "--> Running tests" -GOBIN="`which go`" +GOBIN="$(which go)" PATH=$TEMPDIR:$PATH \ $GOBIN test ${GOTEST_FLAGS:--cover -timeout=900s} $($GOBIN list ./... | grep -v 'vendor\|pkg/apis\|pkg/generated\|tests') diff --git a/ci/ci-test.sh b/ci/ci-test.sh index 60ce37fe3..20a630d9a 100755 --- a/ci/ci-test.sh +++ b/ci/ci-test.sh @@ -12,43 +12,30 @@ # See the License for the specific language governing permissions and # limitations under the License. +# shellcheck disable=SC1128 #!/usr/bin/env bash -#OPENEBS_OPERATOR=https://raw.githubusercontent.com/openebs/openebs/HEAD/k8s/openebs-operator.yaml -# NDM_OPERATOR=https://raw.githubusercontent.com/openebs/cstor-operators/HEAD/deploy/ndm-operator.yaml -# CSTOR_RBAC=https://raw.githubusercontent.com/openebs/cstor-operators/HEAD/deploy/rbac.yaml -CSTOR_OPERATOR=https://raw.githubusercontent.com/openebs/cstor-operators/HEAD/deploy/cstor-operator.yaml -# ALL_CRD=https://raw.githubusercontent.com/openebs/cstor-operators/HEAD/deploy/crds/all_cstor_crds.yaml +CSTOR_OPERATOR="https://raw.githubusercontent.com/openebs/cstor-operators/HEAD/deploy/cstor-operator.yaml" -CSI_OPERATOR="$GOPATH/src/github.com/openebs/cstor-csi/deploy/csi-operator.yaml" -SNAPSHOT_CLASS="$GOPATH/src/github.com/openebs/cstor-csi/deploy/snapshot-class.yaml" - -#DST_PATH="$GOPATH/src/github.com/openebs" - -# Prepare env for runnging BDD tests -# Minikube is already running -# kubectl apply -f $CSTOR_RBAC -# kubectl apply -f $NDM_OPERATOR -# kubectl apply -f $ALL_CRD -kubectl apply -f $CSTOR_OPERATOR +kubectl apply -f "$CSTOR_OPERATOR" kubectl apply -f ./deploy/csi-operator.yaml kubectl apply -f ./deploy/snapshot-class.yaml function dumpCSINodeLogs() { LC=$1 CSINodePOD=$(kubectl get pods -l app=openebs-csi-node -o jsonpath='{.items[0].metadata.name}' -n kube-system) - kubectl describe po $CSINodePOD -n openebs + kubectl describe po "$CSINodePOD" -n openebs printf "\n\n" - kubectl logs --tail=${LC} $CSINodePOD -n openebs -c openebs-csi-plugin + kubectl logs --tail="${LC}" "$CSINodePOD" -n openebs -c openebs-csi-plugin printf "\n\n" } function dumpCSIControllerLogs() { LC=$1 CSIControllerPOD=$(kubectl get pods -l app=openebs-csi-controller -o jsonpath='{.items[0].metadata.name}' -n kube-system) - kubectl describe po $CSIControllerPOD -n openebs + kubectl describe po "$CSIControllerPOD" -n openebs printf "\n\n" - kubectl logs --tail=${LC} $CSIControllerPOD -n openebs -c openebs-csi-plugin + kubectl logs --tail="${LC}" "$CSIControllerPOD" -n openebs -c openebs-csi-plugin printf "\n\n" } @@ -65,9 +52,6 @@ dumpCSIControllerLogs 1000 echo "********************* CSI Node logs *********************************" dumpCSINodeLogs 1000 -#echo "******************CSI Maya-apiserver logs ********************" -#dumpMayaAPIServerLogs 1000 - echo "get all the pods" kubectl get pods --all-namespaces