hadoop-common-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From e...@apache.org
Subject hadoop git commit: HDDS-616. Collect all the robot test outputs and return with the right exit code. Contributed by Elek, Marton.
Date Sat, 13 Oct 2018 06:58:47 GMT
Repository: hadoop
Updated Branches:
  refs/heads/ozone-0.3 cc21ce955 -> 820d1ec5d


HDDS-616. Collect all the robot test outputs and return with the right exit code. Contributed
by Elek, Marton.


Project: http://git-wip-us.apache.org/repos/asf/hadoop/repo
Commit: http://git-wip-us.apache.org/repos/asf/hadoop/commit/820d1ec5
Tree: http://git-wip-us.apache.org/repos/asf/hadoop/tree/820d1ec5
Diff: http://git-wip-us.apache.org/repos/asf/hadoop/diff/820d1ec5

Branch: refs/heads/ozone-0.3
Commit: 820d1ec5d2ff5a0fcfc2142152fbd54df4554a0b
Parents: cc21ce9
Author: Márton Elek <elek@apache.org>
Authored: Thu Oct 11 11:30:07 2018 +0200
Committer: Márton Elek <elek@apache.org>
Committed: Sat Oct 13 08:58:32 2018 +0200

----------------------------------------------------------------------
 hadoop-ozone/dist/src/main/smoketest/test.sh | 25 ++++++++++++++++++++---
 1 file changed, 22 insertions(+), 3 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/hadoop/blob/820d1ec5/hadoop-ozone/dist/src/main/smoketest/test.sh
----------------------------------------------------------------------
diff --git a/hadoop-ozone/dist/src/main/smoketest/test.sh b/hadoop-ozone/dist/src/main/smoketest/test.sh
index f3c2224..a6dc1f1 100755
--- a/hadoop-ozone/dist/src/main/smoketest/test.sh
+++ b/hadoop-ozone/dist/src/main/smoketest/test.sh
@@ -17,19 +17,35 @@
 
 set -e
 DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null && pwd )"
+RESULT_DIR=result
+#delete previous results
+rm -rf "${DIR:?}/$RESULT_DIR"
+mkdir -p "$DIR/$RESULT_DIR"
+#Should be writeable from the docker containers where user is different.
+chmod ogu+w "$DIR/$RESULT_DIR"
 
 execute_tests(){
-  COMPOSE_FILE=$DIR/../compose/$1/docker-compose.yaml
+  COMPOSE_DIR=$1
+  COMPOSE_FILE=$DIR/../compose/$COMPOSE_DIR/docker-compose.yaml
   TESTS=$2
-  echo "Executing test ${TESTS[*]} with $COMPOSE_FILE"
+  echo "-------------------------------------------------"
+  echo "Executing test(s): [${TESTS[*]}]"
+  echo ""
+  echo "  Cluster type:      $COMPOSE_DIR"
+  echo "  Compose file:      $COMPOSE_FILE"
+  echo "  Output dir:        $DIR/$RESULT_DIR"
+  echo "  Command to rerun:  ./test.sh --keep --env $COMPOSE_DIR $TESTS"
+  echo "-------------------------------------------------"
   docker-compose -f "$COMPOSE_FILE" down
   docker-compose -f "$COMPOSE_FILE" up -d
   echo "Waiting 30s for cluster start up..."
   sleep 30
   for TEST in "${TESTS[@]}"; do
+     TITLE="Ozone $TEST tests with $COMPOSE_DIR cluster"
      set +e
-     docker-compose -f "$COMPOSE_FILE" exec datanode python -m robot "smoketest/$TEST"
+     docker-compose -f "$COMPOSE_FILE" exec datanode python -m robot --log NONE --report
NONE "${OZONE_ROBOT_OPTS[@]}" --output "smoketest/$RESULT_DIR/robot-$COMPOSE_DIR-${TEST//\//_/}.xml"
--logtitle "$TITLE" --reporttitle "$TITLE" "smoketest/$TEST"
      set -e
+     docker-compose -f "$COMPOSE_FILE" logs > "$DIR/$RESULT_DIR/docker-$COMPOSE_DIR-${TEST//\//_/}.log"
   done
   if [ "$KEEP_RUNNING" = false ]; then
      docker-compose -f "$COMPOSE_FILE" down
@@ -99,3 +115,6 @@ if [ "$RUN_ALL" = true ]; then
 else
    execute_tests "$DOCKERENV" "${POSITIONAL[@]}"
 fi
+
+#Generate the combined output and return with the right exit code (note: robot = execute
test, rebot = generate output)
+docker run --rm -it -v "$DIR/..:/opt/hadoop" apache/hadoop-runner rebot -d "smoketest/$RESULT_DIR"
"smoketest/$RESULT_DIR/robot-*.xml"


---------------------------------------------------------------------
To unsubscribe, e-mail: common-commits-unsubscribe@hadoop.apache.org
For additional commands, e-mail: common-commits-help@hadoop.apache.org


Mime
View raw message