You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@hbase.apache.org by bu...@apache.org on 2018/04/09 15:41:38 UTC
[7/7] hbase git commit: HBASE-15466 test personality should recognize
docs-only patch.
HBASE-15466 test personality should recognize docs-only patch.
* add a new test to build the refguide specifically instead of site
* check for changes to src/main/asciidoc or src/main/xslt and run that test and only that test
* check for changes to the hbase-default.xml file and build the refguide if found (but maybe other tests too)
* fallback to relying on the yetus default for other changes
* fix some missing start_clock entries that cause longer-than-actual reported test time.
Signed-off-by: Mike Drob <md...@apache.org>
Project: http://git-wip-us.apache.org/repos/asf/hbase/repo
Commit: http://git-wip-us.apache.org/repos/asf/hbase/commit/43c130b1
Tree: http://git-wip-us.apache.org/repos/asf/hbase/tree/43c130b1
Diff: http://git-wip-us.apache.org/repos/asf/hbase/diff/43c130b1
Branch: refs/heads/branch-1.2
Commit: 43c130b13d17b73c628f15869d02275a1e078bd1
Parents: 8eac32f
Author: Sean Busbey <bu...@apache.org>
Authored: Thu Apr 5 15:22:41 2018 -0500
Committer: Sean Busbey <bu...@apache.org>
Committed: Mon Apr 9 10:40:56 2018 -0500
----------------------------------------------------------------------
dev-support/hbase-personality.sh | 92 +++++++++++++++++++++++++++++++++++
1 file changed, 92 insertions(+)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/hbase/blob/43c130b1/dev-support/hbase-personality.sh
----------------------------------------------------------------------
diff --git a/dev-support/hbase-personality.sh b/dev-support/hbase-personality.sh
index ddf9dee..23a834c 100755
--- a/dev-support/hbase-personality.sh
+++ b/dev-support/hbase-personality.sh
@@ -176,6 +176,26 @@ function personality_modules
done
}
+## @description places where we override the built in assumptions about what tests to run
+## @audience private
+## @stability evolving
+## @param filename of changed file
+function personality_file_tests
+{
+ local filename=$1
+ # If the change is to the refguide, then we don't need any builtin yetus tests
+ # the refguide test (below) will suffice for coverage.
+ if [[ ${filename} =~ src/main/asciidoc ]] ||
+ [[ ${filename} =~ src/main/xslt ]]; then
+ yetus_debug "Skipping builtin yetus checks for ${filename}. refguide test should pick it up."
+ # fallback to checking which tests based on what yetus would do by default
+ elif declare -f "${BUILDTOOL}_builtin_personality_file_tests" >/dev/null; then
+ "${BUILDTOOL}_builtin_personality_file_tests" "${filename}"
+ elif declare -f builtin_personality_file_tests >/dev/null; then
+ builtin_personality_file_tests "${filename}"
+ fi
+}
+
## @description Uses relevant include/exclude env variable to fetch list of included/excluded
# tests and sets given variable to arguments to be passes to maven command.
## @audience private
@@ -221,6 +241,74 @@ function get_include_exclude_tests_arg
###################################################
+add_test_type refguide
+
+function refguide_initialize
+{
+ maven_add_install refguide
+}
+
+function refguide_filefilter
+{
+ local filename=$1
+
+ if [[ ${filename} =~ src/main/asciidoc ]] ||
+ [[ ${filename} =~ src/main/xslt ]] ||
+ [[ ${filename} =~ hbase-common/src/main/resources/hbase-default.xml ]]; then
+ add_test refguide
+ fi
+}
+
+function refguide_rebuild
+{
+ local repostatus=$1
+ local logfile="${PATCH_DIR}/${repostatus}-refguide.log"
+ declare -i count
+
+ if ! verify_needed_test refguide; then
+ return 0
+ fi
+
+ big_console_header "Checking we can create the ref guide on ${repostatus}"
+
+ start_clock
+
+ echo_and_redirect "${logfile}" \
+ "${MAVEN}" "${MAVEN_ARGS[@]}" clean site --batch-mode \
+ -pl . \
+ -Dtest=NoUnitTests -DHBasePatchProcess -Prelease \
+ -Dmaven.javadoc.skip=true -Dcheckstyle.skip=true -Dfindbugs.skip=true
+
+ count=$(${GREP} -c '\[ERROR\]' "${logfile}")
+ if [[ ${count} -gt 0 ]]; then
+ add_vote_table -1 refguide "${repostatus} has ${count} errors when building the reference guide."
+ add_footer_table refguide "@@BASE@@/${repostatus}-refguide.log"
+ return 1
+ fi
+
+ if ! mv target/site "${PATCH_DIR}/${repostatus}-site"; then
+ add_vote_table -1 refguide "${repostatus} failed to produce a site directory."
+ add_footer_table refguide "@@BASE@@/${repostatus}-refguide.log"
+ return 1
+ fi
+
+ if [[ ! -f "${PATCH_DIR}/${repostatus}-site/book.html" ]]; then
+ add_vote_table -1 refguide "${repostatus} failed to produce the html version of the reference guide."
+ add_footer_table refguide "@@BASE@@/${repostatus}-refguide.log"
+ return 1
+ fi
+
+ if [[ ! -f "${PATCH_DIR}/${repostatus}-site/apache_hbase_reference_guide.pdf" ]]; then
+ add_vote_table -1 refguide "${repostatus} failed to produce the pdf version of the reference guide."
+ add_footer_table refguide "@@BASE@@/${repostatus}-refguide.log"
+ return 1
+ fi
+
+ add_vote_table 0 refguide "${repostatus} has no errors when building the reference guide. See footer for rendered docs, which you should manually inspect."
+ add_footer_table refguide "@@BASE@@/${repostatus}-site/book.html"
+ return 0
+}
+
add_test_type shadedjars
@@ -258,6 +346,8 @@ function shadedjars_rebuild
big_console_header "Checking shaded client builds on ${repostatus}"
+ start_clock
+
echo_and_redirect "${logfile}" \
"${MAVEN}" "${MAVEN_ARGS[@]}" clean verify -fae --batch-mode \
-pl hbase-shaded/hbase-shaded-check-invariants -am \
@@ -339,6 +429,8 @@ function hadoopcheck_rebuild
big_console_header "Compiling against various Hadoop versions"
+ start_clock
+
# All supported Hadoop versions that we want to test the compilation with
# See the Hadoop section on prereqs in the HBase Reference Guide
hbase_common_hadoop2_versions="2.6.1 2.6.2 2.6.3 2.6.4 2.6.5 2.7.1 2.7.2 2.7.3 2.7.4"