Cypress upgrade

This commit is contained in:
Jamie Curnow 2024-05-21 13:06:24 +10:00
parent 52bd7b1d8f
commit ac0074ea86
No known key found for this signature in database
GPG Key ID: FFBB624C43388E9E
13 changed files with 389 additions and 284 deletions

4
Jenkinsfile vendored
View File

@ -29,10 +29,8 @@ pipeline {
BUILD_COMMIT = getCommit() BUILD_COMMIT = getCommit()
MAJOR_VERSION = '3' MAJOR_VERSION = '3'
BRANCH_LOWER = "${BRANCH_NAME.toLowerCase().replaceAll('\\\\', '-').replaceAll('/', '-').replaceAll('\\.', '-')}" BRANCH_LOWER = "${BRANCH_NAME.toLowerCase().replaceAll('\\\\', '-').replaceAll('/', '-').replaceAll('\\.', '-')}"
COMPOSE_PROJECT_NAME = "npm_${BRANCH_LOWER}_${BUILD_NUMBER}" BUILDX_NAME = "npm_${BRANCH_LOWER}_${BUILD_NUMBER}"
COMPOSE_FILE = 'docker/docker-compose.ci.yml'
COMPOSE_INTERACTIVE_NO_CLI = 1 COMPOSE_INTERACTIVE_NO_CLI = 1
BUILDX_NAME = "${COMPOSE_PROJECT_NAME}"
} }
stages { stages {
stage('Environment') { stage('Environment') {

View File

@ -1,5 +1,4 @@
# WARNING: This is a CI docker-compose file used for building and testing of the entire app, it should not be used for production. # WARNING: This is a CI docker-compose file used for building and testing of the entire app, it should not be used for production.
version: '3.8'
services: services:
fullstack: fullstack:

View File

@ -1,5 +1,4 @@
# WARNING: This is a CI docker-compose file used for building and testing of the entire app, it should not be used for production. # WARNING: This is a CI docker-compose file used for building and testing of the entire app, it should not be used for production.
version: '3.8'
services: services:
fullstack: fullstack:

View File

@ -1,9 +1,9 @@
# WARNING: This is a CI docker-compose file used for building and testing of the entire app, it should not be used for production. # WARNING: This is a CI docker-compose file used for building
version: '3.8' # and testing of the entire app, it should not be used for production.
services: services:
fullstack: fullstack:
image: ${IMAGE}:${BRANCH_LOWER}-ci-${BUILD_NUMBER} image: "${IMAGE}:${BRANCH_LOWER}-ci-${BUILD_NUMBER}"
environment: environment:
NPM_DB_DRIVER: 'sqlite' NPM_DB_DRIVER: 'sqlite'
NPM_LOG_LEVEL: 'debug' NPM_LOG_LEVEL: 'debug'
@ -11,9 +11,9 @@ services:
NPM_DISABLE_IPV6: 'true' NPM_DISABLE_IPV6: 'true'
volumes: volumes:
- '/etc/localtime:/etc/localtime:ro' - '/etc/localtime:/etc/localtime:ro'
- npm_data_ci:/data - 'npm_data_ci:/data'
- ../docs:/temp-docs - '../docs:/temp-docs'
- ./dev/resolv.conf:/etc/resolv.conf:ro - './dev/resolv.conf:/etc/resolv.conf:ro'
networks: networks:
default: default:
aliases: aliases:
@ -67,7 +67,7 @@ services:
MYSQL_USER: 'pdns' MYSQL_USER: 'pdns'
MYSQL_PASSWORD: 'pdns' MYSQL_PASSWORD: 'pdns'
volumes: volumes:
- pdns_mysql_vol:/var/lib/mysql - 'pdns_mysql_vol:/var/lib/mysql'
- '/etc/localtime:/etc/localtime:ro' - '/etc/localtime:/etc/localtime:ro'
- './dev/pdns-db.sql:/docker-entrypoint-initdb.d/01_init.sql:ro' - './dev/pdns-db.sql:/docker-entrypoint-initdb.d/01_init.sql:ro'
@ -77,18 +77,18 @@ services:
- ./dev/dnsrouter-config.json.tmp:/dnsrouter-config.json:ro - ./dev/dnsrouter-config.json.tmp:/dnsrouter-config.json:ro
cypress: cypress:
image: ${IMAGE}-cypress:ci-${BUILD_NUMBER} image: "${IMAGE}-cypress:ci-${BUILD_NUMBER}"
build: build:
context: ../ context: ../
dockerfile: test/cypress/Dockerfile dockerfile: test/cypress/Dockerfile
environment: environment:
CYPRESS_baseUrl: "http://fullstack:81" CYPRESS_baseUrl: 'http://fullstack:81'
volumes: volumes:
- cypress-logs:/results - 'cypress_logs:/results'
- ./dev/resolv.conf:/etc/resolv.conf:ro - './dev/resolv.conf:/etc/resolv.conf:ro'
command: cypress run --browser chrome --config-file=${CYPRESS_CONFIG:-cypress/config/ci.js} command: cypress run --browser chrome --config-file=cypress/config/ci.js
volumes: volumes:
cypress-logs: cypress_logs:
npm_data_ci: npm_data_ci:
pdns_mysql_vol: pdns_mysql_vol:

View File

@ -1,5 +1,4 @@
# WARNING: This is a DEVELOPMENT docker-compose file used for development of the entire app, it should not be used for production. # WARNING: This is a DEVELOPMENT docker-compose file used for development of the entire app, it should not be used for production.
version: '3.8'
services: services:
npm: npm:

View File

@ -58,7 +58,8 @@ rm -rf "${LOCAL_RESOLVE}"
printf "nameserver %s\noptions ndots:0" "${DNSROUTER_IP}" > "${LOCAL_RESOLVE}" printf "nameserver %s\noptions ndots:0" "${DNSROUTER_IP}" > "${LOCAL_RESOLVE}"
# bring up all remaining containers, except cypress! # bring up all remaining containers, except cypress!
docker-compose up -d --remove-orphans fullstack stepca docker-compose up -d --remove-orphans stepca
docker-compose up -d --remove-orphans --pull=never fullstack
# wait for main container to be healthy # wait for main container to be healthy
bash "$DIR/../wait-healthy" "$(docker-compose ps --all -q fullstack)" 120 bash "$DIR/../wait-healthy" "$(docker-compose ps --all -q fullstack)" 120

View File

@ -1,4 +1,4 @@
FROM cypress/included:12.13.0 FROM cypress/included:13.9.0
COPY --chown=1000 ./test /test COPY --chown=1000 ./test /test

View File

@ -7,15 +7,16 @@ module.exports = defineConfig({
reporterOptions: { reporterOptions: {
configFile: 'multi-reporter.json' configFile: 'multi-reporter.json'
}, },
video: true,
videosFolder: 'results/videos', videosFolder: 'results/videos',
screenshotsFolder: 'results/screenshots', screenshotsFolder: 'results/screenshots',
env: { e2e: {
swaggerBase: '{{baseUrl}}/api/schema',
RETRIES: 4
},
e2e: {
setupNodeEvents(on, config) { setupNodeEvents(on, config) {
return require('../plugins/index.js')(on, config); return require('../plugins/index.js')(on, config);
}, },
} env: {
swaggerBase: '{{baseUrl}}/api/schema',
},
baseUrl: 'http://localhost:1234',
},
}); });

View File

@ -7,16 +7,14 @@ module.exports = defineConfig({
reporterOptions: { reporterOptions: {
configFile: 'multi-reporter.json' configFile: 'multi-reporter.json'
}, },
videos: false, video: false,
screenshotsFolder: 'results/screenshots', screenshotsFolder: 'results/screenshots',
env: { e2e: {
swaggerBase: '{{baseUrl}}/api/schema',
RETRIES: 0
},
e2e: {
// baseUrl: '{{baseUrl}}',
setupNodeEvents(on, config) { setupNodeEvents(on, config) {
return require('../plugins/index.js')(on, config); return require('../plugins/index.js')(on, config);
}, },
env: {
swaggerBase: '{{baseUrl}}/api/schema',
},
} }
}); });

