Skip to content

Commit

Permalink
test(e2e): split e2e script into setup and test phase (#2027)
Browse files Browse the repository at this point in the history
  • Loading branch information
aeneasr committed Dec 10, 2021
1 parent 0b426d2 commit 1761418
Show file tree
Hide file tree
Showing 7 changed files with 322 additions and 478 deletions.
105 changes: 91 additions & 14 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ jobs:
- run: |
bash <(curl -s https://codecov.io/bash)
test-e2e:
test-e2e-1:
docker:
- image: oryd/e2e-env:latest
environment:
Expand Down Expand Up @@ -143,30 +143,103 @@ jobs:
echo "unset DISPLAY" >> $BASH_ENV
- run:
description: Run sqlite e2e test
description: Run postrgres e2e test
command: |
source $BASH_ENV
./test/e2e/run.sh sqlite
./test/e2e/run.sh postgres
- run:
description: Run postrgres e2e test
description: Run cockroach e2e test
command: |
source $BASH_ENV
./test/e2e/run.sh postgres
./test/e2e/run.sh cockroach
test-e2e-2:
docker:
- image: oryd/e2e-env:latest
environment:
TEST_DATABASE_MYSQL: mysql://root:test@(localhost:3306)/mysql?parseTime=true&multiStatements=true
TEST_DATABASE_COCKROACHDB: cockroach://root@localhost:26257/defaultdb?sslmode=disable
TEST_DATABASE_POSTGRESQL: postgres://test:test@localhost:5432/kratos?sslmode=disable
- image: postgres:9.6
environment:
POSTGRES_USER: test
POSTGRES_PASSWORD: test
POSTGRES_DB: kratos
- image: cockroachdb/cockroach:v21.1.9
command: start-single-node --insecure
- image: mysql:5.7
environment:
- MYSQL_ROOT_PASSWORD=test
- image: oryd/mailslurper:latest-smtps
steps:
- browser-tools/install-browser-tools
- checkout

- restore_cache:
keys:
- v3-e2e-deps-{{ checksum "package-lock.json" }}-{{ checksum "test/e2e/package-lock.json" }}
- run: npm ci
- run: cd test/e2e; npm ci
- run: sudo npm i -g expo-cli
- save_cache:
key: v3-e2e-deps-{{ checksum "package-lock.json" }}-{{ checksum "test/e2e/package-lock.json" }}
paths:
- node_modules
- ~/.cache # cypress
- ~/.npm/node_modules # global npm
- test/e2e/node_modules # e2e npm

- go/load-cache
- go/mod-download
- go/save-cache

- run: npm config set prefix ~/.npm/node_modules

- run:
description: Run mysql e2e test
description: "Install selfservice-ui-node"
command: |
node_ui_dir="$(mktemp -d -t ci-XXXXXXXXXX)/kratos-selfservice-ui-node"
echo "export NODE_UI_PATH=$node_ui_dir" >> $BASH_ENV
git clone https://github.com/ory/kratos-selfservice-ui-node.git --depth 1 --branch master "$node_ui_dir"
cd "$node_ui_dir"
npm i
npm run build
- run:
description: "Install selfservice-ui-react-native"
command: |
rn_ui_dir="$(mktemp -d -t ci-XXXXXXXXXX)/kratos-selfservice-ui-react-native"
echo "export RN_UI_PATH=$rn_ui_dir" >> $BASH_ENV
git clone https://github.com/ory/kratos-selfservice-ui-react-native.git --depth 1 --branch master "$rn_ui_dir"
cd "$rn_ui_dir"
npm i
- run:
description: "Unset DISPLAY - see https://github.com/cypress-io/cypress/issues/4034"
command: |
echo "unset DISPLAY" >> $BASH_ENV
- run:
description: Run sqlite e2e test
command: |
source $BASH_ENV
./test/e2e/run.sh mysql
./test/e2e/run.sh sqlite
- run:
description: Run cockroach e2e test
description: Run mysql e2e test
command: |
source $BASH_ENV
./test/e2e/run.sh cockroach
./test/e2e/run.sh mysql
workflows:
tbr:
jobs:
- test-e2e:
- test-e2e-1:
filters:
tags:
only: /.*/
- test-e2e-2:
filters:
tags:
only: /.*/
Expand All @@ -183,7 +256,8 @@ workflows:
- sdk/generate-openapi:
requires:
- test
- test-e2e
- test-e2e-1
- test-e2e-2
filters:
tags:
only: /.*/
Expand All @@ -201,7 +275,8 @@ workflows:
swagpath: spec/api.json
requires:
- test
- test-e2e
- test-e2e-1
- test-e2e-2
- sdk/generate-openapi
- sdk/test
- goreleaser/release
Expand All @@ -213,7 +288,8 @@ workflows:
- changelog/generate:
requires:
- test
- test-e2e
- test-e2e-1
- test-e2e-2
filters:
tags:
only: /.*/
Expand All @@ -222,7 +298,8 @@ workflows:
- goreleaser/release:
requires:
- test
- test-e2e
- test-e2e-1
- test-e2e-2
filters:
branches:
ignore: /.*/
Expand Down
Loading

0 comments on commit 1761418

Please sign in to comment.