From 4e9f68c7e11b05e82e53b3149caf8443026b5ca0 Mon Sep 17 00:00:00 2001 From: danielhanrahan Date: Fri, 28 Jun 2024 13:43:35 +0100 Subject: [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 Change-Id: I838004da1c230ab722f49c2adacf34e730d7ac79 --- k6-tests/ncmp/run-all-tests.sh | 43 ++++++++++++++++++++++++------------------ 1 file changed, 25 insertions(+), 18 deletions(-) (limited to 'k6-tests/ncmp/run-all-tests.sh') 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 -- cgit 1.2.3-korg