dchenbecker commented on code in PR #1984:
URL: https://github.com/apache/cassandra/pull/1984#discussion_r1016909134
##########
.circleci/generate.sh:
##########
@@ -184,36 +194,43 @@ fi
# add new or modified tests to the sets of tests to be repeated
if (!($all)); then
- add_diff_tests ()
- {
- dir="${BASEDIR}/../${2}"
- diff=$(git --no-pager diff --name-only --diff-filter=AMR
${BASE_BRANCH}...HEAD ${dir})
- tests=$( echo "$diff" \
- | grep "Test\\.java" \
- | sed -e "s/\\.java//" \
- | sed -e "s,^${2},," \
- | tr '/' '.' \
- | grep ${3} )
- for test in $tests; do
- echo " $test"
- has_env_vars=true
- if echo "$env_vars" | grep -q "${1}="; then
- env_vars=$(echo "$env_vars" | sed -e "s/${1}=/${1}=${test},/")
- elif [ -z "$env_vars" ]; then
- env_vars="${1}=${test}"
- else
- env_vars="$env_vars|${1}=${test}"
- fi
- done
- }
+ # Sanity check that the referenced branch exists
+ if ! git show ${BASE_BRANCH} -- >&/dev/null; then
+ echo "Unknown base branch: ${BASE_BRANCH}. Skipping detection of changed
tests."
+ echo "If you wish to detect changed tests, please use the '-b' flag or set
the"
+ echo "BASE_BRANCH environment variable to an existing branch name (e.g.
origin/${BASE_BRANCH})."
Review Comment:
I don't really want it to `print_help` if the branch can't be found, since
the message already explains proper usage. I can just `exit 2` here instead.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]