Repository: yetus Updated Branches: refs/heads/master 8343bd0fe -> 04aefaa34
YETUS-543 Add shaded client related ITs to Hadoop exemplar personality (addendum) Signed-off-by: Andrew Wang <[email protected]> Project: http://git-wip-us.apache.org/repos/asf/yetus/repo Commit: http://git-wip-us.apache.org/repos/asf/yetus/commit/04aefaa3 Tree: http://git-wip-us.apache.org/repos/asf/yetus/tree/04aefaa3 Diff: http://git-wip-us.apache.org/repos/asf/yetus/diff/04aefaa3 Branch: refs/heads/master Commit: 04aefaa342d99ae13c0d50a786dbdae35dd69b69 Parents: 8343bd0 Author: Sean Busbey <[email protected]> Authored: Tue Sep 19 09:28:17 2017 -0500 Committer: Sean Busbey <[email protected]> Committed: Tue Sep 26 10:06:12 2017 -0500 ---------------------------------------------------------------------- precommit/personality/hadoop.sh | 67 ++++++++++++++++++------------------ 1 file changed, 33 insertions(+), 34 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/yetus/blob/04aefaa3/precommit/personality/hadoop.sh ---------------------------------------------------------------------- diff --git a/precommit/personality/hadoop.sh b/precommit/personality/hadoop.sh index ea52e40..c5c972c 100755 --- a/precommit/personality/hadoop.sh +++ b/precommit/personality/hadoop.sh @@ -38,7 +38,6 @@ function personality_globals GITHUB_REPO="apache/hadoop" #shellcheck disable=SC2034 PYLINT_OPTIONS="--indent-string=' '" - CLIENT_TESTS=() HADOOP_HOMEBREW_DIR=${HADOOP_HOMEBREW_DIR:-$(brew --prefix 2>/dev/null)} if [[ -z "${HADOOP_HOMEBREW_DIR}" ]]; then @@ -392,6 +391,7 @@ function personality_file_tests if [[ ${filename} =~ src/main/webapp ]]; then yetus_debug "tests/webapp: ${filename}" + add_test shadedclient elif [[ ${filename} =~ \.sh || ${filename} =~ \.cmd || ${filename} =~ src/scripts @@ -435,6 +435,13 @@ function personality_file_tests add_test mvninstall add_test mvnsite add_test unit + add_test shadedclient + fi + + # if we change anything in here, e.g. the test scripts + # then run the client artifact tests + if [[ ${filename} =~ hadoop-client-modules ]]; then + add_test shadedclient fi if [[ ${filename} =~ src/test ]]; then @@ -470,10 +477,29 @@ add_test_type shadedclient ## @stability evolving function shadedclient_initialize { - declare -a modules=() + maven_add_install shadedclient +} + +## @description build client facing shaded artifacts and test them +## @audience private +## @stability evolving +## @param repostatus +function shadedclient_rebuild +{ + declare repostatus=$1 + declare logfile="${PATCH_DIR}/${repostatus}-shadedclient.txt" declare module + declare -a modules=() + + if [[ ${OSTYPE} = Windows_NT || + ${OSTYPE} =~ ^CYGWIN.* || + ${OSTYPE} =~ ^MINGW32.* || + ${OSTYPE} =~ ^MSYS.* ]]; then + yetus_info "hadoop personality: building on windows, skipping check of client artifacts." + return 0 + fi - yetus_debug "hadoop personality: initializing client artifacts checks." + yetus_debug "hadoop personality: seeing if we need the test of client artifacts." for module in hadoop-client-modules/hadoop-client-check-invariants \ hadoop-client-modules/hadoop-client-check-test-invariants \ hadoop-client-modules/hadoop-client-integration-tests; do @@ -482,43 +508,16 @@ function shadedclient_initialize modules=( ${modules[@]} -pl ${module} ) fi done - if [ ${#modules[@]} -gt 0 ]; then - CLIENT_TESTS=( "${modules[@]}" ) - maven_add_install shadedclient - add_test shadedclient - fi -} - -## @description remove files created by the rebuild function -## @audience private -## @stability evolving -function shadedclient_clean -{ - if [ ${#CLIENT_TESTS[@]} -gt 0 ]; then - yetus_debug "hadoop personality: cleaning up test modules." - "${MAVEN}" "${MAVEN_ARGS[@]}" clean -fae -am "${CLIENT_TESTS[@]}" - fi -} - -## @description build client facing shaded artifacts and test them -## @audience private -## @stability evolving -## @param repostatus -function shadedclient_rebuild -{ - local repostatus=$1 - local logfile="${PATCH_DIR}/${repostatus}-shadedclient.txt" - - if [ ${#CLIENT_TESTS[@]} -eq 0 ]; then - yetus_debug "hadoop personality: no test modules present, skipping." + if [ ${#modules[@]} -eq 0 ]; then + yetus_info "hadoop personality: no test modules present, skipping check of client artifacts." return 0 fi big_console_header "Checking client artifacts on ${repostatus}" echo_and_redirect "${logfile}" \ - "${MAVEN}" "${MAVEN_ARGS[@]}" clean verify -fae --batch-mode -am \ - "${CLIENT_TESTS[@]}" \ + "${MAVEN}" "${MAVEN_ARGS[@]}" verify -fae --batch-mode -am \ + "${modules[@]}" \ -Dtest=NoUnitTests -Dmaven.javadoc.skip=true -Dcheckstyle.skip=true -Dfindbugs.skip=true count=$(${GREP} -c '\[ERROR\]' "${logfile}")
