Skip to content

Commit

Permalink
Improved: Composer scripts to run behat tests as well
Browse files Browse the repository at this point in the history
  • Loading branch information
igormukhingmailcom committed Sep 16, 2019
1 parent 7209689 commit 8f4e42d
Showing 1 changed file with 43 additions and 2 deletions.
45 changes: 43 additions & 2 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -74,17 +74,58 @@
"@tests"
],
"analyse": "vendor/bin/phpstan analyse -c phpstan.neon -l max src/",
"assets": [
"@ensure-assets-installed",
"@ensure-assets-compiled"
],
"behat": [
"SYMFONY_ENV=test composer ensure-database-ready",
"SYMFONY_ENV=test composer ensure-env-copied",
"vendor/bin/behat --tags=\"~@javascript\" --no-interaction --format=progress"
],
"check-style": "vendor/bin/ecs check src/ spec/",
"checks": [
"composer validate --strict",
"composer normalize --dry-run",
"@check-style",
"@analyse"
],
"ensure-assets-compiled": "[[ -d tests/Application/public/assets ]] || (cd tests/Application && yarn build && composer ensure-env-copied && bin/console assets:install public -e ${SYMFONY_ENV:-'dev'})",
"ensure-assets-installed": "[[ -d tests/Application/node_modules ]] || (cd tests/Application && yarn install)",
"ensure-database-created": "composer ensure-env-copied && (cd tests/Application && bin/console doctrine:database:create --if-not-exists -e ${SYMFONY_ENV:-'dev'})",
"ensure-database-ready": [
"@ensure-database-created",
"@ensure-schema-updated"
],
"ensure-env-copied": "([[ ${SYMFONY_ENV:-'dev'} == 'dev' ]] && composer ensure-env-dev-copied) || ([[ ${SYMFONY_ENV:-'dev'} == 'test' ]] && composer ensure-env-test-copied) || echo 'Unknown environment ${SYMFONY_ENV}'",
"ensure-env-dev-copied": "(cd tests/Application && ([[ -f .env.dev.local ]] || cp .env .env.dev.local))",
"ensure-env-test-copied": "(cd tests/Application && ([[ -f .env.test.local ]] || cp .env.test .env.test.local))",
"ensure-schema-updated": "composer ensure-env-copied && (cd tests/Application && bin/console doctrine:schema:update --force -e ${SYMFONY_ENV:-'dev'})",
"ensure-vendors-installed": "[[ -f vendor/autoload.php ]] || php -d memory_limit=-1 /usr/local/bin/composer install",
"fix-style": "vendor/bin/ecs check src/ spec/ --fix",
"fixtures": [
"@ensure-database-ready",
"(cd tests/Application && bin/console sylius:fixtures:load --no-interaction -e ${SYMFONY_ENV:-'dev'})"
],
"phpspec": "vendor/bin/phpspec run",
"phpunit": "vendor/bin/phpunit",
"phpunit": [
"SYMFONY_ENV=test composer ensure-database-ready",
"vendor/bin/phpunit"
],
"run": [
"@ensure-env-copied",
"(cd tests/Application && bin/console server:run -d public -e ${SYMFONY_ENV:-'dev'})"
],
"tests": [
"@phpspec",
"@phpunit"
"@phpunit",
"@behat"
],
"try": [
"@ensure-vendors-installed",
"@assets",
"@fixtures",
"@run"
]
}
}

0 comments on commit 8f4e42d

Please sign in to comment.