Skip to content

Commit 986f217

Browse files
Use a ConfigMap for the prepared logs in the logging test (#608)
* Use a ConfigMap for the prepared logs in the logging test * Fix the prepared logs
1 parent f1980b0 commit 986f217

8 files changed

+58
-47
lines changed

tests/templates/kuttl/logging/02-assert.yaml

Lines changed: 0 additions & 36 deletions
This file was deleted.
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
---
2+
apiVersion: kuttl.dev/v1beta1
3+
kind: TestStep
4+
commands:
5+
- script: >
6+
kubectl create configmap prepared-logs
7+
--from-file=prepared-logs.airlift.json
8+
--namespace=$NAMESPACE
Lines changed: 26 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,36 @@
11
---
22
apiVersion: kuttl.dev/v1beta1
33
kind: TestAssert
4-
timeout: 300
4+
timeout: 600
55
---
66
apiVersion: apps/v1
77
kind: StatefulSet
88
metadata:
9-
name: trino-test-runner
9+
name: test-trino-coordinator-automatic-log-config
10+
status:
11+
readyReplicas: 1
12+
replicas: 1
13+
---
14+
apiVersion: apps/v1
15+
kind: StatefulSet
16+
metadata:
17+
name: test-trino-worker-automatic-log-config
18+
status:
19+
readyReplicas: 1
20+
replicas: 1
21+
---
22+
apiVersion: apps/v1
23+
kind: StatefulSet
24+
metadata:
25+
name: test-trino-coordinator-custom-log-config
26+
status:
27+
readyReplicas: 1
28+
replicas: 1
29+
---
30+
apiVersion: apps/v1
31+
kind: StatefulSet
32+
metadata:
33+
name: test-trino-worker-custom-log-config
1034
status:
1135
readyReplicas: 1
1236
replicas: 1

tests/templates/kuttl/logging/02-install-trino.yaml.j2 renamed to tests/templates/kuttl/logging/03-install-trino.yaml.j2

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -75,6 +75,17 @@ spec:
7575
loggers:
7676
ROOT:
7777
level: INFO
78+
podOverrides:
79+
spec:
80+
containers:
81+
- name: vector
82+
volumeMounts:
83+
- name: prepared-logs
84+
mountPath: /stackable/log/prepared-logs
85+
volumes:
86+
- name: prepared-logs
87+
configMap:
88+
name: prepared-logs
7889
custom-log-config:
7990
replicas: 1
8091
config:
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
---
2+
apiVersion: kuttl.dev/v1beta1
3+
kind: TestAssert
4+
timeout: 300
5+
---
6+
apiVersion: apps/v1
7+
kind: StatefulSet
8+
metadata:
9+
name: trino-test-runner
10+
status:
11+
readyReplicas: 1
12+
replicas: 1

tests/templates/kuttl/logging/04-copy-prepared-logs.yaml

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

tests/templates/kuttl/logging/prepared-logs.airlift.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
{"timestamp":"2024-01-01T00:00:00.000000000Z","level":"INFO","logger":"TestLogger","message":"Valid log event without a thread"}
44
{"level":"INFO","thread":"main","logger":"TestLogger","message":"Invalid log event without a timestamp"}
55
{"timestamp":"unparsable timestamp","level":"INFO","thread":"main","logger":"TestLogger","message":"Invalid log event with an unparsable timestamp"}
6-
{"timestamp":"2024-01-01T00:00:00.000000000Z","level":"INFO","thread":"main",,"message":"Invalid log event without a logger"}
6+
{"timestamp":"2024-01-01T00:00:00.000000000Z","level":"INFO","thread":"main","message":"Invalid log event without a logger"}
77
{"timestamp":"2024-01-01T00:00:00.000000000Z","level":"CRITICAL","thread":"main","logger":"TestLogger","message":"Invalid log event with an unknown level"}
88
{"timestamp":"2024-01-01T00:00:00.000000000Z","thread":"main","logger":"TestLogger","message":"Invalid log event without a level"}
99
{"timestamp":"2024-01-01T00:00:00.000000000Z","level":"INFO","thread":"main","logger":"TestLogger"}

0 commit comments

Comments
 (0)