Skip to content

Commit 490ce6a

Browse files
committed
update system test execution
1 parent dd808c0 commit 490ce6a

2 files changed

Lines changed: 32 additions & 4 deletions

File tree

.kokoro/system-single.sh

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,4 +32,17 @@ NOX_FILE_ARG=""
3232

3333
[[ -z "${NOX_FILE}" ]] || NOX_FILE_ARG="-f ${NOX_FILE}"
3434

35-
python3 -m nox ${NOX_SESSION_ARG} $NOX_FILE_ARG
35+
python3 -m pip install uv
36+
for attempt in 1 2 3; do
37+
echo "Execution attempt $attempt of 3..."
38+
if uvx --with 'nox[uv]' nox ${NOX_SESSION_ARG} $NOX_FILE_ARG; then
39+
echo "Tests passed successfully!"
40+
exit 0
41+
fi
42+
43+
echo "Tests failed. Backing off for 15 seconds..."
44+
sleep 15
45+
done
46+
47+
echo "Tests failed after 3 attempts. Hard failure."
48+
exit 1

.kokoro/system.sh

Lines changed: 18 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -115,6 +115,8 @@ system_test_script="${PROJECT_ROOT}/.kokoro/system-single.sh"
115115
packages_with_system_tests_pattern=$(printf "|*%s*" "${packages_with_system_tests[@]}")
116116
packages_with_system_tests_pattern="${packages_with_system_tests_pattern:1}" # Remove the leading pipe
117117

118+
declare -A pids
119+
118120
# Run system tests for each package with directory packages/*/tests/system
119121
for path in `find 'packages' \
120122
\( -type d -wholename 'packages/*/tests/system' \) -o \
@@ -140,10 +142,23 @@ for path in `find 'packages' \
140142
set -e
141143

142144
if [[ "${package_modified}" -gt 0 ]]; then
143-
# Call the function - its internal exports won't affect the next loop
144-
run_package_test "$package_name" || RETVAL=$?
145+
echo "Dispatching ${package_name} in the background..."
146+
run_package_test "$package_name" &
147+
pids["$package_name"]=$!
145148
else
146149
echo "No changes in ${package_name}, skipping."
147150
fi
148151
done
149-
exit ${RETVAL}
152+
153+
echo "============================================================"
154+
echo "Waiting for all concurrent system tests to complete..."
155+
echo "============================================================"
156+
157+
for package in "${!pids[@]}"; do
158+
wait ${pids[$package]} || {
159+
echo "ERROR: System tests failed for $package"
160+
RETVAL=1
161+
}
162+
done
163+
164+
exit ${RETVAL}

0 commit comments

Comments
 (0)