From 23453a4e53d1c1eb6fae8d0c39bce6457871c1ae Mon Sep 17 00:00:00 2001 From: Shashank Reddy Boyapally Date: Fri, 13 Sep 2024 12:46:16 -0400 Subject: [PATCH 1/4] change exit Signed-off-by: Shashank Reddy Boyapally --- run_check.sh | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) create mode 100755 run_check.sh diff --git a/run_check.sh b/run_check.sh new file mode 100755 index 0000000..e7bb28b --- /dev/null +++ b/run_check.sh @@ -0,0 +1,20 @@ +#!/bin/bash + +# Function to run a command and handle specific exit codes +run_cmd(){ + echo "$@" + ${@} + EXIT_CODE=$? + + if [ $EXIT_CODE -eq 2 ]; then + echo "Exit code 2 encountered, regression detected, treating as success" + return 0 + elif [ $EXIT_CODE -eq 3 ]; then + echo "Exit code 3 encountered, not enough data" + return 0 + else + return $EXIT_CODE + fi +} + +run_cmd orion cmd --config "examples/readout-control-plane-cdv2.yaml" --hunter-analyze --output-format text --save-output-path=output.txt From cb17320d76024bd7393248d0567bc71a87a7f107 Mon Sep 17 00:00:00 2001 From: Shashank Reddy Boyapally Date: Fri, 13 Sep 2024 12:47:25 -0400 Subject: [PATCH 2/4] changed exit code capture Signed-off-by: Shashank Reddy Boyapally --- test.bats | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/test.bats b/test.bats index e415f04..2f46123 100644 --- a/test.bats +++ b/test.bats @@ -5,8 +5,7 @@ run_cmd(){ echo "$@" - ${@} - EXIT_CODE=$? + EXIT_CODE=${@} if [ $EXIT_CODE -eq 2 ]; then echo "Exit code 2 encountered, regression detected, treating as success" From 9a0285345e2259eb1c41873f1ac91d9ea223fc46 Mon Sep 17 00:00:00 2001 From: Shashank Reddy Boyapally Date: Fri, 13 Sep 2024 12:47:56 -0400 Subject: [PATCH 3/4] deleted utility Signed-off-by: Shashank Reddy Boyapally --- run_check.sh | 20 -------------------- 1 file changed, 20 deletions(-) delete mode 100755 run_check.sh diff --git a/run_check.sh b/run_check.sh deleted file mode 100755 index e7bb28b..0000000 --- a/run_check.sh +++ /dev/null @@ -1,20 +0,0 @@ -#!/bin/bash - -# Function to run a command and handle specific exit codes -run_cmd(){ - echo "$@" - ${@} - EXIT_CODE=$? - - if [ $EXIT_CODE -eq 2 ]; then - echo "Exit code 2 encountered, regression detected, treating as success" - return 0 - elif [ $EXIT_CODE -eq 3 ]; then - echo "Exit code 3 encountered, not enough data" - return 0 - else - return $EXIT_CODE - fi -} - -run_cmd orion cmd --config "examples/readout-control-plane-cdv2.yaml" --hunter-analyze --output-format text --save-output-path=output.txt From 49fef762db03225c6115a4a059929de600ccc87c Mon Sep 17 00:00:00 2001 From: Shashank Reddy Boyapally Date: Fri, 13 Sep 2024 13:06:56 -0400 Subject: [PATCH 4/4] handled exit status Signed-off-by: Shashank Reddy Boyapally --- test.bats | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/test.bats b/test.bats index 2f46123..fd779e3 100644 --- a/test.bats +++ b/test.bats @@ -5,7 +5,10 @@ run_cmd(){ echo "$@" - EXIT_CODE=${@} + set +e + ${@} + EXIT_CODE=$? + set -e if [ $EXIT_CODE -eq 2 ]; then echo "Exit code 2 encountered, regression detected, treating as success"