Skip to content

Commit a251581

Browse files
authored
Run current OATS consumer suites (#1189)
Signed-off-by: Gregor Zeitlinger <gregor.zeitlinger@grafana.com>
1 parent fc99c85 commit a251581

12 files changed

Lines changed: 105 additions & 134 deletions

File tree

.mise/tasks/oats-tests.sh

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,4 @@ set -euo pipefail
1010
:opentelemetry-examples-logging-k8s-stdout-otlp-json:assemble \
1111
:opentelemetry-examples-spring-declarative-configuration:bootJar
1212

13-
oats -timeout 5m doc-snippets/extensions-minimal/oats/
14-
oats -timeout 5m javaagent-declarative-configuration/oats/
15-
oats -timeout 5m logging-k8s-stdout-otlp-json/
16-
oats -timeout 5m spring-declarative-configuration/oats/
13+
oats --no-cache --timeout=10m .
Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
name: extensions minimal traces custom processor attribute
2+
fixture:
3+
compose:
4+
template: lgtm
5+
file: ./docker-compose.yml
6+
interval: 5s
7+
seed:
8+
type: app
9+
input:
10+
- path: /hello
11+
expected:
12+
traces:
13+
- traceql: '{ span.http.route = "/hello" }'
14+
match_spans:
15+
- name: GET /hello
16+
attributes:
17+
- key: http.request.method
18+
value: GET
19+
- key: http.route
20+
value: /hello
21+
- key: custom.processor
22+
value: active

doc-snippets/extensions-minimal/oats/oats.yaml

Lines changed: 0 additions & 21 deletions
This file was deleted.
Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
name: javaagent declarative config excludes actuator health traces
2+
fixture:
3+
compose:
4+
template: lgtm
5+
file: ./docker-compose.yml
6+
seed:
7+
type: app
8+
input:
9+
- path: /api/example
10+
- path: /actuator/health
11+
- path: /api/remote
12+
expected:
13+
traces:
14+
- traceql: '{ span.http.route = "/api/example" }'
15+
match_spans:
16+
- name: GET /api/example
17+
attributes:
18+
- key: http.request.method
19+
value: GET
20+
- key: http.route
21+
value: /api/example
22+
- traceql: '{ span.http.route = "/actuator/health" }'
23+
absent: true
24+
- traceql: '{ span.peer.service = "example-backend" }'
25+
count: '>= 1'

javaagent-declarative-configuration/oats/oats.yaml

Lines changed: 0 additions & 31 deletions
This file was deleted.

logging-k8s-stdout-otlp-json/k8s/lgtm.yaml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,10 @@ spec:
3030
protocol: TCP
3131
port: 3200
3232
targetPort: 3200
33+
- name: pyroscope # needed for automated tests
34+
protocol: TCP
35+
port: 4040
36+
targetPort: 4040
3337
---
3438
apiVersion: apps/v1
3539
kind: Deployment
@@ -55,6 +59,7 @@ spec:
5559
- containerPort: 9090 # needed for automated tests
5660
- containerPort: 3100 # needed for automated tests
5761
- containerPort: 3200 # needed for automated tests
62+
- containerPort: 4040 # needed for automated tests
5863
readinessProbe:
5964
exec:
6065
command:
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
name: logging k8s stdout otlp json emits structured logs
2+
fixture:
3+
k3d:
4+
k8s_dir: k8s
5+
app_service: dice
6+
app_docker_file: Dockerfile
7+
app_docker_tag: dice:1.1-SNAPSHOT
8+
app_port: 8080
9+
input:
10+
- path: /rolldice
11+
expected:
12+
logs:
13+
- logql: '{service_name="dice"} |~ `.*Anonymous player is rolling the dice:.*`'
14+
regex: 'Anonymous player is rolling the dice: [0-9]+'
15+
count: '>= 1'
16+
- logql: '{service_name="dice"} |~ `.*simulating an error.*`'
17+
contains:
18+
- 'Servlet.service() for servlet [dispatcherServlet] in context with path [] threw exception [Request processing failed: java.lang.RuntimeException: simulating an error] with root cause'
19+
- 'java.lang.RuntimeException: simulating an error'
20+
count: '>= 1'

logging-k8s-stdout-otlp-json/oats.yaml

Lines changed: 0 additions & 53 deletions
This file was deleted.

mise.toml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
[tools]
2-
"aqua:grafana/oats" = "0.7.0"
2+
"aqua:grafana/gcx" = "v0.5.0"
3+
"aqua:grafana/oats" = "0.8.0"
34
k3d = "5.8.3"
45
kubectl = "1.36.3"
56

oats-config.yaml

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
meta:
2+
version: 3
3+
4+
cases:
5+
- doc-snippets/extensions-minimal/oats/oats-case.yaml
6+
- javaagent-declarative-configuration/oats/oats-case.yaml
7+
- spring-declarative-configuration/oats/oats-case.yaml
8+
- logging-k8s-stdout-otlp-json/oats-case.yaml

0 commit comments

Comments
 (0)