Commit a516d492 authored by Cédric Girardot's avatar Cédric Girardot

CI : Ajoute tests Cypress

Change-Id: I745931eb999da7220a2553231a47ec644ea50257
parent b0f8a228
include:
- project: 'adullact/partage-gitlab-ci'
ref: master
file: '/templates/get-version/.gitlab-ci.template.yml'
ref: master
file: '/templates/get-version/.gitlab-ci.template.yml'
- project: 'adullact/partage-gitlab-ci'
ref: master
file: '/templates/test/shellcheck/.gitlab-ci.template.yml'
ref: master
file: '/templates/test/shellcheck/.gitlab-ci.template.yml'
- project: 'adullact/partage-gitlab-ci'
ref: master
file: '/templates/docker/kaniko/.gitlab-ci.template.yml'
ref: master
file: '/templates/docker/kaniko/.gitlab-ci.template.yml'
- project: 'atol-cd/partage-gitlab-ci'
ref: master
file: '/templates/composer/.gitlab-ci.template.yml'
ref: master
file: '/templates/composer/.gitlab-ci.template.yml'
stages:
- pre-build
- pre-build-test
- test
- build
- package
- deliver
- pre-build
- build-test
- quality-test
- unit-test
- e2e-test
- build
get-version:
stage: pre-build
stage: pre-build
extends: .get-version-git-template
test-app:
stage: test
build-test:
stage: build-test
extends: .composer-yarn-build-template
services:
- mariadb:10.1
......@@ -34,6 +34,14 @@ test-app:
MYSQL_ROOT_PASSWORD: password
ADU_CI_COMPOSER_PROJECT_DIR: "$CI_PROJECT_DIR/appli_sf"
ADU_CI_COMPOSER_CLI_OPTIONS: "--no-progress --no-suggest --no-interaction --no-scripts"
artifacts:
expire_in: 1 day
paths:
- appli_sf/vendor/
- appli_sf/node_modules/
- appli_sf/public/
- appli_sf/.env
- appli_sf/phpunit.xml.dist
script:
- |
VERSION=$(cat "$CI_PROJECT_DIR/$ADU_CI_APP_VERSION_FILE")
......@@ -44,34 +52,99 @@ test-app:
composer install $ADU_CI_COMPOSER_CLI_OPTIONS
yarn install --frozen-lockfile
yarn run build
bin/console doctrine:migration:migrate --no-interaction
bin/console doctrine:schema:drop --force
bin/console doctrine:schema:update --force
bin/console cache:clear
quality-test:
stage: quality-test
extends: .composer-yarn-build-template
dependencies:
- build-test
services:
- mariadb:10.1
variables:
MYSQL_DATABASE: notaires
MYSQL_ROOT_PASSWORD: password
ADU_CI_COMPOSER_PROJECT_DIR: "$CI_PROJECT_DIR/appli_sf"
script:
- |
cd $ADU_CI_COMPOSER_PROJECT_DIR
bin/console doctrine:schema:update --force
bin/console cache:clear
bin/console lint:yaml --no-interaction config
bin/console lint:yaml --no-interaction translations
./vendor/bin/phpcs
./vendor/bin/phplint --no-progress --no-interaction
./vendor/bin/phpstan analyse --no-progress --no-interaction
unit-test:
stage: unit-test
extends: .composer-yarn-build-template
dependencies:
- build-test
services:
- mariadb:10.1
variables:
MYSQL_DATABASE: notaires
MYSQL_ROOT_PASSWORD: password
ADU_CI_COMPOSER_PROJECT_DIR: "$CI_PROJECT_DIR/appli_sf"
script:
- |
cd $ADU_CI_COMPOSER_PROJECT_DIR
bin/console doctrine:schema:update --force
bin/console cache:clear
bin/phpunit tests/UnitTests
e2e-test:
stage: e2e-test
extends: .composer-yarn-build-template
dependencies:
- build-test
services:
- mariadb:10.1
- docker:19-dind
variables:
MYSQL_DATABASE: notaires
MYSQL_ROOT_PASSWORD: password
ADU_CI_COMPOSER_PROJECT_DIR: "$CI_PROJECT_DIR/appli_sf"
CYPRESS_BASE_URL: "http://localhost:8000"
artifacts:
expire_in: 1 day
when: always
paths:
- e2e/cypress/screenshots
- e2e/cypress/videos
script:
- |
cd $ADU_CI_COMPOSER_PROJECT_DIR
bin/console doctrine:schema:update --force
bin/console cache:clear
bin/console import:individus imports/individus.csv --use-civil-name=1 --no-interaction
bin/console user:add --username=admin --password=P@ssword12345 --email=test@deptnot.test --name=Administrateur --role=ROLE_ADMIN --no-interaction
symfony server:start -d
cd tests/E2E
yarn
cypress run
build-app:
stage: build
stage: build
extends: .composer-yarn-build-template
variables:
ADU_CI_COMPOSER_PROJECT_DIR: "$CI_PROJECT_DIR/appli_sf"
ARCHIVE_FILES: >-
.env.dist
composer.json
composer.lock
assets/
bin/console
config/
public/
src/
templates/
translations/
vendor/
ARCHIVE_FILES: >-
.env.dist
composer.json
composer.lock
assets/
bin/console
config/
public/
src/
templates/
translations/
vendor/
artifacts:
paths:
- "$CI_PROJECT_DIR/build-result/*"
......
......@@ -88,7 +88,7 @@ class Person extends AbstractPerson
private $helpCode;
/**
* @ORM\Column(name="date_deces", type="date")
* @ORM\Column(name="date_deces", type="date", nullable=true)
*/
private $deathDate;
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment