You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@geode.apache.org by sm...@apache.org on 2021/10/27 16:14:46 UTC
[geode] branch support/1.12 updated: [GEODE-9775] Add missing
utility functions.
This is an automated email from the ASF dual-hosted git repository.
smgoller pushed a commit to branch support/1.12
in repository https://gitbox.apache.org/repos/asf/geode.git
The following commit(s) were added to refs/heads/support/1.12 by this push:
new 9afdf5d [GEODE-9775] Add missing utility functions.
9afdf5d is described below
commit 9afdf5d5bee9c047b0cdbec4a00cf8f967551939
Author: Sean Goller <se...@goller.net>
AuthorDate: Wed Oct 27 09:11:57 2021 -0700
[GEODE-9775] Add missing utility functions.
---
ci/scripts/shared_utilities.sh | 44 ++++++++++++++++++++++++++++++++++++++++++
1 file changed, 44 insertions(+)
diff --git a/ci/scripts/shared_utilities.sh b/ci/scripts/shared_utilities.sh
index 7ab2822..9283986 100644
--- a/ci/scripts/shared_utilities.sh
+++ b/ci/scripts/shared_utilities.sh
@@ -76,3 +76,47 @@ get-full-version() {
(>&2 echo "Full product VERSION is ${FULL_PRODUCT_VERSION}")
echo ${FULL_PRODUCT_VERSION}
}
+
+get_geode_pr_exclusion_dirs() {
+ local exclude_dirs="ci dev-tools etc geode-book geode-docs"
+ echo "${exclude_dirs}"
+}
+
+is_source_from_pr_testable() {
+ if [[ $# -ne 2 ]]; then
+ >&2 echo "Invalid args. Try ${0} \"<repo_path>\" \"<list of exclusion dirs>\""
+ exit 1
+ fi
+ local repo_dir="${1}"
+ if [[ ! -d "${repo_dir}" ]]; then
+ # If the repo_dir does not exist, assume call from non-PR
+ return 0;
+ fi
+
+ pushd "${repo_dir}" 2>&1 >> /dev/null
+ local base_dir=$(git rev-parse --show-toplevel)
+ local github_pr_dir="${base_dir}/.git/resource"
+ pushd ${base_dir} 2>&1 >> /dev/null
+ local return_code=0
+ if [ -d "${github_pr_dir}" ]; then
+ # Modify this path list with directories to exclude
+ local exclude_dirs="${2}"
+ for d in $(echo ${exclude_dirs}); do
+ local exclude_pathspec="${exclude_pathspec} :(exclude,glob)${d}/**"
+ done
+ pushd ${base_dir} &> /dev/null
+ local files=$(git diff --name-only $(cat "${github_pr_dir}/base_sha") $(cat "${github_pr_dir}/head_sha") -- . $(echo ${exclude_pathspec}))
+ popd &> /dev/null
+ if [[ -z "${files}" ]]; then
+ >&2 echo "CI changes only, skipping tests..."
+ return_code=1
+ else
+ >&2 echo "Running PR tests..."
+ fi
+ else
+ >&2 echo "Running tests..."
+ fi
+ popd 2>&1 >> /dev/null
+ popd 2>&1 >> /dev/null
+ return ${return_code}
+}