Commit ca39ca8b authored by David Burke's avatar David Burke

Try removing the chrome rec ci task

parent 02d0b188
......@@ -3,7 +3,8 @@ services:
- docker:dind
variables:
DOCKER_DRIVER: overlay
DOCKER_DRIVER: overlay2
COMPOSE: docker-compose -f docker-compose.yml -f docker-compose.ci.yml
stages:
- build
......@@ -12,17 +13,11 @@ stages:
- deploy
- pages
before_script:
- docker image load -i image
build:
stage: build
before_script:
- echo
script:
- docker-compose build app
- docker save passitfrontend_app > image
- $COMPOSE build web
- docker save passitfrontend_web > image
artifacts:
paths:
- image
......@@ -32,22 +27,23 @@ lint:
dependencies:
- build
script:
- docker-compose run --no-deps app lint
- docker image load -i image
- $COMPOSE run --no-deps web lint
test:
stage: test
dependencies:
- build
script:
- docker-compose up -d selenium-chrome-rec
- docker-compose run --no-deps app test:docker -- --single-run --progress false
- docker image load -i image
- $COMPOSE up -d selenium-chrome
- $COMPOSE run --no-deps web test:docker -- --single-run --progress false
after_script:
- docker-compose logs --no-color > compose-logs
- docker-compose stop selenium-chrome-rec
- $COMPOSE logs --no-color > compose-logs
- $COMPOSE stop selenium-chrome
artifacts:
paths:
- compose-logs
- rec.flv
when: always
e2e-chrome:
......@@ -55,16 +51,16 @@ e2e-chrome:
dependencies:
- build
script:
- docker-compose up -d app selenium-chrome-rec
- sleep 60
- docker-compose run --no-deps app e2e:docker
- docker image load -i image
- $COMPOSE up -d web selenium-chrome
- sleep 30
- $COMPOSE run --no-deps web e2e:docker
after_script:
- docker-compose logs --no-color > compose-logs
- docker-compose stop selenium-chrome-rec
- $COMPOSE logs --no-color > compose-logs
- $COMPOSE stop selenium-chrome
artifacts:
paths:
- compose-logs
- rec.flv
when: always
retry: 2
......@@ -73,35 +69,35 @@ e2e-firefox:
dependencies:
- build
script:
- docker-compose up -d app selenium-firefox-rec
- sleep 60
- docker-compose run --no-deps -e FIREFOX=true app e2e:docker
- docker image load -i image
- $COMPOSE up -d web selenium-firefox
- sleep 10
- $COMPOSE run --no-deps -e FIREFOX=true web e2e:docker
after_script:
- docker-compose logs --no-color > compose-logs
- docker-compose stop selenium-firefox-rec
- $COMPOSE logs --no-color > compose-logs
- $COMPOSE stop selenium-firefox
artifacts:
paths:
- compose-logs
- rec.flv
when: always
retry: 2
allow_failure: true
e2e-chrome-ext:
stage: test
dependencies:
- build
script:
- docker image load -i image
- ./set_version.sh
- docker-compose up -d api selenium-chrome-rec
- docker-compose run app build:ext -- --progress false
- docker-compose run --no-deps -e EXTENSION=true app e2e:docker
- $COMPOSE up -d api selenium-chrome
- $COMPOSE run web build:ext -- --progress false
- $COMPOSE run --no-deps -e EXTENSION=true web e2e:docker
after_script:
- docker-compose logs --no-color > compose-logs
- docker-compose stop selenium-chrome-rec
- $COMPOSE logs --no-color > compose-logs
- $COMPOSE stop selenium-chrome
artifacts:
paths:
- compose-logs
- rec.flv
when: always
retry: 2
......@@ -110,7 +106,8 @@ build-web-assets:
dependencies:
- build
script:
- docker-compose run --no-deps app build -- --prod --build-optimizer --progress false
- docker image load -i image
- $COMPOSE run --no-deps web build --prod --build-optimizer --progress false
artifacts:
paths:
- dist/
......@@ -120,14 +117,15 @@ build-ext-assets:
dependencies:
- build
script:
- docker image load -i image
- ./set_version.sh
- docker-compose run --no-deps app build:ext -- --prod --build-optimizer --progress false
- docker-compose run --no-deps app ext:lint
- docker-compose run --no-deps app ext:build
- $COMPOSE run --no-deps web build:ext --prod --build-optimizer --progress false
- $COMPOSE run --no-deps web ext:lint
- $COMPOSE run --no-deps web ext:build
- mv web-ext-artifacts/*.zip web-ext-artifacts/passit.zip
- |
if [ $CI_COMMIT_REF_SLUG = "master" ]; then
docker-compose run -e WEB_EXT_API_KEY=$WEB_EXT_API_KEY -e WEB_EXT_API_SECRET=$WEB_EXT_API_SECRET --no-deps app ext:sign
$COMPOSE run -e WEB_EXT_API_KEY=$WEB_EXT_API_KEY -e WEB_EXT_API_SECRET=$WEB_EXT_API_SECRET --no-deps web ext:sign
mv web-ext-artifacts/*.xpi web-ext-artifacts/passit.xpi
./build-firefox-update-manifest > web-ext-artifacts/firefox-update-manifest.json
fi
......@@ -147,6 +145,7 @@ build-push-docker:
before_script:
- echo
script:
- docker image load -i image
- docker build -f Dockerfile.prod -t ${CI_REGISTRY_IMAGE}:${CI_COMMIT_REF_NAME} .
- docker login -u gitlab-ci-token -p $CI_BUILD_TOKEN registry.gitlab.com
- docker push ${CI_REGISTRY_IMAGE}:${CI_COMMIT_REF_NAME}
......@@ -185,7 +184,8 @@ pages:
dependencies:
- build
script:
- docker-compose run --no-deps -v public:$PWD/public app compodoc-gitlab
- docker image load -i image
- $COMPOSE run --no-deps -v public:$PWD/public web compodoc-gitlab
artifacts:
paths:
- public
......
version: '2'
services:
selenium-chrome:
image: selenium/standalone-chrome:3.8
volumes:
- /dev/shm:/dev/shm
# so it can load extension
- .:/dist
selenium-firefox:
image: selenium/standalone-firefox:3.8
volumes:
- /dev/shm:/dev/shm
version: '2'
services:
selenium-chrome:
image: selenium/standalone-chrome-debug:3.8
ports:
- "5900:5900"
volumes:
- /dev/shm:/dev/shm
# so it can load extension
- .:/dist
selenium-firefox:
image: selenium/standalone-firefox-debug:3.8
ports:
- "5900:5900"
volumes:
- /dev/shm:/dev/shm
version: '2'
services:
app:
web:
build: .
volumes:
- .:/dist
command: start -- --environment=docker --disable-host-check
command: start --environment=docker --disable-host-check
ports:
- "4200:4200"
- "4201:4201"
......@@ -26,36 +26,3 @@ services:
- db
db:
image: postgres:9.6
selenium-chrome:
image: selenium/standalone-chrome-debug:3.7.0
ports:
- "5900:5900"
volumes:
- /dev/shm:/dev/shm
# so it can load extension
- .:/dist
selenium-firefox:
image: selenium/standalone-firefox-debug:3.7.0
ports:
- "5900:5900"
volumes:
- /dev/shm:/dev/shm
# so we can record what happens during selenium tests in CI
selenium-chrome-rec:
image: saulshanabrook/vnc2flv
command: ./wait-for selenium-chrome:5900 -- flvrec.py -o /tmp/output/rec.flv -P pwd selenium-chrome 5900
volumes:
- .:/tmp/output/
depends_on:
- selenium-chrome
environment:
PASSWORD: secret
selenium-firefox-rec:
image: saulshanabrook/vnc2flv
command: ./wait-for selenium-firefox:5900 -- flvrec.py -o /tmp/output/rec.flv -P pwd selenium-firefox 5900
volumes:
- .:/tmp/output/
depends_on:
- selenium-firefox
environment:
PASSWORD: secret
......@@ -2,7 +2,7 @@ import { browser, by, element } from "protractor";
import { ExpectedConditions as EC } from "protractor";
import { ConfirmEmailPage, isExtension, LoginPage, RegisterPage } from "./app.po";
export const SERVER_URL = "http://api:8000";
const SERVER_URL = "http://api:8000";
export async function register(testBrowser: any, username: string, password: string,
passwordConfirm: string, url = SERVER_URL) {
......
......@@ -19,18 +19,13 @@ exports.config = {
} : {
'browserName': 'chrome',
'chromeOptions': {
'args': EXTENSION ? ['--no-sandbox', `--load-extension=/dist/dist/`] : ['--no-sandbox'],
'localState': {
"browser": {
"enabled_labs_experiments": ["enable-asm-webassembly@1"]
}
}
'args': EXTENSION ? ['--no-sandbox', `--load-extension=/dist/dist/`] : ['--no-sandbox']
}
},
directConnect: !DOCKER,
// chrome extension ID remain constant if the path to the ext remains constant
// https://stackoverflow.com/a/26058672
baseUrl: EXTENSION ? 'chrome-extension://hncijbkokpgjokbcdmcelmfndciahmkf/index.html#/' : (DOCKER ? 'http://app:4200/' : 'http://localhost:4200/'),
baseUrl: EXTENSION ? 'chrome-extension://hncijbkokpgjokbcdmcelmfndciahmkf/index.html#/' : (DOCKER ? 'http://web:4200/' : 'http://localhost:4200/'),
seleniumAddress: DOCKER ? `http://selenium-${FIREFOX ? 'firefox' : 'chrome'}:4444/wd/hub/` : undefined,
framework: 'jasmine',
jasmineNodeOpts: {
......
......@@ -23,7 +23,7 @@ if (environment.hasOwnProperty("api_url")) {
}
// if acccessing via e2e tests in docker
if (environment.docker && window.location.hostname === "app") {
if (environment.docker && window.location.hostname === "web") {
API_URL = "http://api:8000/api/";
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment