Skip to content

Commit 963096c

Browse files
committed
Merge branch '3.0.x'
2 parents 3a4aec8 + 6524843 commit 963096c

File tree

2 files changed

+23
-8
lines changed

2 files changed

+23
-8
lines changed

.github/workflows/composites/run-and-save-test-times-when-cache-present/action.yaml

Lines changed: 22 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,7 @@ runs:
9090
max_test_time_as_int=$(printf "%.0f\n" "$max_test_time")
9191
echo "max test time : $max_test_time_as_int"
9292

93-
number_of_instances=$(( $sum_of_all_tests_as_int / $max_test_time_as_int ))
93+
number_of_instances=${NUMBER_OF_JOBS}
9494
echo "number of instances $number_of_instances"
9595

9696
average_time_per_instance=$(( sum_of_all_tests_as_int / number_of_instances ))
@@ -133,6 +133,15 @@ runs:
133133
echo "current index : ${CURRENT_INDEX}"
134134
tests_to_run_in_current_index=$tests_to_take_in_current_iteration
135135
echo "time of tests in current index : $sum"
136+
137+
# this can be the case when we delete some tests in some PR for example
138+
# the previous cache will contain more tests then we currently have, so some
139+
# matrix instances will have no tests to run
140+
if [[ "$sum" -eq "0" ]]; then
141+
echo "no tests to run in current index, most probably this PR removed some tests"
142+
tests_to_run_in_current_index='none'
143+
fi
144+
136145
fi
137146

138147
done
@@ -188,13 +197,18 @@ runs:
188197
unset IFS
189198

190199
for i in "${sliced_array[@]}"; do
191-
filename="${i}.txt"
192-
echo "searching for filename: ${filename}"
193-
file=$(find . -name "${filename}")
194-
echo "found file: ${file}"
195-
result=$(cat "${file}" | grep 'elapsed' | awk '{print $12, $13}')
196-
197-
echo "run test: ${i} in : ${result}" >> /tmp/test_times_${{ env.CURRENT_INDEX }}.txt
200+
201+
# can be present in the last index as 'none,testA,testB'
202+
if [[ "$i" -eq "none" ]]; then
203+
echo "skipping 'none'"
204+
else
205+
filename="${i}.txt"
206+
echo "searching for filename: ${filename}"
207+
file=$(find . -name "${filename}")
208+
echo "found file: ${file}"
209+
result=$(cat "${file}" | grep 'elapsed' | awk '{print $12, $13}')
210+
echo "run test: ${i} in : ${result}" >> /tmp/test_times_${{ env.CURRENT_INDEX }}.txt
211+
fi
198212
done
199213
fi
200214

.github/workflows/maven.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -123,6 +123,7 @@ jobs:
123123
SEGMENT_DOWNLOAD_TIMEOUT_MINS: 30
124124
# only run this one if there is a previous cache of test times
125125
if: needs.build.outputs.test_times_cache_present == 'true'
126+
timeout-minutes: 60
126127

127128
strategy:
128129
fail-fast: true

0 commit comments

Comments
 (0)