You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@fluo.apache.org by mm...@apache.org on 2022/03/14 15:31:18 UTC

[fluo-uno] branch main updated: Add --test option to copy the test jar (#279)

This is an automated email from the ASF dual-hosted git repository.

mmiller pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/fluo-uno.git


The following commit(s) were added to refs/heads/main by this push:
     new 29e09c6  Add --test option to copy the test jar (#279)
29e09c6 is described below

commit 29e09c66002151f88cd24208b6e56da16ffb3ca1
Author: Mike Miller <mm...@apache.org>
AuthorDate: Mon Mar 14 11:25:08 2022 -0400

    Add --test option to copy the test jar (#279)
---
 bin/impl/fetch.sh            |  2 ++
 bin/impl/install/accumulo.sh | 10 ++++++++++
 bin/impl/util.sh             |  6 +++---
 3 files changed, 15 insertions(+), 3 deletions(-)

diff --git a/bin/impl/fetch.sh b/bin/impl/fetch.sh
index d373906..982af50 100755
--- a/bin/impl/fetch.sh
+++ b/bin/impl/fetch.sh
@@ -55,6 +55,7 @@ EOF
       exit 1
     fi
     cp "$accumulo_built_tarball" "$DOWNLOADS"/
+    [[ $1 == '--test' ]] && cp "$ACCUMULO_REPO/test/target/accumulo-test-2.1.0-SNAPSHOT.jar" "$DOWNLOADS"/
   else
     download_apache "accumulo/$ACCUMULO_VERSION" "$ACCUMULO_TARBALL" "$ACCUMULO_HASH"
   fi
@@ -128,6 +129,7 @@ Possible components:
 
 Options:
     --no-deps  Dependencies will be fetched unless this option is specified. Only works for fluo & accumulo components.
+    --test     Copy the test jar built in accumulo to the downloads directory
 EOF
   exit 1
 esac
diff --git a/bin/impl/install/accumulo.sh b/bin/impl/install/accumulo.sh
index bb490f7..04b9a2d 100755
--- a/bin/impl/install/accumulo.sh
+++ b/bin/impl/install/accumulo.sh
@@ -18,6 +18,13 @@
 # shellcheck source=bin/impl/util.sh
 source "$UNO_HOME"/bin/impl/util.sh
 
+function install_test_jar() {
+  local test_jar_source="$DOWNLOADS/accumulo-test-$ACCUMULO_VERSION.jar"
+  local test_jar_destination="$ACCUMULO_HOME/lib"
+  print_to_console "Installing Apache Accumulo test jar $test_jar_source to $test_jar_destination"
+  cp "$test_jar_source" "$test_jar_destination"
+}
+
 pkill -f accumulo.start
 
 # stop if any command fails
@@ -35,6 +42,9 @@ mkdir -p "$ACCUMULO_LOG_DIR"
 
 tar xzf "$DOWNLOADS/$ACCUMULO_TARBALL" -C "$INSTALL"
 
+# Install test jar if available
+[[ $1 == '--test' ]] && install_test_jar
+
 conf=$ACCUMULO_HOME/conf
 
 cp "$UNO_HOME"/conf/accumulo/common/* "$conf"
diff --git a/bin/impl/util.sh b/bin/impl/util.sh
index a47af57..f5a6344 100755
--- a/bin/impl/util.sh
+++ b/bin/impl/util.sh
@@ -151,7 +151,7 @@ function download_apache() {
 
 function print_cmd_usage() {
     cat <<EOF
-Usage: uno $1 <component> [--no-deps]
+Usage: uno $1 <component> [--no-deps] [--test]
 
 Possible components:
 
@@ -161,9 +161,9 @@ Possible components:
     fluo-yarn  $2 Apache Fluo YARN and its dependencies (Fluo, Accumulo, Hadoop, & ZooKeeper)
     zookeeper  $2 Apache ZooKeeper
 
-Options:
+Options (these only work for fluo and accumulo components):
     --no-deps  Dependencies will be setup unless this option is specified.
-               Only works for fluo & accumulo components.
+    --test     Copy the test jar built in accumulo to downloads. Requires ACCUMULO_REPO
 EOF
 }