Skip to content

Commit

Permalink
fix test scripts
Browse files Browse the repository at this point in the history
  • Loading branch information
hgiasac committed Sep 29, 2024
1 parent ba2731d commit 0058de7
Show file tree
Hide file tree
Showing 8 changed files with 70 additions and 77 deletions.
58 changes: 58 additions & 0 deletions compose.base.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
services:
ndc-prometheus:
build:
context: .
ports:
- 8080:8080
volumes:
- ./tests/configuration:/etc/connector:ro
extra_hosts:
- local.hasura.dev=host-gateway
environment:
CONNECTION_URL: http://prometheus:9090
PROMETHEUS_USERNAME: admin
PROMETHEUS_PASSWORD: test
OTEL_EXPORTER_OTLP_TRACES_ENDPOINT: http://jaeger:4317
OTEL_METRICS_EXPORTER: prometheus
HASURA_LOG_LEVEL: debug

prometheus:
image: prom/prometheus:v2.54.1
volumes:
- ./tests/prometheus/:/etc/prometheus/
command:
- "--config.file=/etc/prometheus/prometheus.yml"
- "--storage.tsdb.path=/prometheus"
- "--web.console.libraries=/usr/share/prometheus/console_libraries"
- "--web.console.templates=/usr/share/prometheus/consoles"
- "--web.enable-lifecycle"
- "--web.config.file=/etc/prometheus/web.yml"
- "--enable-feature=promql-experimental-functions"
ports:
- 9090:9090
links:
- alertmanager:alertmanager
restart: always

node-exporter:
image: prom/node-exporter:v1.8.1
volumes:
- /proc:/host/proc:ro
- /sys:/host/sys:ro
- /:/rootfs:ro
command:
- "--path.procfs=/host/proc"
- "--path.sysfs=/host/sys"
- --collector.filesystem.ignored-mount-points
- "^/(sys|proc|dev|host|etc|rootfs/var/lib/docker/containers|rootfs/var/lib/docker/overlay2|rootfs/run/docker/netns|rootfs/var/lib/docker/aufs)($$|/)"
ports:
- 9100:9100
restart: always

alertmanager:
image: prom/alertmanager:v0.27.0
ports:
- 9093:9093
volumes:
- ./tests/alertmanager/config.yml/:/etc/alertmanager/alertmanager.yml
restart: always
59 changes: 1 addition & 58 deletions compose.yaml
Original file line number Diff line number Diff line change
@@ -1,64 +1,7 @@
include:
- path: ./compose.base.yaml
- path: ./tests/engine/compose.yaml
services:
ndc-prometheus:
build:
context: .
ports:
- 8080:8080
volumes:
- ./tests/configuration:/etc/connector:ro
extra_hosts:
- local.hasura.dev=host-gateway
environment:
CONNECTION_URL: http://prometheus:9090
PROMETHEUS_USERNAME: admin
PROMETHEUS_PASSWORD: test
OTEL_EXPORTER_OTLP_TRACES_ENDPOINT: http://jaeger:4317
OTEL_METRICS_EXPORTER: prometheus
HASURA_LOG_LEVEL: debug

prometheus:
image: prom/prometheus:v2.54.1
volumes:
- ./tests/prometheus/:/etc/prometheus/
command:
- "--config.file=/etc/prometheus/prometheus.yml"
- "--storage.tsdb.path=/prometheus"
- "--web.console.libraries=/usr/share/prometheus/console_libraries"
- "--web.console.templates=/usr/share/prometheus/consoles"
- "--web.enable-lifecycle"
- "--web.config.file=/etc/prometheus/web.yml"
- "--enable-feature=promql-experimental-functions"
ports:
- 9090:9090
links:
- alertmanager:alertmanager
restart: always

node-exporter:
image: prom/node-exporter:v1.8.1
volumes:
- /proc:/host/proc:ro
- /sys:/host/sys:ro
- /:/rootfs:ro
command:
- "--path.procfs=/host/proc"
- "--path.sysfs=/host/sys"
- --collector.filesystem.ignored-mount-points
- "^/(sys|proc|dev|host|etc|rootfs/var/lib/docker/containers|rootfs/var/lib/docker/overlay2|rootfs/run/docker/netns|rootfs/var/lib/docker/aufs)($$|/)"
ports:
- 9100:9100
restart: always

alertmanager:
image: prom/alertmanager:v0.27.0
ports:
- 9093:9093
volumes:
- ./tests/alertmanager/config.yml/:/etc/alertmanager/alertmanager.yml
restart: always

jaeger:
image: jaegertracing/all-in-one:1.60
restart: always
Expand Down
16 changes: 0 additions & 16 deletions connector/testdata/query/prometheus_alertmanagers/expected.json

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
{
"rows": [
{
"__value": ["__name__", "instance", "job"]
"__value": []
}
]
}
Expand Down
4 changes: 4 additions & 0 deletions connector/testdata/query/prometheus_label_names/request.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,10 @@
"start": {
"type": "literal",
"value": "1970-01-01T00:00:01Z"
},
"end": {
"type": "literal",
"value": "1970-01-02T00:00:01Z"
}
},
"collection": "prometheus_label_names",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
{
"rows": [
{
"__value": ["ndc-prometheus", "node"]
"__value": []
}
]
}
Expand Down
4 changes: 4 additions & 0 deletions connector/testdata/query/prometheus_label_values/request.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,10 @@
"start": {
"type": "literal",
"value": "1970-01-01T00:00:01Z"
},
"end": {
"type": "literal",
"value": "1970-01-02T00:00:01Z"
}
},
"collection": "prometheus_label_values",
Expand Down
2 changes: 1 addition & 1 deletion scripts/test.sh
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ http_wait() {
exit 1
}

docker compose up -d prometheus node-exporter alertmanager ndc-prometheus
docker compose -f ./compose.base.yaml up -d prometheus node-exporter alertmanager ndc-prometheus
http_wait http://localhost:8080/health
http_wait http://admin:test@localhost:9090/-/healthy

Expand Down

0 comments on commit 0058de7

Please sign in to comment.