Repository: incubator-ratis
Updated Branches:
  refs/heads/master dfeb671f0 -> 543ee0eb8


RATIS-147. Add a script to run a single test repeatedly. Contributed by Tsz Wo 
Nicholas Sze.


Project: http://git-wip-us.apache.org/repos/asf/incubator-ratis/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-ratis/commit/543ee0eb
Tree: http://git-wip-us.apache.org/repos/asf/incubator-ratis/tree/543ee0eb
Diff: http://git-wip-us.apache.org/repos/asf/incubator-ratis/diff/543ee0eb

Branch: refs/heads/master
Commit: 543ee0eb8db6eac663274be8d3c0a9dd054e65cf
Parents: dfeb671
Author: Chen Liang <[email protected]>
Authored: Mon Nov 20 13:53:43 2017 -0800
Committer: Chen Liang <[email protected]>
Committed: Mon Nov 20 13:53:43 2017 -0800

----------------------------------------------------------------------
 dev-support/run-test-repeatedly.sh | 43 +++++++++++++++++++++++++++++++++
 1 file changed, 43 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-ratis/blob/543ee0eb/dev-support/run-test-repeatedly.sh
----------------------------------------------------------------------
diff --git a/dev-support/run-test-repeatedly.sh 
b/dev-support/run-test-repeatedly.sh
new file mode 100755
index 0000000..2a666a9
--- /dev/null
+++ b/dev-support/run-test-repeatedly.sh
@@ -0,0 +1,43 @@
+#!/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.
+
+if [ $# -ne 1 ] ; then
+  echo "Usage: $0 <TEST_PATTERN>"
+  echo
+  echo "TEST_PATTERN is something like TestRaftStream or 
TestRaftStream#testSimpleWrite"
+  exit 1
+fi
+
+TEST_PATTERN=$1
+TEST_NAME=`echo ${TEST_PATTERN} | cut -d# -f 1`
+
+MVN="mvn"
+set -ex
+
+for i in `seq 1 99`;
+do
+  OUTDIR=${TEST_NAME}.${i}
+  OUTF=${OUTDIR}/${OUTDIR}.txt
+  mkdir ${OUTDIR}
+  echo
+  echo Running ${OUTDIR}
+  echo
+  time ${MVN} test -DskipShade -Dtest=${TEST_PATTERN} 2>&1 | tee ${OUTF}
+
+  find */target/surefire-reports/ -name \*${TEST_NAME}\* | xargs -I{} cp {} 
${OUTDIR}
+
+  grep -e "BUILD SUCCESS" ${OUTF}
+done

Reply via email to