From c2db9ede35bdf668ad8b5673e6340fdf3fc60f51 Mon Sep 17 00:00:00 2001 From: Hemang Date: Thu, 6 Feb 2025 17:11:07 +0100 Subject: [PATCH] Change the network name and the .env.test file so that test explorer proxy can communicate with the test explorer backend app-api. --- run.sh | 4 ++-- tests/.env.test | 5 ++++- tests/docker-compose.test.yml | 20 ++++++++++---------- 3 files changed, 16 insertions(+), 13 deletions(-) diff --git a/run.sh b/run.sh index 6a06d77..2a5211d 100755 --- a/run.sh +++ b/run.sh @@ -25,8 +25,8 @@ tests() { echo "Setting up test environment..." # Ensure test network exists - docker network inspect invariant-explorer-web-test >/dev/null 2>&1 || \ - docker network create invariant-explorer-web-test + docker network inspect invariant-proxy-web-test >/dev/null 2>&1 || \ + docker network create invariant-proxy-web-test # Setup the explorer.test.yml file CONFIG_DIR="/tmp/invariant-proxy-test/configs" diff --git a/tests/.env.test b/tests/.env.test index d0b7167..f52d757 100644 --- a/tests/.env.test +++ b/tests/.env.test @@ -1,4 +1,7 @@ -INVARIANT_API_URL=http://127.0.0.1 +# To push traces to the local instance of the explorer app-api +# from the proxy. Both proxy and app-api are on the same network: +# invariant-proxy-web-test +INVARIANT_API_URL=http://explorer-proxy-test-app-api:8000 POSTGRES_USER=postgres POSTGRES_PASSWORD=postgres diff --git a/tests/docker-compose.test.yml b/tests/docker-compose.test.yml index 92f0377..dd46370 100644 --- a/tests/docker-compose.test.yml +++ b/tests/docker-compose.test.yml @@ -10,16 +10,16 @@ services: # on the entry point named traefik. - --api.insecure=true # Define Traefik entry points to port [80] for http and port [443] for https. - - --entrypoints.invariant-explorer-web-test.address=0.0.0.0:80 + - --entrypoints.invariant-proxy-web-test.address=0.0.0.0:80 networks: - - invariant-explorer-web-test + - invariant-proxy-web-test ports: - '${PORT_HTTP:-80}:80' volumes: - /var/run/docker.sock:/var/run/docker.sock labels: - "traefik.enable=true" - - "traefik.http.routers.traefik-http.entrypoints=invariant-explorer-web-test" + - "traefik.http.routers.traefik-http.entrypoints=invariant-proxy-web-test" explorer-proxy: container_name: explorer-proxy-test @@ -39,14 +39,14 @@ services: source: ../proxy target: /srv/proxy networks: - - invariant-explorer-web-test + - invariant-proxy-web-test ports: [] labels: - "traefik.enable=true" - "traefik.http.routers.explorer-proxy-api.rule=(Host(`localhost`) && PathPrefix(`/api/v1/proxy/`)) || (Host(`127.0.0.1`) && PathPrefix(`/api/v1/proxy/`))" - - "traefik.http.routers.explorer-proxy-api.entrypoints=invariant-explorer-web-test" + - "traefik.http.routers.explorer-proxy-api.entrypoints=invariant-proxy-web-test" - "traefik.http.services.explorer-proxy-api.loadbalancer.server.port=8000" - - "traefik.docker.network=invariant-explorer-web-test" + - "traefik.docker.network=invariant-proxy-web-test" healthcheck: test: curl -X GET -I http://localhost:8000/api/v1/proxy/health --fail interval: 1s @@ -73,15 +73,15 @@ services: - PORT_API=80 networks: - internal - - invariant-explorer-web-test + - invariant-proxy-web-test volumes: - /tmp/invariant-proxy-test/configs/explorer.test.yml:/config/explorer.config.yml labels: - "traefik.enable=true" - "traefik.http.routers.explorer-test-api.rule=(Host(`localhost`) && PathPrefix(`/api/`)) || (Host(`127.0.0.1`) && PathPrefix(`/api/`))" - - "traefik.http.routers.explorer-test-api.entrypoints=invariant-explorer-web-test" + - "traefik.http.routers.explorer-test-api.entrypoints=invariant-proxy-web-test" - "traefik.http.services.explorer-test-api.loadbalancer.server.port=8000" - - "traefik.docker.network=invariant-explorer-web-test" + - "traefik.docker.network=invariant-proxy-web-test" healthcheck: test: curl -X GET -I http://localhost:8000/api/v1 --fail interval: 1s @@ -105,6 +105,6 @@ services: retries: 5 networks: - invariant-explorer-web-test: + invariant-proxy-web-test: external: true internal: