feat(test): update e2e to support swarm and CI mode

pull/3314/head
Anthony Lapenna 2019-10-29 12:51:26 +13:00
parent 36de0aee7b
commit 07db1ca16e
3 changed files with 26 additions and 4 deletions

View File

@ -0,0 +1,17 @@
version: '3'
services:
cypress:
image: cypress/included:3.5.0
container_name: e2e-cypress
command: --record --browser chrome
depends_on:
- portainer
working_dir: /e2e
environment:
CYPRESS_baseUrl: http://e2e-portainer:9000
CYPRESS_RECORD_KEY: ${CYPRESS_RECORD_KEY}
volumes:
- ./cypress:/e2e/cypress
- ./cypress.json:/e2e/cypress.json
networks:
- e2e-ci

View File

@ -11,13 +11,12 @@ services:
cypress:
image: cypress/included:3.5.0
container_name: e2e-cypress
# command: --record --browser chrome
command: --browser chrome
depends_on:
- portainer
working_dir: /e2e
environment:
CYPRESS_baseUrl: http://e2e-portainer:9000
# CYPRESS_RECORD_KEY:
volumes:
- ./cypress:/e2e/cypress
- ./cypress.json:/e2e/cypress.json

View File

@ -19,5 +19,11 @@ exec_in worker1 docker swarm join --token $TOKEN_WORKER manager1:2377
# Worker2 join
exec_in worker2 docker swarm join --token $TOKEN_WORKER manager1:2377
# Up portainer
docker-compose up --exit-code-from cypress
# Run portainer + cypress
# Use export CI=1 to run in CI mode
if [ -z "${CI}" ];
then
docker-compose up --exit-code-from cypress
else
docker-compose -f docker-compose.yml -f docker-compose.ci.yml up --exit-code-from cypress
fi