diff --git a/.circleci/collect_results.sh b/.circleci/collect_results.sh index 44bc59f7f54..1d67afda889 100755 --- a/.circleci/collect_results.sh +++ b/.circleci/collect_results.sh @@ -7,20 +7,30 @@ set -e #Enable '**' support shopt -s globstar -TEST_RESULTS_DIR=./results -mkdir -p $TEST_RESULTS_DIR >/dev/null 2>&1 - +TEST_RESULTS_DIR=results +WORKSPACE_DIR=workspace mkdir -p $TEST_RESULTS_DIR +mkdir -p $WORKSPACE_DIR -mkdir -p workspace -mapfile -t test_result_dirs < <(find workspace -name test-results -type d) +mapfile -t TEST_RESULT_DIRS < <(find $WORKSPACE_DIR -name test-results -type d) -if [[ ${#test_result_dirs[@]} -eq 0 ]]; then +if [[ ${#TEST_RESULT_DIRS[@]} -eq 0 ]]; then echo "No test results found" exit 0 fi -echo "saving test results" -find "${test_result_dirs[@]}" -name \*.xml -exec sh -c ' - file=$(echo "$0" | rev | cut -d "/" -f 1,2,5 | rev | tr "/" "_") - cp "$0" "$1/$file"' {} $TEST_RESULTS_DIR \; +echo "Saving test results:" +while IFS= read -r -d '' RESULT_XML_FILE +do + echo -n "- $RESULT_XML_FILE" + AGGREGATED_FILE_NAME=$(echo "$RESULT_XML_FILE" | rev | cut -d "/" -f 1,2,5 | rev | tr "/" "_") + echo -n " as $AGGREGATED_FILE_NAME" + cp "$RESULT_XML_FILE" "$TEST_RESULTS_DIR/$AGGREGATED_FILE_NAME" + # Replace Java Object hashCode by marker in testcase XML nodes to get stable test names + sed -i '/