From e5b1b8302edb75b2b176aaf083440691625d0983 Mon Sep 17 00:00:00 2001 From: Abhishek Dasgupta Date: Tue, 5 Jan 2021 11:04:47 +0530 Subject: [PATCH] Modified testscript to selectively run negative cases. --- .ci/unit_test | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/.ci/unit_test b/.ci/unit_test index 17a70df8c..6fc977cf2 100755 --- a/.ci/unit_test +++ b/.ci/unit_test @@ -60,6 +60,8 @@ if [[ -z "${TEST_PACKAGES}" ]]; then TEST_PACKAGES="cmd pkg" fi +RUN_NEGATIVE=${RUN_NEGATIVE:-"true"} + GINKGO_COMMON_FLAGS="-r -timeout=1h0m0s --progress -slowSpecThreshold=180 -mod=vendor" if [ -z $COVER ] || [ "$COVER" = false ] ; then @@ -68,8 +70,10 @@ if [ -z $COVER ] || [ "$COVER" = false ] ; then # run everything which is not part of negative scenarios with randomizeAllSpecs parameters. ginkgo -race -trace $GINKGO_COMMON_FLAGS -gcflags=all=-d=checkptr=0 --randomizeAllSpecs --randomizeSuites --failOnPending --skip="NEGATIVE\:.*" ${TEST_PACKAGES} - #run negative scenario in a sequenced manner (removed failOnPending as one spec in restore test is marked as 'X' for excluding) - ginkgo -race -trace $GINKGO_COMMON_FLAGS -gcflags=all=-d=checkptr=0 --focus="NEGATIVE\:.*" ${TEST_PACKAGES} + if [ "$RUN_NEGATIVE" = "true" ] ; then + #run negative scenario in a sequenced manner (removed failOnPending as one spec in restore test is marked as 'X' for excluding) + ginkgo -race -trace $GINKGO_COMMON_FLAGS -gcflags=all=-d=checkptr=0 --focus="NEGATIVE\:.*" ${TEST_PACKAGES} + fi else test_with_coverage