Skip to content

Commit

Permalink
[ci] Execute tests separately to avoid exceeding time limit for one c…
Browse files Browse the repository at this point in the history
…ommand at CircleCI.
  • Loading branch information
awulkiew committed Jul 2, 2018
1 parent de95e2c commit 6bc4259
Showing 1 changed file with 15 additions and 20 deletions.
35 changes: 15 additions & 20 deletions circle.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,8 @@ general:

machine:
environment:
# define tests list, if parallelism is enabled they are run in parallel
TESTS: test index/test
# define tests list for parallel testing
# they has to have the same lengths unles code below is changed
TESTS0: test/core test/concepts test/geometries test/arithmetic test/algorithms test/formulas test/iterators
TESTS1: test/srs test/strategies test/policies test/io test/util test/views index/test

Expand Down Expand Up @@ -98,24 +98,19 @@ dependencies:
test:
override:
# `--coverage` flags required to generate coverage info for Coveralls
# temporary for test purposes
#- cd $BOOST_ROOT/libs/geometry && ../../b2 cxxflags="--coverage" linkflags="--coverage" test/algorithms
#- cd $BOOST_ROOT/libs/geometry && ../../b2 cxxflags="--coverage" linkflags="--coverage" test/algorithms/detail
#- cd $BOOST_ROOT/libs/geometry && ../../b2 cxxflags="--coverage" linkflags="--coverage" test/algorithms/relational_operations
#- cd $BOOST_ROOT/libs/geometry && ../../b2 cxxflags="--coverage" linkflags="--coverage" test
#- cd $BOOST_ROOT/libs/geometry && ../../b2 cxxflags="--coverage" linkflags="--coverage" index/test/algorithms
#- cd $BOOST_ROOT/libs/geometry && ../../b2 cxxflags="--coverage" linkflags="--coverage" index/test/rtree/exceptions
# this is the first step of the first approach to automatic balancing
# the problem is that first the upper-level dir is handled
# then the tests from lower dir are executed, so the tests in various containers overlap
#- cd $BOOST_ROOT/libs/geometry && index=0 ; run_tests() { for i in "$1"/* ; do if [ -f "$i"/Jamfile* ] ; then ((index++)) ; echo "$index - $i" ; ../../b2 cxxflags="--coverage" linkflags="--coverage" "$i" ; run_tests "$i" ; fi ; done } ; run_tests test

# so for now just run the tests from the list
#- cd $BOOST_ROOT/libs/geometry && status=0; index=0 ; for t in ${TESTS[@]} ; do if [ $(((index++)%CIRCLE_NODE_TOTAL)) == $CIRCLE_NODE_INDEX ] ; then ../../b2 -j2 cxxflags="--coverage" linkflags="--coverage" $t ; fi || status=$? ; done ; exit $status :
# parallel: true

# so for now just run the tests from 2 lists
- cd $BOOST_ROOT/libs/geometry && status=0; case $CIRCLE_NODE_INDEX in 0) for t in ${TESTS0[@]} ; do ../../b2 -j2 cxxflags="--coverage" linkflags="--coverage" $t || status=$? ; done ;; 1) for t in ${TESTS1[@]} ; do ../../b2 -j2 cxxflags="--coverage" linkflags="--coverage" $t || status=$? ; done ;; esac ; exit $status :
- cd $BOOST_ROOT/libs/geometry && ../../b2 cxxflags="--coverage" linkflags="--coverage" `if [ $CIRCLE_NODE_INDEX -eq 1 ]; then echo ${TESTS1[0]}; else echo ${TESTS0[0]}; fi` :
parallel: true
- cd $BOOST_ROOT/libs/geometry && ../../b2 cxxflags="--coverage" linkflags="--coverage" `if [ $CIRCLE_NODE_INDEX -eq 1 ]; then echo ${TESTS1[1]}; else echo ${TESTS0[1]}; fi` :
parallel: true
- cd $BOOST_ROOT/libs/geometry && ../../b2 cxxflags="--coverage" linkflags="--coverage" `if [ $CIRCLE_NODE_INDEX -eq 1 ]; then echo ${TESTS1[2]}; else echo ${TESTS0[2]}; fi` :
parallel: true
- cd $BOOST_ROOT/libs/geometry && ../../b2 cxxflags="--coverage" linkflags="--coverage" `if [ $CIRCLE_NODE_INDEX -eq 1 ]; then echo ${TESTS1[3]}; else echo ${TESTS0[3]}; fi` :
parallel: true
- cd $BOOST_ROOT/libs/geometry && ../../b2 cxxflags="--coverage" linkflags="--coverage" `if [ $CIRCLE_NODE_INDEX -eq 1 ]; then echo ${TESTS1[4]}; else echo ${TESTS0[4]}; fi` :
parallel: true
- cd $BOOST_ROOT/libs/geometry && ../../b2 cxxflags="--coverage" linkflags="--coverage" `if [ $CIRCLE_NODE_INDEX -eq 1 ]; then echo ${TESTS1[5]}; else echo ${TESTS0[5]}; fi` :
parallel: true
- cd $BOOST_ROOT/libs/geometry && ../../b2 cxxflags="--coverage" linkflags="--coverage" `if [ $CIRCLE_NODE_INDEX -eq 1 ]; then echo ${TESTS1[6]}; else echo ${TESTS0[6]}; fi` :
parallel: true

post:
Expand Down

0 comments on commit 6bc4259

Please sign in to comment.