Change the network name and the .env.test file so that test explorer proxy can communicate with the test explorer backend app-api.

This commit is contained in:
Hemang
2025-02-06 17:11:07 +01:00
parent f5ddbb25d5
commit c2db9ede35
3 changed files with 16 additions and 13 deletions
+2 -2
View File
@@ -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"
+4 -1
View File
@@ -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
+10 -10
View File
@@ -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: