Jamie Curnow 1 жил өмнө
parent
commit
ac0074ea86

+ 1 - 3
Jenkinsfile

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

+ 0 - 1
docker/docker-compose.ci.mysql.yml

@@ -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.
-version: '3.8'
 services:
 
   fullstack:

+ 0 - 1
docker/docker-compose.ci.postgres.yml

@@ -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.
-version: '3.8'
 services:
 
   fullstack:

+ 13 - 13
docker/docker-compose.ci.yml

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

+ 0 - 1
docker/docker-compose.dev.yml

@@ -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.
-version: '3.8'
 services:
 
   npm:

+ 2 - 1
scripts/ci/fulltest-cypress

@@ -58,7 +58,8 @@ rm -rf "${LOCAL_RESOLVE}"
 printf "nameserver %s\noptions ndots:0" "${DNSROUTER_IP}" > "${LOCAL_RESOLVE}"
 
 # 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
 bash "$DIR/../wait-healthy" "$(docker-compose ps --all -q fullstack)" 120

+ 1 - 1
test/cypress/Dockerfile

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

+ 7 - 6
test/cypress/config/ci.js

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

+ 5 - 7
test/cypress/config/dev.js

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

+ 0 - 5
test/cypress/fixtures/example.json

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

+ 0 - 1
test/cypress/support/commands.js

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

+ 9 - 9
test/package.json

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

Файлын зөрүү хэтэрхий том тул дарагдсан байна
+ 332 - 229
test/yarn.lock


Энэ ялгаанд хэт олон файл өөрчлөгдсөн тул зарим файлыг харуулаагүй болно