Skip to content

Commit b0e1755

Browse files
authored
quality: extend test thanos package (#53290)
extend test coverage for thanos package by adding functional version checks and runtime validation using `daemon-check-output` --------- Signed-off-by: YashPimple <[email protected]>
1 parent 331118b commit b0e1755

File tree

1 file changed

+46
-2
lines changed

1 file changed

+46
-2
lines changed

thanos.yaml

Lines changed: 46 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
package:
22
name: thanos
33
version: "0.38.0"
4-
epoch: 2
4+
epoch: 3
55
description: Highly available Prometheus setup with long term storage capabilities.
66
copyright:
77
- license: Apache-2.0
@@ -49,8 +49,52 @@ update:
4949
tag-filter: v
5050

5151
test:
52+
environment:
53+
contents:
54+
packages:
55+
- curl
5256
pipeline:
5357
# AUTOGENERATED
5458
- runs: |
55-
thanos --version
59+
VERSION_OUTPUT=$(thanos --version 2>&1)
60+
echo "$VERSION_OUTPUT" | grep "version ${{ package.version }}"
5661
thanos --help
62+
thanos query --help
63+
thanos sidecar --help
64+
thanos tools bucket verify --help
65+
- name: Validate thanos with local filesystem
66+
uses: test/daemon-check-output
67+
with:
68+
setup: |
69+
mkdir -p /tmp/bucket-test
70+
echo "placeholder" > /tmp/bucket-test/obj1.txt
71+
72+
cat <<EOF > /tmp/filesystem.yaml
73+
type: FILESYSTEM
74+
config:
75+
directory: /tmp/bucket-test
76+
EOF
77+
start: thanos tools bucket verify --objstore.config-file=/tmp/filesystem.yaml
78+
timeout: 30
79+
expected_output: |
80+
started verifying issue
81+
loading bucket configuration
82+
verify task completed
83+
- name: Launch Thanos Query
84+
uses: test/daemon-check-output
85+
with:
86+
setup: |
87+
mkdir -p /tmp/data
88+
start: thanos query --http-address=127.0.0.1:19192 --log.level=debug
89+
timeout: 30
90+
expected_output: |
91+
starting query node
92+
changing probe status
93+
listening for requests and metrics
94+
Listening on
95+
post: |
96+
if curl -sf --retry 5 http://127.0.0.1:19192/-/healthy; then
97+
echo "Thanos query is healthy"
98+
else
99+
echo "Thanos query is not healthy"
100+
fi

0 commit comments

Comments
 (0)