From be75dc8fc5cbafe580b75e0ab0597e6b55b9967c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Maciej=20Tyra=C5=82a?= Date: Thu, 11 Apr 2019 13:59:01 +0200 Subject: [PATCH 1/2] EZP-30098 [Travis] Implement solution for running tests in threads based on fastest - configuration fix (#389) --- .travis.yml | 10 +++++----- bin/.travis/get_behat_features.sh | 2 +- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/.travis.yml b/.travis.yml index 19dd873e6b..1cef531912 100644 --- a/.travis.yml +++ b/.travis.yml @@ -44,20 +44,20 @@ matrix: env: - TEST_CMD="php bin/phpunit -v vendor/ezsystems/ezpublish-kernel/eZ/Bundle/EzPublishRestBundle/Tests/Functional" - SYMFONY_CMD="ez:behat:create-language 'pol-PL' 'Polish (polski)'" - - name: "Repository Forms tests on Clean EE" + - name: "Repository Forms tests on Clean Platform" env: - COMPOSE_FILE="doc/docker/base-dev.yml:doc/docker/selenium.yml" - TEST_CMD="./bin/behat -v --no-interaction --colors --profile=repository-forms --tags=~@broken" - name: "Behat" env: TEST_CMD="bin/behat -v --profile=behat --tags=~@broken" - - name: "Admin UI on Clean EE" + - 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 | bin/fastest -o -v \"bin/behat {} --suite=adminui --no-interaction -vv --strict\"" - - name: "Admin UI on Clean EE with Varnish and Redis" + - TEST_CMD="./bin/.travis/get_behat_features.sh adminui 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 | bin/fastest -o -v \"bin/behat {} --suite=adminui --no-interaction -vv --strict --tags=~@EZP-29291-excluded\"" + - 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\"" - WEB_HOST="varnish" notifications: diff --git a/bin/.travis/get_behat_features.sh b/bin/.travis/get_behat_features.sh index e78818890d..8d185eca75 100755 --- a/bin/.travis/get_behat_features.sh +++ b/bin/.travis/get_behat_features.sh @@ -5,4 +5,4 @@ # (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. -bin/behat --suite=$1 --list-scenarios | awk '{ gsub(/:[0-9]+/,"",$1); print $1 }' | uniq -c | sort | awk '{ print $2 }' +bin/behat --profile=$1 --suite=$2 --list-scenarios | awk '{ gsub(/:[0-9]+/,"",$1); print $1 }' | uniq -c | sort | awk '{ print $2 }' From 950e6ec2b8f671089060bd50ad8c62fa3e47c5ba Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Maciej=20Tyra=C5=82a?= Date: Thu, 11 Apr 2019 16:51:38 +0200 Subject: [PATCH 2/2] EZP-30098 [Travis] Implement solution for running tests in threads based on fastest - feature sort script improvement (#390) --- .travis.yml | 4 ++-- bin/.travis/get_behat_features.sh | 15 ++++++++++++++- 2 files changed, 16 insertions(+), 3 deletions(-) diff --git a/.travis.yml b/.travis.yml index 1cef531912..bba19fa029 100644 --- a/.travis.yml +++ b/.travis.yml @@ -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: diff --git a/bin/.travis/get_behat_features.sh b/bin/.travis/get_behat_features.sh index 8d185eca75..d37625e1b5 100755 --- a/bin/.travis/get_behat_features.sh +++ b/bin/.travis/get_behat_features.sh @@ -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 }'