Skip to content

Commit

Permalink
Make Behat passing with the new directory structure
Browse files Browse the repository at this point in the history
  • Loading branch information
pamil committed Aug 9, 2018
1 parent 1f33a1b commit 659da4e
Show file tree
Hide file tree
Showing 6 changed files with 54 additions and 6 deletions.
23 changes: 23 additions & 0 deletions .env.test.dist
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
# This file is a "template" of which env vars needs to be defined in your configuration or in an .env file
# Set variables here that may be different on each deployment target of the app, e.g. development, staging, production.
# https://symfony.com/doc/current/best_practices/configuration.html#infrastructure-related-configuration

###> symfony/framework-bundle ###
APP_ENV=test
APP_DEBUG=1
APP_SECRET=EDITME
###< symfony/framework-bundle ###

###> doctrine/doctrine-bundle ###
# Format described at http://docs.doctrine-project.org/projects/doctrine-dbal/en/latest/reference/configuration.html#connecting-using-a-url
# For a sqlite database, use: "sqlite:///%kernel.project_dir%/var/data.db"
# Set "serverVersion" to your server version to avoid edge-case exceptions and extra database calls
DATABASE_URL=mysql://[email protected]/sylius_${APP_ENV}?serverVersion=5.5
###< doctrine/doctrine-bundle ###

###> symfony/swiftmailer-bundle ###
# For Gmail as a transport, use: "gmail://username:password@localhost"
# For a generic SMTP server, use: "smtp://localhost:25?encryption=&auth_mode="
# Delivery is disabled by default via "null://localhost"
MAILER_URL=null://localhost
###< symfony/swiftmailer-bundle ###
23 changes: 23 additions & 0 deletions .env.test_cached.dist
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
# This file is a "template" of which env vars needs to be defined in your configuration or in an .env file
# Set variables here that may be different on each deployment target of the app, e.g. development, staging, production.
# https://symfony.com/doc/current/best_practices/configuration.html#infrastructure-related-configuration

###> symfony/framework-bundle ###
APP_ENV=test_cached
APP_DEBUG=0
APP_SECRET=EDITME
###< symfony/framework-bundle ###

###> doctrine/doctrine-bundle ###
# Format described at http://docs.doctrine-project.org/projects/doctrine-dbal/en/latest/reference/configuration.html#connecting-using-a-url
# For a sqlite database, use: "sqlite:///%kernel.project_dir%/var/data.db"
# Set "serverVersion" to your server version to avoid edge-case exceptions and extra database calls
DATABASE_URL=mysql://[email protected]/sylius_${APP_ENV}?serverVersion=5.5
###< doctrine/doctrine-bundle ###

###> symfony/swiftmailer-bundle ###
# For Gmail as a transport, use: "gmail://username:password@localhost"
# For a generic SMTP server, use: "smtp://localhost:25?encryption=&auth_mode="
# Delivery is disabled by default via "null://localhost"
MAILER_URL=null://localhost
###< symfony/swiftmailer-bundle ###
4 changes: 2 additions & 2 deletions etc/travis/suites/application/before_script.sh
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@ run_command "bin/console cache:warmup --env=test_cached --no-debug -vvv" || exit
run_command "bin/console doctrine:migrations:migrate --no-interaction --env=test_cached --no-debug -vvv" || exit $?

print_header "Setting the web assets up" "Sylius"
run_command "bin/console assets:install web --env=test_cached --no-debug -vvv" || exit $?
run_command "bin/console assets:install --env=test_cached --no-debug -vvv" || exit $?
run_command "yarn build" || exit $?

print_header "Making filesystem readonly" "Sylius"
run_command "chmod -R 555 app bin docs features src tests vendor"
run_command "chmod -R 555 app bin config docs features src templates tests vendor"
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ prepare_for_behat_with_js() {
run_command "java -Dwebdriver.chrome.driver=$SYLIUS_CACHE_DIR/chromedriver -jar $SYLIUS_CACHE_DIR/selenium.jar > /dev/null 2>&1 &"

# Run webserver
run_command "bin/console server:run 127.0.0.1:8080 --env=test_cached --docroot=web --router=app/config/router_test_cached.php --no-debug --quiet > /dev/null 2>&1 &"
run_command "bin/console server:run 127.0.0.1:8080 --env=test_cached --no-debug --quiet > /dev/null 2>&1 &"
}

run_behat() {
Expand Down
1 change: 1 addition & 0 deletions src/Sylius/Behat/Resources/config/profiles/cached.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
cached:
extensions:
FriendsOfBehat\SymfonyExtension:
env_file: .env.test_cached.dist
kernel:
env: test_cached
debug: false
7 changes: 4 additions & 3 deletions src/Sylius/Behat/Resources/config/profiles/default.yml
Original file line number Diff line number Diff line change
Expand Up @@ -41,10 +41,11 @@ default:
show_auto: false

FriendsOfBehat\SymfonyExtension:
env_file: .env.test.dist
kernel:
class: TestAppKernel
path: app/TestAppKernel.php
bootstrap: vendor/autoload.php
class: TestKernel
path: src/TestKernel.php
bootstrap: ~

FriendsOfBehat\ContextServiceExtension:
imports:
Expand Down

0 comments on commit 659da4e

Please sign in to comment.