Skip to content

Commit

Permalink
update the flag
Browse files Browse the repository at this point in the history
  • Loading branch information
aabughosh committed Nov 7, 2023
1 parent adb89ca commit 2fbd6a7
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 6 deletions.
9 changes: 4 additions & 5 deletions cnf-certification-test/suite_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ const (
serverModeFlag = "serverMode"
TNFReportKey = "cnf-certification-test"
extraInfoKey = "testsExtraInfo"
defaultServerMode = "false"
defaultServerMode = false
)

var (
Expand All @@ -87,16 +87,15 @@ 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() {
claimPath = flag.String(claimPathFlagKey, defaultClaimPath,
"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
Expand Down Expand Up @@ -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.
Expand Down
5 changes: 4 additions & 1 deletion run-cnf-suites.sh
Original file line number Diff line number Diff line change
Expand Up @@ -89,14 +89,17 @@ 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 \
-ginkgo.v \
-test.v\
"

if [ "$SERVER_RUN" = "true" ]; then
GINKGO_ARGS="$GINKGO_ARGS -serverMode"
fi

if [[ $LABEL == "all" ]]; then
LABEL='common,extended,faredge,telco'
fi
Expand Down

0 comments on commit 2fbd6a7

Please sign in to comment.