summaryrefslogtreecommitdiffstats
path: root/k6-tests/ncmp/run-all-tests.sh
diff options
context:
space:
mode:
authordanielhanrahan <daniel.hanrahan@est.tech>2024-06-28 13:43:35 +0100
committerdanielhanrahan <daniel.hanrahan@est.tech>2024-07-05 12:32:58 +0100
commit4e9f68c7e11b05e82e53b3149caf8443026b5ca0 (patch)
treee80ceaed463948edb0fdb45caf88737e20d0b1d6 /k6-tests/ncmp/run-all-tests.sh
parentc1c26ec8a97ce7de7d976665ae0c147fbf9ad80d (diff)
[k6] Measure CM-handle (de)registration in CM-handles/sec
As per characteristics requirements document: - measure registration in CM-handles/second - measure deregistration in CM-handles/second - summary table includes test case number, description, units of measurement, actual value and limit. Issue-ID: CPS-2269 Signed-off-by: danielhanrahan <daniel.hanrahan@est.tech> Change-Id: I838004da1c230ab722f49c2adacf34e730d7ac79
Diffstat (limited to 'k6-tests/ncmp/run-all-tests.sh')
-rwxr-xr-xk6-tests/ncmp/run-all-tests.sh43
1 files changed, 25 insertions, 18 deletions
diff --git a/k6-tests/ncmp/run-all-tests.sh b/k6-tests/ncmp/run-all-tests.sh
index bf6370901f..2db32ecd76 100755
--- a/k6-tests/ncmp/run-all-tests.sh
+++ b/k6-tests/ncmp/run-all-tests.sh
@@ -15,29 +15,36 @@
# limitations under the License.
#
-ALL_TEST_SCRIPTS=( \
-1-create-cmhandles.js \
-2-wait-for-cmhandles-to-be-ready.js \
-10-mixed-load-test.js \
-11-delete-cmhandles.js \
-)
+pushd "$(dirname "$0")" >/dev/null || exit 1
-pushd "$(dirname "$0")" || exit 1
+number_of_failures=0
+echo "Running K6 performance tests..."
+k6 --quiet run ncmp-kpi.js > summary.csv || ((number_of_failures++))
-printf "Test Case\tCondition\tLimit\tActual\tResult\n" > summary.log
+if [ -f summary.csv ]; then
-number_of_failures=0
-for test_script in "${ALL_TEST_SCRIPTS[@]}"; do
- echo "k6 run $test_script"
- k6 --quiet run -e K6_MODULE_NAME="$test_script" "$test_script" >> summary.log || ((number_of_failures++))
-done
+ # Output raw CSV for plotting job
+ echo '-- BEGIN CSV REPORT'
+ cat summary.csv
+ echo '-- END CSV REPORT'
+ echo
+
+ # Output human-readable report
+ echo '####################################################################################################'
+ echo '## K 6 P E R F O R M A N C E T E S T R E S U L T S ##'
+ echo '####################################################################################################'
+ column -t -s, summary.csv
+ echo
+
+ # Clean up
+ rm -f summary.csv
-echo '##############################################################################################################################'
-echo '## K 6 P E R F O R M A N C E T E S T R E S U L T S ##'
-echo '##############################################################################################################################'
-awk -F$'\t' '{printf "%-40s%-50s%-20s%-10s%-6s\n", $1, $2, $3, $4, $5}' summary.log
+else
+ echo "Error: Failed to generate summary.csv" >&2
+ ((number_of_failures++))
+fi
-popd || exit 1
+popd >/dev/null || exit 1
echo "NCMP TEST FAILURES: $number_of_failures"
exit $number_of_failures