From 5be46b4b20817f79b65cd227d3daffe0578931e6 Mon Sep 17 00:00:00 2001 From: Jamie Curnow Date: Thu, 6 Aug 2020 11:26:37 +1000 Subject: [PATCH] Cypress fixes --- Jenkinsfile | 12 ++++++------ docker/docker-compose.ci.yml | 15 +++++++++++++-- 2 files changed, 19 insertions(+), 8 deletions(-) diff --git a/Jenkinsfile b/Jenkinsfile index 711d7bb3..ce444deb 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -91,9 +91,9 @@ pipeline { // Run tests sh 'rm -rf test/results' - sh 'docker-compose up cypress' + sh 'docker-compose up cypress-sqlite' // Get results - sh 'docker cp -L "$(docker-compose ps -q cypress):/results" test/' + sh 'docker cp -L "$(docker-compose ps -q cypress-sqlite):/results" test/' } post { always { @@ -101,7 +101,7 @@ pipeline { sh 'mkdir -p debug' sh 'docker-compose logs fullstack-sqlite | gzip > debug/docker_fullstack_sqlite.log.gz' sh 'docker-compose logs db | gzip > debug/docker_db.log.gz' - sh 'docker-compose down' + sh 'docker-compose down --rmi all --remove-orphans --volumes -t 30' // Cypress videos and screenshot artifacts dir(path: 'test/results') { archiveArtifacts allowEmptyArchive: true, artifacts: '**/*', excludes: '**/*.xml' @@ -118,9 +118,9 @@ pipeline { // Run tests sh 'rm -rf test/results' - sh 'docker-compose up cypress' + sh 'docker-compose up cypress-mysql' // Get results - sh 'docker cp -L "$(docker-compose ps -q cypress):/results" test/' + sh 'docker cp -L "$(docker-compose ps -q cypress-mysql):/results" test/' } post { always { @@ -128,7 +128,7 @@ pipeline { sh 'mkdir -p debug' sh 'docker-compose logs fullstack-mysql | gzip > debug/docker_fullstack_mysql.log.gz' sh 'docker-compose logs db | gzip > debug/docker_db.log.gz' - sh 'docker-compose down' + sh 'docker-compose down --rmi all --remove-orphans --volumes -t 30' // Cypress videos and screenshot artifacts dir(path: 'test/results') { archiveArtifacts allowEmptyArchive: true, artifacts: '**/*', excludes: '**/*.xml' diff --git a/docker/docker-compose.ci.yml b/docker/docker-compose.ci.yml index 5adace32..2228623f 100644 --- a/docker/docker-compose.ci.yml +++ b/docker/docker-compose.ci.yml @@ -40,13 +40,24 @@ services: volumes: - db_data:/var/lib/mysql - cypress: + cypress-mysql: image: ${IMAGE}-cypress:ci-${BUILD_NUMBER} build: context: ../ dockerfile: test/cypress/Dockerfile environment: - CYPRESS_baseUrl: "http://fullstack:81" + CYPRESS_baseUrl: "http://fullstack-mysql:81" + volumes: + - cypress-logs:/results + command: cypress run --browser chrome --config-file=${CYPRESS_CONFIG:-cypress/config/ci.json} + + cypress-sqlite: + image: ${IMAGE}-cypress:ci-${BUILD_NUMBER} + build: + context: ../ + dockerfile: test/cypress/Dockerfile + environment: + CYPRESS_baseUrl: "http://fullstack-sqlite:81" volumes: - cypress-logs:/results command: cypress run --browser chrome --config-file=${CYPRESS_CONFIG:-cypress/config/ci.json}