mcvsubbu commented on a change in pull request #6969:
URL: https://github.com/apache/incubator-pinot/pull/6969#discussion_r639012635
##########
File path: compatibility-verifier/README.md
##########
@@ -32,7 +32,13 @@ dir and output the path, which can be used in step 2.
### Step 2: run compatibility regression test against the two targets build in
step1
```shell
-./compatibility-verifier/compCheck.sh [workingDir]
+./compCheck.sh -h
+Usage: -w <workingDir> -t <testSuiteDir> -k true/false
Review comment:
```suggestion
Usage: -w <workingDir> -t <testSuiteDir> [-k]
```
##########
File path: compatibility-verifier/README.md
##########
@@ -32,7 +32,13 @@ dir and output the path, which can be used in step 2.
### Step 2: run compatibility regression test against the two targets build in
step1
```shell
-./compatibility-verifier/compCheck.sh [workingDir]
+./compCheck.sh -h
+Usage: -w <workingDir> -t <testSuiteDir> -k true/false
+MANDATORY:
+ -w, --working-dir Working directory where olderCommit
and newCommit target files reside.
+ -t, --test-suite-dir Test suite directory
+
+OPTIONAL:
+ -k, --keep-cluster-on-failure Whether keep cluster on test failure
(default: false)
Review comment:
```suggestion
-k, --keep-cluster-on-failure Keep cluster on test failure
```
##########
File path: compatibility-verifier/compCheck.sh
##########
@@ -41,20 +41,54 @@
RM="/bin/rm"
logCount=1
+#Declare the number of mandatory args
+margs=2
# get usage of the script
function usage() {
command=$1
- echo "Usage: $command workingDir testSuiteDir"
- exit 1
+ echo "Usage: $command -w <workingDir> -t <testSuiteDir> -k true/false"
+}
+
+function help() {
+ usage
+ echo -e "MANDATORY:"
+ echo -e " -w, --working-dir Working directory where
olderCommit and newCommit target files reside."
+ echo -e " -t, --test-suite-dir Test suite directory\n"
+ echo -e "OPTIONAL:"
+ echo -e " -k, --keep-cluster-on-failure Whether keep cluster on
test failure (default: false)"
Review comment:
```suggestion
echo -e " -k, --keep-cluster-on-failure Keep cluster on test
failure"
```
##########
File path: compatibility-verifier/compCheck.sh
##########
@@ -41,20 +41,54 @@
RM="/bin/rm"
logCount=1
+#Declare the number of mandatory args
+margs=2
# get usage of the script
function usage() {
command=$1
- echo "Usage: $command workingDir testSuiteDir"
- exit 1
+ echo "Usage: $command -w <workingDir> -t <testSuiteDir> -k true/false"
+}
+
+function help() {
+ usage
+ echo -e "MANDATORY:"
+ echo -e " -w, --working-dir Working directory where
olderCommit and newCommit target files reside."
+ echo -e " -t, --test-suite-dir Test suite directory\n"
+ echo -e "OPTIONAL:"
+ echo -e " -k, --keep-cluster-on-failure Whether keep cluster on
test failure (default: false)"
+ echo -e " -h, --help Prints this help\n"
+}
+
+# Ensures that the number of passed args are at least equals
+# to the declared number of mandatory args.
+# It also handles the special case of the -h or --help arg.
+function margs_precheck() {
+ if [ $2 ] && [ $1 -lt $margs ]; then
+ if [ $2 == "--help" ] || [ $2 == "-h" ]; then
+ help
+ exit
+ else
+ usage compCheck
+ exit 1 # error
+ fi
+ fi
+}
+
+# Ensures that all the mandatory args are not empty
+function margs_check() {
+ if [ $# -lt $margs ]; then
Review comment:
will be good if oldTargetDir and newTargetDir presence is also checked
in workingDir
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]