From 93a323874ab2af1ef25464abdb7d4fdc1c5c0216 Mon Sep 17 00:00:00 2001 From: aabughosh <88486034+aabughosh@users.noreply.github.com> Date: Tue, 7 Nov 2023 13:14:09 +0200 Subject: [PATCH] update the flag --- cnf-certification-test/suite_test.go | 9 ++++----- run-cnf-suites.sh | 5 ++++- 2 files changed, 8 insertions(+), 6 deletions(-) diff --git a/cnf-certification-test/suite_test.go b/cnf-certification-test/suite_test.go index 7f1b1a12a..60b2325c4 100644 --- a/cnf-certification-test/suite_test.go +++ b/cnf-certification-test/suite_test.go @@ -67,7 +67,7 @@ const ( serverModeFlag = "serverMode" TNFReportKey = "cnf-certification-test" extraInfoKey = "testsExtraInfo" - defaultServerMode = "false" + defaultServerMode = false ) var ( @@ -87,7 +87,7 @@ var ( // ClaimFormat is the current version for the claim file format to be produced by the TNF test suite. // A client decoding this claim file must support decoding its specific version. ClaimFormatVersion string - serverMode *string + serverMode *bool ) func init() { @@ -95,8 +95,7 @@ func init() { "the path where the claimfile will be output") junitPath = flag.String(junitFlagKey, defaultCliArgValue, "the path for the junit format report") - serverMode = flag.String(serverModeFlag, defaultServerMode, - "run test with webserver") + serverMode = flag.Bool("serverMode", defaultServerMode, "run test with webserver") } // setLogLevel sets the log level for logrus based on the "TNF_LOG_LEVEL" environment variable @@ -183,7 +182,7 @@ func PreRun(t *testing.T) (claimData *claim.Claim, claimRoot *claim.Root) { // TestTest invokes the CNF Certification Test Suite. func TestTest(t *testing.T) { ginkgoConfig, _ := ginkgo.GinkgoConfiguration() - if *serverMode == "false" { + if !*serverMode { claimData, claimRoot := PreRun(t) var diagnosticMode bool // Diagnostic functions will run when no labels are provided. diff --git a/run-cnf-suites.sh b/run-cnf-suites.sh index 17e48283e..625be8052 100755 --- a/run-cnf-suites.sh +++ b/run-cnf-suites.sh @@ -89,7 +89,6 @@ fi # Specify Junit report file name. GINKGO_ARGS="\ --ginkgo.timeout=$TIMEOUT \ --serverMode $SERVER_RUN \ -junit $OUTPUT_LOC \ -claimloc $OUTPUT_LOC \ --ginkgo.junit-report $OUTPUT_LOC/cnf-certification-tests_junit.xml \ @@ -97,6 +96,10 @@ GINKGO_ARGS="\ -test.v\ " +if [ "$SERVER_RUN" = "true" ]; then + GINKGO_ARGS="$GINKGO_ARGS -serverMode" +fi + if [[ $LABEL == "all" ]]; then LABEL='common,extended,faredge,telco' fi