Files
tribes-plugin-supertest/test/e2e/compose.supertest.yaml
T
self e45ec84341 test: cover plugin metrics rollups
Add a supertest metrics probe that emits telemetry, configure vmagent sidecars in the Docker e2e stack, and assert the emitted plugin metric reaches synced rollups through the admin API.
2026-05-14 15:25:41 +02:00

146 lines
4.8 KiB
YAML

services:
db-origin:
image: postgres:17
environment:
POSTGRES_USER: postgres
POSTGRES_PASSWORD: postgres
POSTGRES_DB: postgres
healthcheck:
test: ["CMD-SHELL", "pg_isready -U postgres"]
interval: 2s
timeout: 3s
retries: 30
db-peer:
image: postgres:17
environment:
POSTGRES_USER: postgres
POSTGRES_PASSWORD: postgres
POSTGRES_DB: postgres
healthcheck:
test: ["CMD-SHELL", "pg_isready -U postgres"]
interval: 2s
timeout: 3s
retries: 30
vm-origin:
image: victoriametrics/victoria-metrics:v1.138.0
command:
- -storageDataPath=/victoria-metrics-data
- -httpListenAddr=:8428
ports:
- "48101:8428"
vm-peer:
image: victoriametrics/victoria-metrics:v1.138.0
command:
- -storageDataPath=/victoria-metrics-data
- -httpListenAddr=:8428
ports:
- "48102:8428"
migrate-origin:
image: ${TRIBES_SUPERTEST_IMAGE:-tribes-supertest-e2e:latest}
depends_on:
db-origin:
condition: service_healthy
environment: &origin_env
MIX_ENV: prod
PHX_SERVER: "true"
PORT: "4000"
PHX_HOST: supertest-origin
DATABASE_URL: ecto://postgres:postgres@db-origin:5432/tribes_origin
PARRHESIA_DATABASE_URL: ecto://postgres:postgres@db-origin:5432/parrhesia_origin
SECRET_KEY_BASE: aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
TOKEN_SIGNING_SECRET: supertest-e2e-token-secret
PARRHESIA_RELAY_URL: ws://supertest-origin:4000/nostr/relay
PARRHESIA_IDENTITY_PRIVATE_KEY: aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
TRIBES_VICTORIAMETRICS_URL: http://vm-origin:8428
TRIBES_METRICS_ALLOWED_CIDRS: 0.0.0.0/0,::/0
command: ["eval", "Tribes.Release.migrate_with_storage_up()"]
migrate-peer:
image: ${TRIBES_SUPERTEST_IMAGE:-tribes-supertest-e2e:latest}
depends_on:
db-peer:
condition: service_healthy
environment:
<<: *origin_env
PHX_HOST: supertest-peer
DATABASE_URL: ecto://postgres:postgres@db-peer:5432/tribes_peer
PARRHESIA_DATABASE_URL: ecto://postgres:postgres@db-peer:5432/parrhesia_peer
PARRHESIA_RELAY_URL: ws://supertest-peer:4000/nostr/relay
PARRHESIA_IDENTITY_PRIVATE_KEY: bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb
TRIBES_VICTORIAMETRICS_URL: http://vm-peer:8428
command: ["eval", "Tribes.Release.migrate_with_storage_up()"]
supertest-origin:
image: ${TRIBES_SUPERTEST_IMAGE:-tribes-supertest-e2e:latest}
depends_on:
db-origin:
condition: service_healthy
vm-origin:
condition: service_started
environment:
<<: *origin_env
TRIBES_BOOTSTRAP_FILE: /etc/tribes/bootstrap.json
volumes:
- ${SUPERTEST_PLUGIN_ROOT}/test/e2e/bootstrap/origin.json:/etc/tribes/bootstrap.json:ro
ports:
- "46201:4000"
- "47201:4413"
command: ["start"]
vmagent-origin:
image: victoriametrics/vmagent:v1.138.0
network_mode: "service:supertest-origin"
depends_on:
supertest-origin:
condition: service_started
vm-origin:
condition: service_started
volumes:
- ${SUPERTEST_PLUGIN_ROOT}/test/e2e/vmagent/promscrape.yml:/etc/vmagent/promscrape.yml:ro
command:
- -promscrape.config=/etc/vmagent/promscrape.yml
- -remoteWrite.url=http://vm-origin:8428/api/v1/write
- -httpListenAddr=127.0.0.1:8429
supertest-peer:
image: ${TRIBES_SUPERTEST_IMAGE:-tribes-supertest-e2e:latest}
depends_on:
db-peer:
condition: service_healthy
vm-peer:
condition: service_started
environment:
<<: *origin_env
PHX_HOST: supertest-peer
DATABASE_URL: ecto://postgres:postgres@db-peer:5432/tribes_peer
PARRHESIA_DATABASE_URL: ecto://postgres:postgres@db-peer:5432/parrhesia_peer
PARRHESIA_RELAY_URL: ws://supertest-peer:4000/nostr/relay
PARRHESIA_IDENTITY_PRIVATE_KEY: bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb
TRIBES_VICTORIAMETRICS_URL: http://vm-peer:8428
TRIBES_BOOTSTRAP_FILE: /etc/tribes/bootstrap.json
volumes:
- ${SUPERTEST_PLUGIN_ROOT}/test/e2e/bootstrap/peer.json:/etc/tribes/bootstrap.json:ro
ports:
- "46202:4000"
- "47202:4413"
command: ["start"]
vmagent-peer:
image: victoriametrics/vmagent:v1.138.0
network_mode: "service:supertest-peer"
depends_on:
supertest-peer:
condition: service_started
vm-peer:
condition: service_started
volumes:
- ${SUPERTEST_PLUGIN_ROOT}/test/e2e/vmagent/promscrape.yml:/etc/vmagent/promscrape.yml:ro
command:
- -promscrape.config=/etc/vmagent/promscrape.yml
- -remoteWrite.url=http://vm-peer:8428/api/v1/write
- -httpListenAddr=127.0.0.1:8429