From fc8ba8b84e954b6154f2acc5693d66fce50faa8d Mon Sep 17 00:00:00 2001 From: Antoine Legrand <2t.antoine@gmail.com> Date: Tue, 18 Jul 2017 09:08:33 +0200 Subject: [PATCH] test yarn e2e --- .gitlab-ci.jsonnet | 22 +++++++---- .gitlab-ci.yml | 72 +++++++++++++++++----------------- .gitlab-ci/base_jobs.libsonnet | 2 +- quay-base.dockerfile | 2 +- static/test/protractor.conf.ts | 2 +- 5 files changed, 54 insertions(+), 46 deletions(-) diff --git a/.gitlab-ci.jsonnet b/.gitlab-ci.jsonnet index a762896a6..1e019a38f 100644 --- a/.gitlab-ci.jsonnet +++ b/.gitlab-ci.jsonnet @@ -8,9 +8,10 @@ local stages_list = [ // gitlab-ci stages 'docker_base', 'docker_build', + 'integration', + 'deploy_preview', 'unit_tests', - 'integration', 'docker_release', 'deploy_staging', 'teardown', @@ -100,20 +101,25 @@ local jobs = { // Integration API 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: [ + "sleep 60", "python initdb.py", "sleep 30", - "curl localhost:80/cnr/version", - "sleep 30", - "curl localhost:80", - "sleep 30", - "curl localhost:80/status", + "./node_modules/.bin/webdriver-manager update", + "yarn e2e", ] }, + // Unit-tests with real databases local db_stage = { stage: stages.unit_tests }, local dbname = 'quay', diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 8f66e8101..f95638538 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -14,7 +14,7 @@ container-base-build: tags: - kubernetes variables: - DOCKER_DRIVER: overlay + DOCKER_DRIVER: overlay2 DOCKER_HOST: tcp://docker-host.gitlab-runner.svc.cluster.local:2375 container-build: before_script: @@ -31,7 +31,7 @@ container-build: tags: - kubernetes variables: - DOCKER_DRIVER: overlay + DOCKER_DRIVER: overlay2 DOCKER_HOST: tcp://docker-host.gitlab-runner.svc.cluster.local:2375 container-release: before_script: @@ -48,39 +48,8 @@ container-release: tags: - kubernetes variables: - DOCKER_DRIVER: overlay + DOCKER_DRIVER: overlay2 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: before_script: - appr login -u $DOCKER_USER -p $DOCKER_PASS quay.io @@ -222,9 +191,9 @@ registry-tests: stages: - docker_base - docker_build +- integration - deploy_preview - unit_tests -- integration - docker_release - deploy_staging - teardown @@ -273,3 +242,36 @@ unit-tests: TEST: 'true' variables: 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 diff --git a/.gitlab-ci/base_jobs.libsonnet b/.gitlab-ci/base_jobs.libsonnet index c79d6fd50..550c00320 100644 --- a/.gitlab-ci/base_jobs.libsonnet +++ b/.gitlab-ci/base_jobs.libsonnet @@ -3,7 +3,7 @@ function(vars={}) dockerBuild: { // base job to manage containers (build / push) variables: { - DOCKER_DRIVER: "overlay", + DOCKER_DRIVER: "overlay2", DOCKER_HOST: "tcp://docker-host.gitlab-runner.svc.cluster.local:2375" }, diff --git a/quay-base.dockerfile b/quay-base.dockerfile index 996469cde..3d3c1240b 100644 --- a/quay-base.dockerfile +++ b/quay-base.dockerfile @@ -18,7 +18,7 @@ RUN add-apt-repository ppa:nginx/development # Add Yarn repository until it is officially added to Ubuntu 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 - +RUN curl -sL https://deb.nodesource.com/setup_8.x | bash - # Install system packages RUN apt-get update && apt-get upgrade -y \ && apt-get install -y \ diff --git a/static/test/protractor.conf.ts b/static/test/protractor.conf.ts index e69f9753d..864b37642 100644 --- a/static/test/protractor.conf.ts +++ b/static/test/protractor.conf.ts @@ -20,7 +20,7 @@ export const config: Config = { framework: 'jasmine', seleniumAddress: 'http://localhost:4444/wd/hub', // Uncomment to run tests against local Chrome instance - directConnect: true, + // directConnect: true, capabilities: { browserName: 'chrome', chromeOptions: {