From 8d9a28acbd25e953c620f8c7b9a72697628c0ec3 Mon Sep 17 00:00:00 2001 From: Markus Tacker Date: Tue, 21 Jan 2025 13:30:32 +0100 Subject: [PATCH] test(e2e): fix execution --- .github/workflows/test-and-release.yaml | 1 + e2e-tests/vite.config.e2e.ts | 10 ++++++---- 2 files changed, 7 insertions(+), 4 deletions(-) diff --git a/.github/workflows/test-and-release.yaml b/.github/workflows/test-and-release.yaml index ade46e2b..ecb70ee0 100644 --- a/.github/workflows/test-and-release.yaml +++ b/.github/workflows/test-and-release.yaml @@ -92,6 +92,7 @@ jobs: MAP_REGION: ${{ vars.MAP_REGION }} MAP_NAME: ${{ vars.MAP_NAME }} MAP_API_KEY: ${{ vars.MAP_API_KEY }} + REGISTRY_ENDPOINT: http://localhost:8080/e2e/registry.json run: npm run test:e2e # This generates a string containing the current date which is used in diff --git a/e2e-tests/vite.config.e2e.ts b/e2e-tests/vite.config.e2e.ts index 59ffc34a..e1388075 100644 --- a/e2e-tests/vite.config.e2e.ts +++ b/e2e-tests/vite.config.e2e.ts @@ -5,22 +5,24 @@ import { createContext } from './lib/mock-backend/context.js' import { mockWebsocket } from './lib/mock-backend/mockWebsocket.js' import { testdataServerPlugin } from './lib/testDataServerPlugin.js' -const { mapRegion, mapName, mapApiKey } = fromEnv({ +const { mapRegion, mapName, mapApiKey, registryEndpoint } = fromEnv({ mapRegion: 'MAP_REGION', mapName: 'MAP_NAME', mapApiKey: 'MAP_API_KEY', + registryEndpoint: 'REGISTRY_ENDPOINT', })(process.env) const context = createContext(join(process.cwd(), 'db')) -const base = 'http://localhost:8080' +const domainName = 'localhost:8080' +const base = `http://${domainName}` const wsPort = 1024 + Math.floor(Math.random() * (65535 - 1024)) mockWebsocket(wsPort, context) export default createConfig({ - domainName: 'localhost:8080', - registryEndpoint: new URL('/e2e/registry.json', base), + domainName, + registryEndpoint: new URL(registryEndpoint), plugins: [ testdataServerPlugin({ registry: {