2019-02-07 16:40:34 +00:00
|
|
|
version: 2.1
|
|
|
|
commands:
|
|
|
|
install:
|
2018-09-06 14:37:27 +00:00
|
|
|
steps:
|
|
|
|
- checkout
|
|
|
|
- restore_cache:
|
|
|
|
keys:
|
|
|
|
- v1-deps-{{ .Branch }}-{{ checksum "package.json" }}
|
|
|
|
- v1-deps-{{ .Branch }}
|
|
|
|
- v1-deps
|
|
|
|
- run: yarn install --frozen-lockfile
|
|
|
|
- save_cache:
|
|
|
|
key: v1-deps-{{ .Branch }}-{{ checksum "package.json" }}
|
|
|
|
paths:
|
|
|
|
- ~/.cache
|
2019-02-12 15:37:49 +00:00
|
|
|
cypress:
|
|
|
|
parameters:
|
|
|
|
language:
|
|
|
|
type: enum
|
|
|
|
enum: [fr, en]
|
|
|
|
default: fr
|
|
|
|
integration_folder:
|
|
|
|
type: enum
|
2019-04-18 13:21:59 +00:00
|
|
|
enum: [mon-entreprise, external]
|
2019-02-12 15:37:49 +00:00
|
|
|
default: mon-entreprise
|
|
|
|
base_url:
|
|
|
|
type: string
|
|
|
|
default: https://mon-entreprise.fr
|
|
|
|
steps:
|
2019-10-22 12:25:06 +00:00
|
|
|
- run: CYPRESS_baseUrl=<< parameters.base_url >> yarn run cypress run --parallel --record --key 21660df5-36a5-4c49-b23d-801799b0c759 --env language=<< parameters.language >> --config integrationFolder=cypress/integration/<< parameters.integration_folder >>
|
2019-02-07 16:40:34 +00:00
|
|
|
|
|
|
|
jobs:
|
|
|
|
unit-test:
|
|
|
|
docker:
|
|
|
|
- image: node
|
|
|
|
steps:
|
|
|
|
- install
|
2018-09-06 14:37:27 +00:00
|
|
|
- run: |
|
2019-02-07 16:40:34 +00:00
|
|
|
yarn run flow-typed install
|
2018-09-06 14:37:27 +00:00
|
|
|
git config --global core.quotepath false
|
|
|
|
yarn test
|
2019-10-18 17:15:58 +00:00
|
|
|
yarn test-regressions
|
2018-09-06 14:37:27 +00:00
|
|
|
|
|
|
|
end-to-end-test:
|
2018-08-24 14:35:42 +00:00
|
|
|
docker:
|
2018-09-05 15:45:45 +00:00
|
|
|
- image: cypress/base:8
|
|
|
|
environment:
|
|
|
|
TERM: xterm
|
2019-10-22 12:25:06 +00:00
|
|
|
parallelism: 2
|
2018-08-24 14:35:42 +00:00
|
|
|
steps:
|
2019-02-07 16:40:34 +00:00
|
|
|
- install
|
2019-02-12 15:37:49 +00:00
|
|
|
- run: yarn run compile-dev
|
|
|
|
- run:
|
|
|
|
command: yarn run serve-dev
|
|
|
|
background: true
|
|
|
|
- cypress:
|
|
|
|
base_url: http://localhost:5000
|
|
|
|
- cypress:
|
|
|
|
base_url: http://localhost:5001
|
|
|
|
language: en
|
|
|
|
|
2019-02-07 16:40:34 +00:00
|
|
|
production-end-to-end-test:
|
2018-09-06 16:38:37 +00:00
|
|
|
docker:
|
|
|
|
- image: cypress/base:8
|
|
|
|
environment:
|
|
|
|
TERM: xterm
|
2019-02-12 15:37:49 +00:00
|
|
|
parameters:
|
2018-09-06 16:38:37 +00:00
|
|
|
steps:
|
2018-09-06 17:37:20 +00:00
|
|
|
- checkout
|
2018-09-06 16:38:37 +00:00
|
|
|
- run: npm install --save-dev cypress
|
2019-02-12 15:37:49 +00:00
|
|
|
- run: sleep 200
|
|
|
|
- cypress:
|
|
|
|
base_url: https://mon-entreprise.fr
|
|
|
|
- cypress:
|
|
|
|
base_url: https://mycompanyinfrance.fr
|
|
|
|
language: en
|
|
|
|
- cypress:
|
|
|
|
integration_folder: external
|
|
|
|
- run:
|
|
|
|
name: Send email if test failed
|
|
|
|
when: on_fail
|
|
|
|
command: >
|
2018-09-06 17:42:27 +00:00
|
|
|
curl -H 'Content-Type: application/json' --request POST -d '{"success": false}' https://hooks.zapier.com/hooks/catch/3746650/qsp818/;
|
2018-09-06 14:37:27 +00:00
|
|
|
|
|
|
|
workflows:
|
|
|
|
version: 2
|
|
|
|
test:
|
|
|
|
jobs:
|
|
|
|
- unit-test
|
2019-02-12 14:52:05 +00:00
|
|
|
- end-to-end-test
|
2019-02-07 16:40:34 +00:00
|
|
|
- production-end-to-end-test:
|
2018-09-06 14:37:27 +00:00
|
|
|
filters:
|
|
|
|
branches:
|
|
|
|
only: master
|