Skip to content

Commit

Permalink
Test Behat
Browse files Browse the repository at this point in the history
  • Loading branch information
emodric committed Feb 10, 2020
1 parent 49f1244 commit a7c9ed3
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 60 deletions.
58 changes: 3 additions & 55 deletions .travis.yml
Expand Up @@ -2,11 +2,6 @@ dist: xenial

language: php

php:
- 7.2
- 7.3
- 7.4

services:
- mysql
- postgresql
Expand All @@ -19,45 +14,10 @@ cache:
directories:
- $HOME/.cache/composer

env:
- PHPUNIT_CONFIG="phpunit.xml" SYMFONY_VERSION="~3.4.0" DB="mysql"
- PHPUNIT_CONFIG="phpunit.xml" SYMFONY_VERSION="~4.4.0" DB="postgresql"
- PHPUNIT_CONFIG="phpunit.xml" SYMFONY_VERSION="~4.4.0"
- PHPUNIT_CONFIG="phpunit-api.xml" SYMFONY_VERSION="~3.4.0" DB="mysql"
- PHPUNIT_CONFIG="phpunit-api.xml" SYMFONY_VERSION="~4.4.0" DB="postgresql"
- PHPUNIT_CONFIG="phpunit-api.xml" SYMFONY_VERSION="~4.4.0"

matrix:
include:
- php: 7.2
env: PHPUNIT_CONFIG="phpunit.xml" SYMFONY_VERSION="~3.4.0" DEPS="low"
- php: 7.2
env: PHPUNIT_CONFIG="phpunit-api.xml" SYMFONY_VERSION="~3.4.0" DEPS="low"
- php: 7.4
env: RUN_PHPSTAN="yes"
- php: 7.4
env: RUN_PSALM="yes"
- php: 7.4
env: RUN_BEHAT="yes"
- php: 7.4
env: RUN_MIGRATIONS="yes" DB="mysql"
- php: 7.4
env: RUN_COVERAGE="yes"
- env: ~
php: 7.4
cache: ~
language: node_js
node_js: node
# We disable install phase as we need to run yarn install only after "before_script" is completed
install: true
script:
- yarn install
- yarn run prod
- yarn run admin:prod
allow_failures:
- env: RUN_COVERAGE="yes"
- env: RUN_BEHAT="yes"
fast_finish: true

branches:
only:
Expand Down Expand Up @@ -100,24 +60,12 @@ before_script:
sleep 15
fi
- vendor/bin/symfony server:start no-tls --daemon --port=4242 --document-root=tests/application/public > /dev/null 2>&1 &
- vendor/bin/chromedriver > /dev/null 2>&1 &

script:
- composer validate --strict
- if [ "$PHPUNIT_CONFIG" != "" ] ; then vendor/bin/phpunit -c $PHPUNIT_CONFIG --colors=always ; fi
- if [ "$RUN_PHPSTAN" != "" ] ; then composer phpstan ; fi
- if [ "$RUN_PHPSTAN" != "" ] ; then composer phpstan-tests ; fi
- if [ "$RUN_PSALM" != "" ] ; then composer psalm ; fi
- if [ "$RUN_BEHAT" != "" ] ; then composer behat-headless ; fi
- |
if [ "$RUN_MIGRATIONS" != "" ] ; then
php tests/application/bin/console doctrine:migrations:migrate \
--no-interaction --no-debug --env=prod --configuration=migrations/doctrine.yaml --ansi
fi
- |
if [ "$RUN_COVERAGE" != "" ] ; then
composer coverage-clover
composer coverage-clover-api
bash <(curl -s https://codecov.io/bash) || echo "Codecov did not collect coverage reports"
fi

notifications:
email: false
Expand Down
3 changes: 2 additions & 1 deletion tests/behat/behat.yaml
Expand Up @@ -4,7 +4,7 @@ imports:
default:
extensions:
Behat\MinkExtension:
base_url: "https://admin:admin@127.0.0.1:4242"
base_url: "http://admin:admin@127.0.0.1:4242"
default_session: symfony
javascript_session: chrome
show_auto: false
Expand All @@ -25,6 +25,7 @@ default:
- "disable-extensions"
- "disable-infobars"
- "start-fullscreen"
- "ignore-ssl-errors=true"

FriendsOfBehat\SymfonyExtension:
kernel:
Expand Down
4 changes: 0 additions & 4 deletions tests/prepare_behat.sh
Expand Up @@ -14,7 +14,3 @@ if [ ! -f vendor/bin/chromedriver ]; then
unzip chromedriver.zip && rm chromedriver.zip
mv -f chromedriver vendor/bin/
fi

vendor/bin/symfony server:ca:install
vendor/bin/symfony server:start --daemon --port=4242 --document-root=tests/application/public
vendor/bin/chromedriver

0 comments on commit a7c9ed3

Please sign in to comment.