aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKonstantin Boudnik <cos@apache.org>2016-02-09 00:20:09 -0800
committerKonstantin Boudnik <cos@apache.org>2016-02-15 10:12:46 +0300
commitabc43b8073b2c1818214ad5cbd7bbf458785f0b8 (patch)
tree95f21f8f3f165bc20bb905f1032e6a2b36ef9929
parent36fa17504bb005cafa159383128217b16a710400 (diff)
downloadbigtop-odpi-abc43b8073b2c1818214ad5cbd7bbf458785f0b8.tar.gz
BIGTOP-2319. Build initial smoke-tests distribution
-rw-r--r--bigtop-tests/build.gradle63
-rwxr-xr-xbigtop-tests/smoke-tests/run_itest.sh120
2 files changed, 183 insertions, 0 deletions
diff --git a/bigtop-tests/build.gradle b/bigtop-tests/build.gradle
new file mode 100644
index 00000000..c8180d91
--- /dev/null
+++ b/bigtop-tests/build.gradle
@@ -0,0 +1,63 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+apply plugin: 'distribution'
+
+distributions {
+ main {
+ baseName = project.hasProperty('assemblyname') ?
+ project.property('assemblyname') : 'bigtop-smokes-suite'
+ contents {
+ exclude '*.iml'
+ exclude '.gradle'
+ exclude 'build'
+ exclude 'target'
+ from ("$rootDir") {
+ include '*.bom'
+ include 'gradlew'
+ include '*.gradle'
+ include 'gradle/**'
+ }
+ from ("$rootDir/buildSrc") {
+ into 'buildSrc'
+ }
+ from ("$rootDir/bigtop-packages/src/common/bigtop-utils") {
+ into 'bin'
+ include '*'
+ }
+ from ('smoke-tests') {
+ into 'smoke-tests'
+ include '*.gradle'
+ include 'logger-test-config/**'
+ }
+ from ('smoke-tests') { // Put the driver script to the top-level
+ include 'run_itest.sh'
+ }
+ from ('test-artifacts') {
+ into 'bigtop-tests/test-artifacts'
+ include 'hadoop/**'
+ include 'mahout/**'
+ include 'pom.xml'
+ }
+ }
+ }
+}
+
+distZip.dependsOn clean
+distTar.dependsOn clean
+
diff --git a/bigtop-tests/smoke-tests/run_itest.sh b/bigtop-tests/smoke-tests/run_itest.sh
new file mode 100755
index 00000000..b5c41c24
--- /dev/null
+++ b/bigtop-tests/smoke-tests/run_itest.sh
@@ -0,0 +1,120 @@
+#!/bin/bash
+# Licensed to the Apache Software Foundation (ASF) under one or more
+# contributor license agreements. See the NOTICE file distributed with
+# this work for additional information regarding copyright ownership.
+# The ASF licenses this file to You under the Apache License, Version 2.0
+# (the "License"); you may not use this file except in compliance with
+# the License. You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+
+## Borrowed heavily from
+## https://github.com/jctanner/odp-scripts/blob/master/run_itest.sh
+## Kudos to https://github.com/jctanner
+
+# https://github.com/apache/bigtop/tree/master/bigtop-test-framework
+
+# "ITEST" is an integration testing framework written for and by the
+# apache bigtop project. It consists of typical java tools/libraries
+# such as junit, gradle and maven.
+
+# This script is a helper to run itest on any hadoop system without
+# requiring intimate knowledge of bigtop. If running for the first
+# time, simply execute ./run_itest.sh without any arguments. If you
+# want more information, use these additional parameters:
+#
+# --info - turns on the log4j output
+# --debug - turns up the log4j output to maximum
+# --traceback - shows tracebacks from tests
+
+set_java_home() {
+
+ #####################################################################
+ # Use bigtop's bigtop-detect-javahome if JAVA_HOME is not already set
+ #####################################################################
+
+ if [ -z "$JAVA_HOME" ]; then
+ source bin/bigtop-detect-javahome
+ fi
+
+ echo "# DEBUG: JAVA_HOME=$JAVA_HOME"
+}
+
+set_hadoop_vars() {
+
+ #####################################################################
+ # Set the HADOOP_MAPRED_HOME and HADOOP_CONF vars
+ #####################################################################
+
+ # ITEST wants the MR dir with the examples jar ...
+ # java.lang.AssertionError: Can't find hadoop-examples.jar file
+
+ if ( [ -z "$HADOOP_HOME" ] && [ -d /usr/lib/hadoop ] ); then
+ export HADOOP_HOME=/usr/lib/hadoop
+ fi
+ if ( [ -z "$HADOOP_CONF_DIR" ] && [ -d /etc/hadoop/conf ] ); then
+ export HADOOP_CONF_DIR=/etc/hadoop/conf
+ fi
+ if ( [ -z "$HADOOP_MAPRED_HOME" ] && [ -d /usr/lib/hadoop-mapreduce-client ] ); then
+ export HADOOP_MAPRED_HOME=/usr/lib/hadoop-mapreduce-client
+ fi
+
+ echo "# DEBUG: HADOOP_CONF_DIR=$HADOOP_CONF_DIR"
+ echo "# DEBUG: HADOOP_MAPRED_HOME=$HADOOP_MAPRED_HOME"
+}
+
+
+print_tests() {
+ echo "######################################################"
+ echo "# RESULTS #"
+ echo "######################################################"
+
+ for TEST in $(echo $ITESTS | tr ',' '\n'); do
+ TESTDIR=bigtop-tests/smoke-tests/$TEST/build
+
+ if [ -d $TESTDIR ]; then
+ cd $TESTDIR
+
+ for FILE in $(find -L reports/tests/classes -type f -name "*.html"); do
+ echo "## $TESTDIR/$FILE"
+ if [ $(which links) ]; then
+ links $FILE -dump
+ else
+ echo "PLEASE INSTALL LINKS: sudo yum -y install links"
+ fi
+ echo ""
+ done
+ fi
+ done
+}
+
+# SET JAVA_HOME
+set_java_home
+
+# SET HADOOP SERVICE HOMES
+set_hadoop_vars
+
+echo "######################################################"
+echo "# STARTING ITEST #"
+echo "######################################################"
+echo "# Use --debug/--info/--stacktrace for more details"
+
+# SET THE DEFAULT TESTS
+if [ -z "$ITESTS" ]; then
+ export ITESTS="hcfs,hdfs,yarn,mapreduce"
+fi
+for s in `echo $ITESTS | sed -e 's#,# #g'`; do
+ ALL_SMOKE_TASKS="$ALL_SMOKE_TASKS bigtop-tests:smoke-tests:$s:test"
+done
+
+# CALL THE GRADLE WRAPPER TO RUN THE FRAMEWORK
+./gradlew -q clean test -Psmoke.tests $ALL_SMOKE_TASKS $@
+
+# SHOW RESULTS (HTML)
+print_tests