You are viewing a plain text version of this content. The canonical link for it is here.
Posted to pr@cassandra.apache.org by GitBox <gi...@apache.org> on 2021/05/06 14:11:51 UTC
[GitHub] [cassandra] ekaterinadimitrova2 commented on a change in pull request #988: CASSANDRA-16625 (trunk): Add a CircleCI job to run some tests repeatedly
ekaterinadimitrova2 commented on a change in pull request #988:
URL: https://github.com/apache/cassandra/pull/988#discussion_r626997692
##########
File path: .circleci/generate.sh
##########
@@ -19,17 +19,22 @@
BASEDIR=`dirname $0`
-circleci config process $BASEDIR/config-2_1.yml > $BASEDIR/config.yml.LOWRES
+# setup lowres
+circleci config process $BASEDIR/config-2_1.yml > $BASEDIR/config.yml.LOWRES.tmp
+cat $BASEDIR/license.yml $BASEDIR/config.yml.LOWRES.tmp > $BASEDIR/config.yml.LOWRES
Review comment:
Good catch, thanks!
##########
File path: .circleci/readme.md
##########
@@ -51,5 +53,7 @@ HIGHRES files, read below for details how to do it manually;
the patch file based on the diff (don't commit it though).
1. generate the HIGHRES file:
`circleci config process config-2_1.yml.HIGHRES > config.yml.HIGHRES`
+1. add the Apache license header to the newly created LOWRES file:
+ `cat license.yml config.yml.HIGHRES > config.yml.HIGHRES.new && mv config.yml.HIGHRES.new config.yml.HIGHRES`
1. and remove the temporary patched HIGHRES file: `rm config-2_1.yml.HIGHRES`
Review comment:
I was wondering can we add a comment the same steps apply for MIDRES, I thought I added it already before but seems I missed it. :( It seems obvious, but let's think for someone new, to remind them not to miss the MIDRES one to update it. WDYT?
##########
File path: .circleci/config-2_1.yml
##########
@@ -1102,3 +1203,164 @@ commands:
- store_artifacts:
path: ~/cassandra-dtest/logs
destination: dtest_<<parameters.file_tag>>_logs
+
+ run_repeated_utest:
+ steps:
+ - run:
+ name: Run repeated utest
+ no_output_timeout: 15m
+ command: |
+ if [ "$REPEATED_UTEST_CLASS" == "<nil>" ]; then
+ echo "Repeated utest class name hasn't been defined, exiting without running any test"
+ elif [ "$REPEATED_UTEST_COUNT" == "<nil>" ]; then
+ echo "Repeated utest count hasn't been defined, exiting without running any test"
+ elif [ "$REPEATED_UTEST_COUNT" -le 0 ]; then
+ echo "Repeated utest count is lesser or equals than zero, exiting without running any test"
+ else
+
+ # Calculate the number of test iterations to be run by the current parallel runner.
+ # Since we are running the same test multiple times there is no need to use `circleci tests split`.
+ count=$((REPEATED_UTEST_COUNT / CIRCLE_NODE_TOTAL))
+ if (($CIRCLE_NODE_INDEX < (REPEATED_UTEST_COUNT % CIRCLE_NODE_TOTAL))); then
+ count=$((count+1))
+ fi
+
+ if (($count <= 0)); then
+ echo "No tests to run in this runner"
+ else
+ echo "Running $REPEATED_UTEST_TARGET $REPEATED_UTEST_CLASS $REPEATED_UTEST_METHODS $count times"
+
+ set -x
+ export PATH=$JAVA_HOME/bin:$PATH
+ time mv ~/cassandra /tmp
+ cd /tmp/cassandra
+ if [ -d ~/dtest_jars ]; then
+ cp ~/dtest_jars/dtest* /tmp/cassandra/build/
+ fi
+
+ target=$REPEATED_UTEST_TARGET
+ class_path=$REPEATED_UTEST_CLASS
+ class_name="${class_path##*.}"
+
+ # Prepare the -Dtest.name argument.
+ # It can be the fully qualified class name or the short class name, depending on the target.
+ if [[ $target == "test" || \
+ $target == "test-cdc" || \
+ $target == "test-compression" || \
+ $target == "test-system-keyspace-directory" ]]; then
+ name="-Dtest.name=$class_name"
+ else
+ name="-Dtest.name=$class_path"
+ fi
+
+ # Prepare the -Dtest.methods argument, which is optional
+ if [ "$REPEATED_UTEST_METHODS" == "<nil>" ]; then
+ methods=""
+ else
+ methods="-Dtest.methods=$REPEATED_UTEST_METHODS"
+ fi
+
+ # Run the test target as many times as requested, even if it fails, collecting the exit code.
+ exit_code="$?"
+ for i in $(seq -w 1 $count); do
+
+ echo "Running test iteration $i of $count"
+
+ # run the test
+ status="passes"
+ if !( set -o pipefail && ant $target $name $methods -Dno-build-test=true | tee stdout.txt ); then
+ status="fails"
+ exit_code=1
+ fi
+
+ # move the stdout output file
+ dest=/tmp/results/repeated_utest/stdout/${status}/${i}
+ mkdir -p $dest
+ mv stdout.txt $dest/${REPEATED_UTEST_TARGET}-${REPEATED_UTEST_CLASS}.txt
+
+ # move the XML output files
+ source=build/test/output
+ dest=/tmp/results/repeated_utest/output/${status}/${i}
+ mkdir -p $dest
+ if [[ -d $source && -n "$(ls $source)" ]]; then
+ mv $source/* $dest/
+ fi
+
+ # move the log files
+ source=build/test/logs
+ dest=/tmp/results/repeated_utest/logs/${status}/${i}
+ mkdir -p $dest
+ if [[ -d $source && -n "$(ls $source)" ]]; then
+ mv $source/* $dest/
+ fi
+ done
+
+ (exit ${exit_code})
+ fi
+ fi
+ - store_test_results:
+ path: /tmp/results/repeated_utest/output/
Review comment:
do we need really the last `/`
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: pr-unsubscribe@cassandra.apache.org
For additional commands, e-mail: pr-help@cassandra.apache.org