From 04ccca91d6d451466900da9bc8eecc3d578a5423 Mon Sep 17 00:00:00 2001 From: MathieuSevignyLavallee <89943988+MathieuSevignyLavallee@users.noreply.github.com> Date: Tue, 10 Dec 2024 13:32:18 -0500 Subject: [PATCH] ajustement --- .gitignore | 2 +- test/stressTest/.dockerignore | 3 ++- test/stressTest/.env.example | 3 +-- test/stressTest/docker-compose.yml | 9 +++++---- test/stressTest/main.js | 2 +- 5 files changed, 10 insertions(+), 9 deletions(-) diff --git a/.gitignore b/.gitignore index 67aa61c..fc43433 100644 --- a/.gitignore +++ b/.gitignore @@ -130,7 +130,7 @@ dist .pnp.* db-backup/ -.env +**/.env .venv deployments /test/stressTest/output diff --git a/test/stressTest/.dockerignore b/test/stressTest/.dockerignore index b512c09..1dcef2d 100644 --- a/test/stressTest/.dockerignore +++ b/test/stressTest/.dockerignore @@ -1 +1,2 @@ -node_modules \ No newline at end of file +node_modules +.env \ No newline at end of file diff --git a/test/stressTest/.env.example b/test/stressTest/.env.example index 0c1763b..f219d36 100644 --- a/test/stressTest/.env.example +++ b/test/stressTest/.env.example @@ -1,6 +1,5 @@ # Target url -BASE_URL=http://msevignyl.duckdns.org - +BASE_URL=http://host.docker.internal # Connection account USER_EMAIL=admin@admin.com USER_PASSWORD=admin diff --git a/test/stressTest/docker-compose.yml b/test/stressTest/docker-compose.yml index 142d9e1..0254219 100644 --- a/test/stressTest/docker-compose.yml +++ b/test/stressTest/docker-compose.yml @@ -7,9 +7,8 @@ services: context: . dockerfile: Dockerfile container_name: stress-test - network_mode: host #environment: - # - BASE_URL=http://127.0.0.1 + # - BASE_URL=http://host.docker.internal # - USER_EMAIL=admin@admin.com # - USER_PASSWORD=admin # - NUMBER_ROOMS=5 @@ -19,7 +18,9 @@ services: # - MESSAGE_RESPONSE_TIMEOUT=5000 # - BATCH_DELAY=1000 # - BATCH_SIZE=10 - #env_file: - # - .env + env_file: + - .env + extra_hosts: + - "host.docker.internal:host-gateway" volumes: - ./output:/app/output \ No newline at end of file diff --git a/test/stressTest/main.js b/test/stressTest/main.js index 63cbe9f..7373be0 100644 --- a/test/stressTest/main.js +++ b/test/stressTest/main.js @@ -9,7 +9,7 @@ import generateMetricsReport from './utility/metrics_generator.js'; dotenv.config(); const config = { - baseUrl: process.env.BASE_URL || 'http://127.0.0.1', + baseUrl: process.env.BASE_URL || 'http://host.docker.internal', auth: { username: process.env.USER_EMAIL || 'admin@admin.com', password: process.env.USER_PASSWORD || 'admin'