Collecting test results from parallel build

paralellism

#1

Hi all,

I am trying to collect test results and artifacts from a parallel build, but it seems that only the data on container 0 is collected. E.g.:
https://circleci.com/gh/AmailP/robot-plugin/12#artifacts

I am assuming that different containers are collected separately. Is it correct?

What am I doing wrong?
Cheers
Valerio


#2

Really no one can give me an advice?


#3

I added a section below to create the test report directory and copy the results in this shell script. This resolves the issue that only 1 VM out of the all parallel cores creates and uploads test results. This also means that your circle.yml file do not need the mkdir & copy command in the test post section.

#!/bin/bash

NODE_TOTAL=${CIRCLE_NODE_TOTAL:-1}
NODE_INDEX=${CIRCLE_NODE_INDEX:-0}

i=0
tests=()
for file in $(find ./src/test/java -name "*Test.java" | sort)
do
  if [ $(($i % ${NODE_TOTAL})) -eq ${NODE_INDEX} ]
  then
    test=`basename $file | sed -e "s/.java//"`
    tests+="${test},"
  fi
  ((i++))
done

mvn -Dtest=${tests} test

if [ x${CIRCLE_TEST_REPORTS} != x ]; then
    mkdir -p $CIRCLE_TEST_REPORTS/junit/
    find . -type f -regex ".*/target/surefire-reports/.*xml" -exec cp {} $CIRCLE_TEST_REPORTS/junit/ \;
fi

#4