test yarn e2e

This commit is contained in:
Antoine Legrand 2017-07-18 09:08:33 +02:00
parent 0ad28d056c
commit fc8ba8b84e
5 changed files with 54 additions and 46 deletions

View file

@ -8,9 +8,10 @@ local stages_list = [
// gitlab-ci stages // gitlab-ci stages
'docker_base', 'docker_base',
'docker_build', 'docker_build',
'integration',
'deploy_preview', 'deploy_preview',
'unit_tests', 'unit_tests',
'integration',
'docker_release', 'docker_release',
'deploy_staging', 'deploy_staging',
'teardown', 'teardown',
@ -100,20 +101,25 @@ local jobs = {
// Integration API // Integration API
local integration_test = baseJob.EndToEndTest { local integration_test = baseJob.EndToEndTest {
stage: stages.unit_tests stage: stages.integration
}, },
'demo_e2e': integration_test { 'yarn_e2e': integration_test {
variables+: {"APP_HOST": "http://localhost:80"},
services+: ["selenium/standalone-chrome:3.4.0"],
before_script+: [
"curl -sL https://deb.nodesource.com/setup_8.x | bash -",
"apt-get update && apt-get install -y nodejs",
],
script: [ script: [
"sleep 60",
"python initdb.py", "python initdb.py",
"sleep 30", "sleep 30",
"curl localhost:80/cnr/version", "./node_modules/.bin/webdriver-manager update",
"sleep 30", "yarn e2e",
"curl localhost:80",
"sleep 30",
"curl localhost:80/status",
] ]
}, },
// Unit-tests with real databases // Unit-tests with real databases
local db_stage = { stage: stages.unit_tests }, local db_stage = { stage: stages.unit_tests },
local dbname = 'quay', local dbname = 'quay',

View file

@ -14,7 +14,7 @@ container-base-build:
tags: tags:
- kubernetes - kubernetes
variables: variables:
DOCKER_DRIVER: overlay DOCKER_DRIVER: overlay2
DOCKER_HOST: tcp://docker-host.gitlab-runner.svc.cluster.local:2375 DOCKER_HOST: tcp://docker-host.gitlab-runner.svc.cluster.local:2375
container-build: container-build:
before_script: before_script:
@ -31,7 +31,7 @@ container-build:
tags: tags:
- kubernetes - kubernetes
variables: variables:
DOCKER_DRIVER: overlay DOCKER_DRIVER: overlay2
DOCKER_HOST: tcp://docker-host.gitlab-runner.svc.cluster.local:2375 DOCKER_HOST: tcp://docker-host.gitlab-runner.svc.cluster.local:2375
container-release: container-release:
before_script: before_script:
@ -48,39 +48,8 @@ container-release:
tags: tags:
- kubernetes - kubernetes
variables: variables:
DOCKER_DRIVER: overlay DOCKER_DRIVER: overlay2
DOCKER_HOST: tcp://docker-host.gitlab-runner.svc.cluster.local:2375 DOCKER_HOST: tcp://docker-host.gitlab-runner.svc.cluster.local:2375
demo_e2e:
before_script:
- cd $QUAYDIR
- source $QUAYDIR/venv/bin/activate
- sleep 30
- alembic upgrade head
image: quay.io/quay/quay-ci:${CI_COMMIT_REF_SLUG}
script:
- python initdb.py
- sleep 30
- curl localhost:80/cnr/version
- sleep 30
- curl localhost:80
- sleep 30
- curl localhost:80/status
services:
- postgres:9.6
- quay.io/quay/quay-ci:${CI_COMMIT_REF_SLUG}
stage: unit_tests
tags:
- kubernetes
variables:
DB_URI: postgresql://quay:quay@localhost/quay
GIT_STRATEGY: none
POSTGRES_PASSWORD: quay
POSTGRES_USER: quay
PYTHONPATH: .
QUAYDIR: /quay-registry
SKIP_DB_SCHEMA: 'true'
TEST: 'true'
TEST_DATABASE_URI: postgresql://quay:quay@localhost/quay
deploy-preview: deploy-preview:
before_script: before_script:
- appr login -u $DOCKER_USER -p $DOCKER_PASS quay.io - appr login -u $DOCKER_USER -p $DOCKER_PASS quay.io
@ -222,9 +191,9 @@ registry-tests:
stages: stages:
- docker_base - docker_base
- docker_build - docker_build
- integration
- deploy_preview - deploy_preview
- unit_tests - unit_tests
- integration
- docker_release - docker_release
- deploy_staging - deploy_staging
- teardown - teardown
@ -273,3 +242,36 @@ unit-tests:
TEST: 'true' TEST: 'true'
variables: variables:
FAILFASTCI_NAMESPACE: quay FAILFASTCI_NAMESPACE: quay
yarn_e2e:
before_script:
- cd $QUAYDIR
- source $QUAYDIR/venv/bin/activate
- sleep 30
- alembic upgrade head
- curl -sL https://deb.nodesource.com/setup_8.x | bash -
- apt-get update && apt-get install -y nodejs
image: quay.io/quay/quay-ci:${CI_COMMIT_REF_SLUG}
script:
- sleep 60
- python initdb.py
- sleep 30
- ./node_modules/.bin/webdriver-manager update
- yarn e2e
services:
- postgres:9.6
- quay.io/quay/quay-ci:${CI_COMMIT_REF_SLUG}
- selenium/standalone-chrome:3.4.0
stage: integration
tags:
- kubernetes
variables:
APP_HOST: http://localhost:80
DB_URI: postgresql://quay:quay@localhost/quay
GIT_STRATEGY: none
POSTGRES_PASSWORD: quay
POSTGRES_USER: quay
PYTHONPATH: .
QUAYDIR: /quay-registry
SKIP_DB_SCHEMA: 'true'
TEST: 'true'
TEST_DATABASE_URI: postgresql://quay:quay@localhost/quay

View file

@ -3,7 +3,7 @@ function(vars={})
dockerBuild: { dockerBuild: {
// base job to manage containers (build / push) // base job to manage containers (build / push)
variables: { variables: {
DOCKER_DRIVER: "overlay", DOCKER_DRIVER: "overlay2",
DOCKER_HOST: "tcp://docker-host.gitlab-runner.svc.cluster.local:2375" DOCKER_HOST: "tcp://docker-host.gitlab-runner.svc.cluster.local:2375"
}, },

View file

@ -18,7 +18,7 @@ RUN add-apt-repository ppa:nginx/development
# Add Yarn repository until it is officially added to Ubuntu # Add Yarn repository until it is officially added to Ubuntu
RUN curl -sS https://dl.yarnpkg.com/debian/pubkey.gpg | apt-key add - \ RUN curl -sS https://dl.yarnpkg.com/debian/pubkey.gpg | apt-key add - \
&& echo "deb https://dl.yarnpkg.com/debian/ stable main" | tee /etc/apt/sources.list.d/yarn.list && echo "deb https://dl.yarnpkg.com/debian/ stable main" | tee /etc/apt/sources.list.d/yarn.list
RUN curl -sL https://deb.nodesource.com/setup_8.x | bash -
# Install system packages # Install system packages
RUN apt-get update && apt-get upgrade -y \ RUN apt-get update && apt-get upgrade -y \
&& apt-get install -y \ && apt-get install -y \

View file

@ -20,7 +20,7 @@ export const config: Config = {
framework: 'jasmine', framework: 'jasmine',
seleniumAddress: 'http://localhost:4444/wd/hub', seleniumAddress: 'http://localhost:4444/wd/hub',
// Uncomment to run tests against local Chrome instance // Uncomment to run tests against local Chrome instance
directConnect: true, // directConnect: true,
capabilities: { capabilities: {
browserName: 'chrome', browserName: 'chrome',
chromeOptions: { chromeOptions: {