From da3e746462497dd31a22442def4f2e23c9881098 Mon Sep 17 00:00:00 2001 From: angelalvaigle Date: Thu, 5 Dec 2024 01:35:45 +0100 Subject: [PATCH] 1st release e2e test fix --- .github/workflows/release.yml | 4 ++++ webapp/e2e/test-environment-setup.js | 23 ++++++++++++----------- 2 files changed, 16 insertions(+), 11 deletions(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 9a23109..e8584d4 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -52,7 +52,11 @@ jobs: - run: npm --prefix gatewayservice install - run: npm --prefix webapp install - run: npm --prefix webapp run build + env: + CI: false - run: npm --prefix webapp run test:e2e + env: + CI: false docker-push-webapp: name: Push webapp Docker Image to GitHub Packages runs-on: ubuntu-latest diff --git a/webapp/e2e/test-environment-setup.js b/webapp/e2e/test-environment-setup.js index 7b7ed51..39dd2d1 100644 --- a/webapp/e2e/test-environment-setup.js +++ b/webapp/e2e/test-environment-setup.js @@ -1,5 +1,4 @@ -const { MongoMemoryServer } = require('mongodb-memory-server'); - +import { MongoMemoryServer } from 'mongodb-memory-server'; let mongoserver; let userservice; @@ -7,13 +6,15 @@ let authservice; let gatewayservice; async function startServer() { - console.log('Starting MongoDB memory server...'); - mongoserver = await MongoMemoryServer.create(); - const mongoUri = mongoserver.getUri(); - process.env.MONGODB_URI = mongoUri; - userservice = await require("../../users/userservice/user-service"); - authservice = await require("../../users/authservice/auth-service"); - gatewayservice = await require("../../gatewayservice/gateway-service"); - } + console.log('Starting MongoDB memory server...'); + mongoserver = await MongoMemoryServer.create(); + const mongoUri = mongoserver.getUri(); + process.env.MONGODB_URI = mongoUri; + + userservice = (await import('../../users/userservice/user-service')).default; + authservice = (await import('../../users/authservice/auth-service')).default; + gatewayservice = (await import('../../gatewayservice/gateway-service')) + .default; +} - startServer(); +startServer();