From 880e18af4d1bc2a299b406015aa2f38c1fb1d16b Mon Sep 17 00:00:00 2001 From: buildmaster Date: Mon, 17 Jul 2023 22:06:54 +0000 Subject: [PATCH 1/2] Bumping versions --- .../tests/commons/junit_extension/DisabledTestsCondition.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/spring-cloud-kubernetes-test-support/src/main/java/org/springframework/cloud/kubernetes/tests/commons/junit_extension/DisabledTestsCondition.java b/spring-cloud-kubernetes-test-support/src/main/java/org/springframework/cloud/kubernetes/tests/commons/junit_extension/DisabledTestsCondition.java index 50a1de9902..bbfaff1d5f 100644 --- a/spring-cloud-kubernetes-test-support/src/main/java/org/springframework/cloud/kubernetes/tests/commons/junit_extension/DisabledTestsCondition.java +++ b/spring-cloud-kubernetes-test-support/src/main/java/org/springframework/cloud/kubernetes/tests/commons/junit_extension/DisabledTestsCondition.java @@ -40,8 +40,8 @@ public class DisabledTestsCondition implements ExecutionCondition { @Override public ConditionEvaluationResult evaluateExecutionCondition(ExtensionContext extensionContext) { if ("true".equals(System.getProperty("spring.cloud.k8s.skip.tests"))) { - System.out.println("\nspring.cloud.k8s.test.to.run -> " - + extensionContext.getRequiredTestClass().getName() + " \n"); + System.out.println( + "\nspring.cloud.k8s.test.to.run -> " + extensionContext.getRequiredTestClass().getName() + " \n"); return ConditionEvaluationResult.disabled(""); } else { From 6524843765988027ce34f37dba73c71a01b82d4a Mon Sep 17 00:00:00 2001 From: erabii Date: Tue, 18 Jul 2023 22:02:47 +0300 Subject: [PATCH 2/2] Fix issue with balanced tests (#1384) --- .../action.yaml | 30 ++++++++++++++----- .github/workflows/maven.yaml | 1 + 2 files changed, 23 insertions(+), 8 deletions(-) diff --git a/.github/workflows/composites/run-and-save-test-times-when-cache-present/action.yaml b/.github/workflows/composites/run-and-save-test-times-when-cache-present/action.yaml index 13414b2905..4093ab1aee 100644 --- a/.github/workflows/composites/run-and-save-test-times-when-cache-present/action.yaml +++ b/.github/workflows/composites/run-and-save-test-times-when-cache-present/action.yaml @@ -90,7 +90,7 @@ runs: max_test_time_as_int=$(printf "%.0f\n" "$max_test_time") echo "max test time : $max_test_time_as_int" - number_of_instances=$(( $sum_of_all_tests_as_int / $max_test_time_as_int )) + number_of_instances=${NUMBER_OF_JOBS} echo "number of instances $number_of_instances" average_time_per_instance=$(( sum_of_all_tests_as_int / number_of_instances )) @@ -133,6 +133,15 @@ runs: echo "current index : ${CURRENT_INDEX}" tests_to_run_in_current_index=$tests_to_take_in_current_iteration echo "time of tests in current index : $sum" + + # this can be the case when we delete some tests in some PR for example + # the previous cache will contain more tests then we currently have, so some + # matrix instances will have no tests to run + if [[ "$sum" -eq "0" ]]; then + echo "no tests to run in current index, most probably this PR removed some tests" + tests_to_run_in_current_index='none' + fi + fi done @@ -188,13 +197,18 @@ runs: unset IFS for i in "${sliced_array[@]}"; do - filename="${i}.txt" - echo "searching for filename: ${filename}" - file=$(find . -name "${filename}") - echo "found file: ${file}" - result=$(cat "${file}" | grep 'elapsed' | awk '{print $12, $13}') - - echo "run test: ${i} in : ${result}" >> /tmp/test_times_${{ env.CURRENT_INDEX }}.txt + + # can be present in the last index as 'none,testA,testB' + if [[ "$i" -eq "none" ]]; then + echo "skipping 'none'" + else + filename="${i}.txt" + echo "searching for filename: ${filename}" + file=$(find . -name "${filename}") + echo "found file: ${file}" + result=$(cat "${file}" | grep 'elapsed' | awk '{print $12, $13}') + echo "run test: ${i} in : ${result}" >> /tmp/test_times_${{ env.CURRENT_INDEX }}.txt + fi done fi diff --git a/.github/workflows/maven.yaml b/.github/workflows/maven.yaml index b9fd2b508e..65802dcf54 100644 --- a/.github/workflows/maven.yaml +++ b/.github/workflows/maven.yaml @@ -123,6 +123,7 @@ jobs: SEGMENT_DOWNLOAD_TIMEOUT_MINS: 30 # only run this one if there is a previous cache of test times if: needs.build.outputs.test_times_cache_present == 'true' + timeout-minutes: 60 strategy: fail-fast: true