Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
Memorekall Member New
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Container registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
GitLab community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Rekall
Memorekall Member New
Commits
2fdd9619
Commit
2fdd9619
authored
3 years ago
by
Camille Simiand
Browse files
Options
Downloads
Patches
Plain Diff
Add a composer script to prepare test database and call it from
pre-commit hook in ci
parent
6ffa0a7a
Branches
Branches containing commit
Tags
Tags containing commit
1 merge request
!41
tuleap-135-have-a-reload-db-test-script
Pipeline
#694
passed
3 years ago
Stage: test
Changes
2
Pipelines
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
composer.json
+10
-3
10 additions, 3 deletions
composer.json
tools/git-hooks/pre-commit
+1
-16
1 addition, 16 deletions
tools/git-hooks/pre-commit
with
11 additions
and
19 deletions
composer.json
+
10
−
3
View file @
2fdd9619
...
...
@@ -112,9 +112,10 @@
"@auto-scripts"
],
"ci"
:
[
"@tests"
,
"@phpcs"
,
"@phpstan"
"@phpstan"
,
"@reload-db-test"
,
"@tests"
],
"tests"
:
"php ./vendor/bin/phpunit"
,
"phpcs"
:
"php ./vendor/bin/phpcs src/ tests/"
,
...
...
@@ -127,7 +128,13 @@
],
"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"
,
"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"
]
},
"conflict"
:
{
"symfony/symfony"
:
"*"
...
...
This diff is collapsed.
Click to expand it.
tools/git-hooks/pre-commit
+
1
−
16
View file @
2fdd9619
...
...
@@ -29,11 +29,7 @@ else
fi
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
&&
\
$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
$composer
reload-db-test
if
[
$?
!=
0
]
;
then
echo
-e
"
\n
${
REDBOLD
}
Database preparation for tests failed
\n
${
NORMAL
}
"
...
...
@@ -51,15 +47,4 @@ else
echo
-e
"
\n
${
GREENBOLD
}
Unit and functional tests passed successfully!
${
NORMAL
}
\n
"
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
}
"
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment