Skip to content

Commit

Permalink
1st release e2e test fix
Browse files Browse the repository at this point in the history
  • Loading branch information
angelalvaigle committed Dec 5, 2024
1 parent 478a7f4 commit da3e746
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 11 deletions.
4 changes: 4 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
23 changes: 12 additions & 11 deletions webapp/e2e/test-environment-setup.js
Original file line number Diff line number Diff line change
@@ -1,19 +1,20 @@
const { MongoMemoryServer } = require('mongodb-memory-server');

import { MongoMemoryServer } from 'mongodb-memory-server';

let mongoserver;
let userservice;
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();

0 comments on commit da3e746

Please sign in to comment.