Skip to content

Commit

Permalink
fix loadtest pipeline setup script
Browse files Browse the repository at this point in the history
Signed-off-by: Moritz Wiesinger <[email protected]>
  • Loading branch information
mowies committed Jul 2, 2024
1 parent 4905cb8 commit cbc81a6
Showing 1 changed file with 10 additions and 9 deletions.
19 changes: 10 additions & 9 deletions .github/workflows/scripts/setup_e2e_tests.sh
Original file line number Diff line number Diff line change
Expand Up @@ -4,20 +4,21 @@
# SPDX-License-Identifier: Apache-2.0

TESTS="$(make -s -C testbed list-tests | xargs echo|sed 's/ /|/g')"
TESTS=("${TESTS//|/ }")
IFS='|' read -r -a TEST_ARRAY <<< "$TESTS"

MATRIX="{\"include\":["
curr=""
for i in "${!TESTS[@]}"; do
if (( i > 0 && i % 2 == 0 )); then
curr+="|${TESTS[$i]}"
else
for i in "${!TEST_ARRAY[@]}"; do
if (( i > 0 && i % 2 == 0 )); then
curr+="|${TEST_ARRAY[$i]}"
else
if [ -n "$curr" ] && (( i>1 )); then
MATRIX+=",{\"test\":\"$curr\"}"
MATRIX+=",{\"test\":\"$curr\"}"
elif [ -n "$curr" ]; then
MATRIX+="{\"test\":\"$curr\"}"
MATRIX+="{\"test\":\"$curr\"}"
fi
curr="${TESTS[$i]}"
fi
curr="${TEST_ARRAY[$i]}"
fi
done
MATRIX+=",{\"test\":\"$curr\"}]}"
echo "loadtest_matrix=$MATRIX" >> "$GITHUB_OUTPUT"

0 comments on commit cbc81a6

Please sign in to comment.