Skip to content

Commit

Permalink
ci: graalvm presubmit tests focus on module modified in PR
Browse files Browse the repository at this point in the history
  • Loading branch information
burkedavison committed Mar 18, 2024
1 parent e8994c7 commit 6dcab5a
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 7 deletions.
11 changes: 4 additions & 7 deletions .kokoro/build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -66,14 +66,11 @@ case ${JOB_TYPE} in
fi
;;
graalvm-presubmit)
if [ -z "${MAVEN_MODULES}" ]; then
echo "MAVEN_MODULES not defined in environment."
exit 1
fi
printf "Running GraalVM checks for:\n%s\n" "${MAVEN_MODULES}"
setup_cloud "$MAVEN_MODULES"
generate_graalvm_presubmit_modules_list
printf "Running GraalVM presubmit checks for:\n%s\n" "${module_list}"
setup_cloud "$module_list"
install_modules
run_graalvm_tests "$MAVEN_MODULES"
run_graalvm_tests "$module_list"
;;
graalvm)
generate_graalvm_modules_list
Expand Down
20 changes: 20 additions & 0 deletions .kokoro/common.sh
Original file line number Diff line number Diff line change
Expand Up @@ -173,6 +173,26 @@ function run_graalvm_tests() {
printf "Finished Unit and Integration Tests for GraalVM:\n%s\n" "$1"
}

function generate_graalvm_presubmit_modules_list() {
modules_assigned_list=()
generate_modified_modules_list
if [[ ${#modified_module_list[@]} -gt 0 && ${#modified_module_list[@]} -lt 10 ]]; then
# If only a few modules have been modified, focus presubmit testing only on them.
module_list=$(
IFS=,
echo "${modified_module_list[*]}"
)
else
# If no modules have been modified or if too many have been modified, just test the modules
# specified in the MAVEN_MODULES env var.
if [ -z "${MAVEN_MODULES}" ]; then
echo "MAVEN_MODULES not defined in environment."
exit 1
fi
module_list=${MAVEN_MODULES}
fi
}

function generate_graalvm_modules_list() {
modules_assigned_list=()
generate_modified_modules_list
Expand Down

0 comments on commit 6dcab5a

Please sign in to comment.