diff --git a/Jenkinsfile b/Jenkinsfile index aa734c73a..6d46efad5 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -42,8 +42,7 @@ pipeline { // sh "docker network ls | grep testing-\${env.STACK_NAME} | awk '{print \$1}' | xargs -r docker network rm" sh "docker network ls | grep testing-salix-5739 | awk '{print \$1}' | xargs -r docker network rm" sh "docker-compose -p testing-${env.STACK_NAME} -f docker-compose.test.yml rm --stop" - sh "docker-compose -p testing-${env.STACK_NAME} -f docker-compose.test.yml build --force-rm db" - sh "docker-compose -p testing-${env.STACK_NAME} -f docker-compose.test.yml build back" //Front depends on this image + sh "docker-compose -p testing-${env.STACK_NAME} -f docker-compose.test.yml build --force-rm db back" } } stage('Test') { diff --git a/back/tests.js b/back/tests.js index 2a87c0f13..f61cf543a 100644 --- a/back/tests.js +++ b/back/tests.js @@ -22,7 +22,8 @@ async function test() { isCI = true; dataSources = JSON.parse(JSON.stringify(dataSources)); - + // dataSources.vn.port = 3308; + // dataSources.vn.host = 'db'; const bootOptions = {dataSources}; const app = require('vn-loopback/server/server'); await new Promise((resolve, reject) => { diff --git a/docker-compose.test.yml b/docker-compose.test.yml index ebede3111..f1222f549 100644 --- a/docker-compose.test.yml +++ b/docker-compose.test.yml @@ -19,11 +19,13 @@ services: context: db dockerfile: Dockerfile ports: - - 3306:3306 + - 3308:3306 front: image: front restart: always command: ["npx", "jest", "--ci", "--maxWorkers=2"] + ports: + - 5000:5000 build: context: . dockerfile: front/Dockerfile.test @@ -41,16 +43,16 @@ services: - NODE_ENV depends_on: - db - # e2e: - # image: e2e - # restart: always - # build: - # context: . - # dockerfile: e2e/Dockerfile - # environment: - # - NODE_ENV - # depends_on: - # - front + e2e: + image: e2e + restart: always + build: + context: . + dockerfile: e2e/Dockerfile + environment: + - NODE_ENV + depends_on: + - front # networks: # stack-network: diff --git a/e2e/helpers/config.js b/e2e/helpers/config.js index 3ac97f063..7c552f866 100644 --- a/e2e/helpers/config.js +++ b/e2e/helpers/config.js @@ -1,3 +1,3 @@ module.exports = { - url: 'http://back:5000' + url: 'back:5000' }; diff --git a/e2e/helpers/tests.js b/e2e/helpers/tests.js index 007164f1a..d40dd75af 100644 --- a/e2e/helpers/tests.js +++ b/e2e/helpers/tests.js @@ -56,7 +56,7 @@ async function test() { } async function backendStatus() { - log('Awaiting backend connection2...'); + log('Awaiting backend connection...'); const milliseconds = 1000; const maxAttempts = 10; diff --git a/modules/route/back/models/routesMonitor.json b/modules/route/back/models/routesMonitor.json index e5a0f6062..944d4e679 100644 --- a/modules/route/back/models/routesMonitor.json +++ b/modules/route/back/models/routesMonitor.json @@ -1,10 +1,8 @@ { "name": "RoutesMonitor", - "base": "Loggable", - "options": { - "mysql": { - "table": "routesMonitor" - } + "base": "VnModel", + "mixins": { + "Loggable": true }, "properties": { "routeFk": { diff --git a/runTestE2E.sh b/runTestE2E.sh index 832443575..fde3e3383 100644 --- a/runTestE2E.sh +++ b/runTestE2E.sh @@ -2,6 +2,7 @@ docker-compose -p salix-test -f docker-compose.test.yml build --force-rm db docker-compose -p salix-test -f docker-compose.test.yml build --force-rm back docker-compose -p salix-test -f docker-compose.test.yml build --force-rm front docker-compose -p salix-test -f docker-compose.test.yml build --force-rm e2e -docker-compose -p salix-test -f docker-compose.test.yml run e2e #--rm +docker-compose -p salix-test -f docker-compose.test.yml run e2e #--rm +docker-compose -p salix-testing -f docker-compose.test.yml rm -s -v -f # docker-compose -p salix-test -f docker-compose.test.yml down # docker-compose -p salix-test -f docker-compose.test.yml rm