diff options
author | halil.cakal <halil.cakal@est.tech> | 2024-11-06 15:05:22 +0000 |
---|---|---|
committer | halil.cakal <halil.cakal@est.tech> | 2024-11-18 12:24:04 +0000 |
commit | b685df03750be0ee1b9c55632dceedb7dbf4961a (patch) | |
tree | 1e2daa9df4c0ea4503e1b29230d4a960144b58e4 /k6-tests/ncmp/run-all-tests.sh | |
parent | 37962e3faca4f2306546c4f70d480b0c323d2c68 (diff) |
Add new k6 test profile for running edurance tests
- assign a profile name to the existing k6 tests (kpi)
- add control which profile is run using k6 config file
- both test profiles can run in parallel
Issue-ID: CPS-2464
Change-Id: I9fea13f12e2da46bd55b4315c68209843c1abe06
Signed-off-by: halil.cakal <halil.cakal@est.tech>
Diffstat (limited to 'k6-tests/ncmp/run-all-tests.sh')
-rwxr-xr-x | k6-tests/ncmp/run-all-tests.sh | 31 |
1 files changed, 18 insertions, 13 deletions
diff --git a/k6-tests/ncmp/run-all-tests.sh b/k6-tests/ncmp/run-all-tests.sh index 1fa661a472..3457903c01 100755 --- a/k6-tests/ncmp/run-all-tests.sh +++ b/k6-tests/ncmp/run-all-tests.sh @@ -18,31 +18,36 @@ pushd "$(dirname "$0")" >/dev/null || exit 1 number_of_failures=0 -echo "Running K6 performance tests..." +testProfile=$1 +summaryFile="${testProfile}Summary.csv" -# Redirecting stderr to /dev/null to prevent large log files -k6 --quiet run ncmp-kpi.js > summary.csv 2>/dev/null || ((number_of_failures++)) +echo "Running $testProfile performance tests..." +k6 run ncmp-kpi.js --quiet -e TEST_PROFILE="$testProfile" > "$summaryFile" 2>/dev/null || ((number_of_failures++)) -if [ -f summary.csv ]; then +if [ -f "$summaryFile" ]; then # Output raw CSV for plotting job - echo '-- BEGIN CSV REPORT' - cat summary.csv - echo '-- END CSV REPORT' + echo "-- BEGIN CSV REPORT" + cat "$summaryFile" + 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 "####################################################################################################" + if [ "$testProfile" = "kpi" ]; then + echo "## K 6 K P I P E R F O R M A N C E T E S T R E S U L T S ##" + else + echo "## K 6 E N D U R A N C E P E R F O R M A N C E T E S T R E S U L T S ##" + fi + echo "####################################################################################################" + column -t -s, "$summaryFile" echo # Clean up - rm -f summary.csv + rm -f "$summaryFile" else - echo "Error: Failed to generate summary.csv" >&2 + echo "Error: Failed to generate $summaryFile" >&2 ((number_of_failures++)) fi |