Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[chore] Fix loadtest setup script #33860

Merged
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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"