View File

@ -1,5 +0,0 @@
{
"name": "Using fixtures to represent data",
"email": "hello@cypress.io",
"body": "Fixtures are a great way to mock data for responses to routes"
}

View File

@ -19,7 +19,6 @@ Cypress.Commands.add('randomString', (length) => {
result += characters.charAt(Math.floor(Math.random() * charactersLength)); result += characters.charAt(Math.floor(Math.random() * charactersLength));
} }
return result; return result;
// cy.wrap(result);
}); });
/** /**

View File

@ -4,19 +4,19 @@
"description": "", "description": "",
"main": "index.js", "main": "index.js",
"dependencies": { "dependencies": {
"@jc21/cypress-swagger-validation": "^0.2.1", "@jc21/cypress-swagger-validation": "^0.2.6",
"@jc21/restler": "^3.4.0", "@jc21/restler": "^3.4.0",
"chalk": "^4.1.0", "chalk": "^4.1.0",
"cypress": "^12.13.0", "cypress": "^13.9.0",
"cypress-multi-reporters": "^1.6.3", "cypress-multi-reporters": "^1.6.4",
"cypress-wait-until": "^1.7.2", "cypress-wait-until": "^3.0.1",
"eslint": "^8.41.0", "eslint": "^9.3.0",
"eslint-plugin-align-assignments": "^1.1.2", "eslint-plugin-align-assignments": "^1.1.2",
"eslint-plugin-chai-friendly": "^0.7.2", "eslint-plugin-chai-friendly": "^0.7.4",
"eslint-plugin-cypress": "^2.13.3", "eslint-plugin-cypress": "^3.2.0",
"lodash": "^4.17.21", "lodash": "^4.17.21",
"mocha": "^10.2.0", "mocha": "^10.4.0",
"mocha-junit-reporter": "^2.2.0" "mocha-junit-reporter": "^2.2.1"
}, },
"scripts": { "scripts": {
"cypress": "cypress open --config-file=cypress/config/dev.js --config baseUrl=${BASE_URL:-http://127.0.0.1:3081}", "cypress": "cypress open --config-file=cypress/config/dev.js --config baseUrl=${BASE_URL:-http://127.0.0.1:3081}",

File diff suppressed because it is too large Load Diff