HBASE-20162 [nightly] depending on pipeline execution we sometimes refer to the wrong...
[hbase.git] / dev-support / hbase_nightly_yetus.sh
blob4e0200d6fdd8fdc43c438b38402c0a666a34445f
1 #!/usr/bin/env bash
2 # Licensed to the Apache Software Foundation (ASF) under one
3 # or more contributor license agreements. See the NOTICE file
4 # distributed with this work for additional information
5 # regarding copyright ownership. The ASF licenses this file
6 # to you under the Apache License, Version 2.0 (the
7 # "License"); you may not use this file except in compliance
8 # with the License. You may obtain a copy of the License at
10 # http://www.apache.org/licenses/LICENSE-2.0
12 # Unless required by applicable law or agreed to in writing,
13 # software distributed under the License is distributed on an
14 # "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
15 # KIND, either express or implied. See the License for the
16 # specific language governing permissions and limitations
17 # under the License.
19 declare -i missing_env=0
20 # Validate params
21 for required_env in "TESTS" "PERSONALITY_FILE" "BASEDIR" "ARCHIVE_PATTERN_LIST" "OUTPUT_DIR_RELATIVE" \
22 "OUTPUT_DIR" "PROJECT" "AUTHOR_IGNORE_LIST" \
23 "WHITESPACE_IGNORE_LIST" "BRANCH_NAME" "TESTS_FILTER" "DEBUG" \
24 "USE_YETUS_PRERELEASE" "WORKSPACE" "YETUS_RELEASE"; do
25 if [ -z "${!required_env}" ]; then
26 echo "[ERROR] Required environment variable '${required_env}' is not set."
27 missing_env=${missing_env}+1
29 done
31 if [ ${missing_env} -gt 0 ]; then
32 echo "[ERROR] Please set the required environment variables before invoking. If this error is " \
33 "on Jenkins, then please file a JIRA about the error."
34 exit 1
37 YETUS_ARGS=()
38 if [[ -n "${MULTIJDK}" ]]; then
39 YETUS_ARGS=("--multijdktests=compile,javadoc" "${YETUS_ARGS[@]}")
40 YETUS_ARGS=("--multijdkdirs=${MULTIJDK}" "${YETUS_ARGS[@]}")
43 if [[ -n "${SET_JAVA_HOME}" ]]; then
44 YETUS_ARGS=("--java-home=${SET_JAVA_HOME}" "${YETUS_ARGS[@]}")
46 YETUS_ARGS=("--plugins=${TESTS}" "${YETUS_ARGS[@]}")
47 YETUS_ARGS=("--personality=${PERSONALITY_FILE}" "${YETUS_ARGS[@]}")
48 YETUS_ARGS=("--basedir=${BASEDIR}" "${YETUS_ARGS[@]}")
49 YETUS_ARGS=("--archive-list=${ARCHIVE_PATTERN_LIST}" "${YETUS_ARGS[@]}")
50 YETUS_ARGS=("--console-urls" "${YETUS_ARGS[@]}")
51 # YETUS-532, repeat this twice in case the fix is to update args rather than docs
52 YETUS_ARGS=("--build-url-patchdir=artifact/${OUTPUT_DIR_RELATIVE}" "${YETUS_ARGS[@]}")
53 YETUS_ARGS=("--build-url-artifacts=artifact/${OUTPUT_DIR_RELATIVE}" "${YETUS_ARGS[@]}")
54 YETUS_ARGS=("--docker" "${YETUS_ARGS[@]}")
55 YETUS_ARGS=("--dockerfile=${BASEDIR}/dev-support/docker/Dockerfile" "${YETUS_ARGS[@]}")
56 # Yetus sets BUILDMODE env variable to "full" if this arg is passed.
57 YETUS_ARGS=("--empty-patch" "${YETUS_ARGS[@]}")
58 YETUS_ARGS=("--html-report-file=${OUTPUT_DIR}/console-report.html" "${YETUS_ARGS[@]}")
59 YETUS_ARGS=("--jenkins" "${YETUS_ARGS[@]}")
60 YETUS_ARGS=("--mvn-custom-repos" "${YETUS_ARGS[@]}")
61 YETUS_ARGS=("--patch-dir=${OUTPUT_DIR}" "${YETUS_ARGS[@]}")
62 YETUS_ARGS=("--project=${PROJECT}" "${YETUS_ARGS[@]}")
63 YETUS_ARGS=("--resetrepo" "${YETUS_ARGS[@]}")
64 YETUS_ARGS=("--author-ignore-list=${AUTHOR_IGNORE_LIST}" "${YETUS_ARGS[@]}")
65 YETUS_ARGS=("--whitespace-eol-ignore-list=${WHITESPACE_IGNORE_LIST}" "${YETUS_ARGS[@]}")
66 YETUS_ARGS=("--whitespace-tabs-ignore-list=${WHITESPACE_IGNORE_LIST}" "${YETUS_ARGS[@]}")
67 YETUS_ARGS=("--sentinel" "${YETUS_ARGS[@]}")
68 YETUS_ARGS=("--branch=${BRANCH_NAME}" "${YETUS_ARGS[@]}")
69 YETUS_ARGS=("--tests-filter=${TESTS_FILTER}" "${YETUS_ARGS[@]}")
70 # Why are these not being picked up from hbase-personality?
71 YETUS_ARGS=("--proclimit=10000" "${YETUS_ARGS[@]}")
72 YETUS_ARGS=("--dockermemlimit=20g" "${YETUS_ARGS[@]}")
74 # Currently, flaky list is calculated only for master branch.
75 UNDERSCORED_BRANCH_NAME=$(echo ${BRANCH_NAME} | tr '.-' '_')
76 EXCLUDE_TESTS_URL=$(eval echo "\$EXCLUDE_TESTS_URL_${UNDERSCORED_BRANCH_NAME}")
77 INCLUDE_TESTS_URL=$(eval echo "\$INCLUDE_TESTS_URL_${UNDERSCORED_BRANCH_NAME}")
78 if [[ -n "${EXCLUDE_TESTS_URL}" ]]; then
79 YETUS_ARGS=("--exclude-tests-url=${EXCLUDE_TESTS_URL}" "${YETUS_ARGS[@]}")
81 if [[ -n "${INCLUDE_TESTS_URL}" ]]; then
82 YETUS_ARGS=("--include-tests-url=${INCLUDE_TESTS_URL}" "${YETUS_ARGS[@]}")
85 # For testing with specific hadoop version. Activates corresponding profile in maven runs.
86 if [[ -n "${HADOOP_PROFILE}" ]]; then
87 YETUS_ARGS=("--hadoop-profile=${HADOOP_PROFILE}" "${YETUS_ARGS[@]}")
90 if [[ true == "${DEBUG}" ]]; then
91 YETUS_ARGS=("--debug" "${YETUS_ARGS[@]}")
94 rm -rf "${OUTPUT_DIR}"
95 mkdir -p "${OUTPUT_DIR}"
96 if [[ true != "${USE_YETUS_PRERELEASE}" ]]; then
97 YETUS_ARGS=("--shelldocs=${WORKSPACE}/yetus-${YETUS_RELEASE}/bin/shelldocs" "${YETUS_ARGS[@]}")
98 TESTPATCHBIN="${WORKSPACE}/yetus-${YETUS_RELEASE}/bin/test-patch"
99 else
100 YETUS_ARGS=("--shelldocs=${WORKSPACE}/yetus-git/shelldocs/shelldocs.py" "${YETUS_ARGS[@]}")
101 TESTPATCHBIN="${WORKSPACE}/yetus-git/precommit/test-patch.sh"
103 echo "Launching yetus with command line:"
104 echo "${TESTPATCHBIN} ${YETUS_ARGS[*]}"
106 /usr/bin/env bash "${TESTPATCHBIN}" "${YETUS_ARGS[@]}"