Skip to content
Snippets Groups Projects
Commit ca19cea0 authored by Sebastien's avatar Sebastien
Browse files

Merge branch 'tuleap-135-have-a-reload-db-test-script' into 'main'

tuleap-135-have-a-reload-db-test-script

See merge request !41
parents 0f48139f 3d02815c
No related branches found
No related tags found
1 merge request!41tuleap-135-have-a-reload-db-test-script
Pipeline #717 passed
...@@ -113,9 +113,10 @@ ...@@ -113,9 +113,10 @@
"@auto-scripts" "@auto-scripts"
], ],
"ci": [ "ci": [
"@tests",
"@phpcs", "@phpcs",
"@phpstan" "@phpstan",
"@reload-db-test",
"@tests"
], ],
"tests": "php ./vendor/bin/phpunit", "tests": "php ./vendor/bin/phpunit",
"phpcs": "php ./vendor/bin/phpcs src/ tests/", "phpcs": "php ./vendor/bin/phpcs src/ tests/",
...@@ -128,7 +129,19 @@ ...@@ -128,7 +129,19 @@
], ],
"phpstan-general": "php -d memory_limit=4G vendor/bin/phpstan analyse -c phpstan.neon", "phpstan-general": "php -d memory_limit=4G vendor/bin/phpstan analyse -c phpstan.neon",
"phpstan-tests": "php -d memory_limit=4G vendor/bin/phpstan analyse -c phpstan-tests.neon", "phpstan-tests": "php -d memory_limit=4G vendor/bin/phpstan analyse -c phpstan-tests.neon",
"php-cs-fixer": "tools/php-cs-fixer/vendor/bin/php-cs-fixer fix src/ tests/" "php-cs-fixer": "tools/php-cs-fixer/vendor/bin/php-cs-fixer fix src/ tests/",
"reload-db-test": [
"@php bin/console doctrine:database:drop --if-exists --force --no-interaction --env=test",
"@php bin/console doctrine:database:create --if-not-exists --no-interaction --env=test",
"@php bin/console doctrine:migration:migrate --all-or-nothing --no-interaction --env=test",
"@php bin/console doctrine:fixture:load --no-interaction --env=test"
],
"reload-db": [
"@php bin/console doctrine:database:drop --if-exists --force --no-interaction --env=dev",
"@php bin/console doctrine:database:create --if-not-exists --no-interaction --env=dev",
"@php bin/console doctrine:migration:migrate --all-or-nothing --no-interaction --env=dev",
"@php bin/console doctrine:fixture:load --no-interaction --env=dev"
]
}, },
"conflict": { "conflict": {
"symfony/symfony": "*" "symfony/symfony": "*"
......
...@@ -29,11 +29,7 @@ else ...@@ -29,11 +29,7 @@ else
fi fi
echo -e "\n ${BOLD} Starting prepare database for tests... \n ${NORMAL}" echo -e "\n ${BOLD} Starting prepare database for tests... \n ${NORMAL}"
$docker php bin/console doctrine:database:drop --if-exists --force --no-interaction --env=test && \ $composer reload-db-test
$docker php bin/console doctrine:database:create --if-not-exists --no-interaction --env=test && \
$docker php bin/console doctrine:migration:migrate --all-or-nothing --no-interaction --env=test && \
#$docker php bin/console doctrine:schema:validate --env=test && \
$docker php bin/console doctrine:fixture:load --no-interaction --env=test
if [ $? != 0 ]; then if [ $? != 0 ]; then
echo -e "\n ${REDBOLD} Database preparation for tests failed \n ${NORMAL}" echo -e "\n ${REDBOLD} Database preparation for tests failed \n ${NORMAL}"
...@@ -51,15 +47,4 @@ else ...@@ -51,15 +47,4 @@ else
echo -e "\n ${GREENBOLD} Unit and functional tests passed successfully! ${NORMAL} \n" echo -e "\n ${GREENBOLD} Unit and functional tests passed successfully! ${NORMAL} \n"
fi fi
#echo -e "\n ${BOLD} Starting ESLint... \n ${NORMAL}"
#$npm run lint
#if [ $? != 0 ]; then
# echo -e "\n ${REDBOLD} ESLint verification failed \n ${NORMAL}"
# exit 1;
#else
# echo -e "\n ${GREENBOLD} Your code passed JS linter successfully! \n
# \n Committing your changes now... \n ${NORMAL}"
#fi
echo -e "\n${GREENBOLD}Committing your changes now... \n ${NORMAL}" echo -e "\n${GREENBOLD}Committing your changes now... \n ${NORMAL}"
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment