Skip to content

Commit

Permalink
EZP-30098 [Travis] Implement solution for running tests in threads ba…
Browse files Browse the repository at this point in the history
…sed on fastest - feature sort script improvement (#390)
  • Loading branch information
m-tyrala authored and Łukasz Serwatka committed Apr 11, 2019
1 parent be75dc8 commit 950e6ec
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 3 deletions.
4 changes: 2 additions & 2 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -53,11 +53,11 @@ matrix:
- name: "Admin UI on Clean Platform"
env:
- COMPOSE_FILE="doc/docker/base-dev.yml:doc/docker/selenium.yml"
- TEST_CMD="./bin/.travis/get_behat_features.sh adminui adminui | bin/fastest -o -v \"bin/behat {} --profile=adminui --suite=adminui --no-interaction -vv --strict\""
- TEST_CMD="./bin/.travis/get_behat_features.sh -p adminui -s adminui | bin/fastest -o -v \"bin/behat {} --profile=adminui --suite=adminui --no-interaction -vv --strict\""
- name: "Admin UI on Clean Platform with Varnish and Redis"
env:
- COMPOSE_FILE="doc/docker/base-dev.yml:doc/docker/varnish.yml:doc/docker/redis.yml:doc/docker/selenium.yml"
- TEST_CMD="./bin/.travis/get_behat_features.sh adminui adminui | bin/fastest -o -v \"bin/behat {} --profile=adminui --suite=adminui --no-interaction -vv --strict --tags=~@EZP-29291-excluded\""
- TEST_CMD="./bin/.travis/get_behat_features.sh -p adminui -s adminui -t ~@EZP-29291-excluded | bin/fastest -o -v \"bin/behat {} --profile=adminui --suite=adminui --no-interaction -vv --strict\""
- WEB_HOST="varnish"

notifications:
Expand Down
15 changes: 14 additions & 1 deletion bin/.travis/get_behat_features.sh
Original file line number Diff line number Diff line change
Expand Up @@ -4,5 +4,18 @@
# times each build, often non optimal. To make this optimal we sort features by the number of scenarios in them
# (ascending because Fastest reverse the queue order, and we want this queue to run descending) and run them in that order,
# to minimize final time gap between the threads.
PROFILE=''
SUITE=''
TAGS=''

bin/behat --profile=$1 --suite=$2 --list-scenarios | awk '{ gsub(/:[0-9]+/,"",$1); print $1 }' | uniq -c | sort | awk '{ print $2 }'
while getopts p:s:t: option
do
case "${option}"
in
p) PROFILE="--profile=${OPTARG}";;
s) SUITE="--suite=${OPTARG}";;
t) TAGS="--tags=${OPTARG}";;
esac
done

bin/behat ${PROFILE} ${SUITE} ${TAGS} --list-scenarios | awk '{ gsub(/:[0-9]+/,"",$1); print $1 }' | uniq -c | sort | awk '{ print $2 }'

0 comments on commit 950e6ec

Please sign in to comment.