forked from grafana/cortex-tools
-
Notifications
You must be signed in to change notification settings - Fork 7
88 lines (88 loc) · 2.72 KB
/
integration_test.yml
File metadata and controls
88 lines (88 loc) · 2.72 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
name: Integration Tests
on:
pull_request:
paths-ignore:
- "docs/**"
- "*.md"
permissions:
contents: read
jobs:
integration:
name: Integration Tests
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-go@v5
with:
go-version: 1.25
- name: Start Cortex
run: |
docker run -d --name cortex \
-p 9009:9009 \
-v ${{ github.workspace }}/integration/cortex-config.yaml:/etc/cortex/config.yaml \
cortexproject/cortex:v1.21.0 \
-config.file=/etc/cortex/config.yaml \
-target=all,alertmanager
- name: Wait for Cortex
run: |
for i in $(seq 1 30); do
if wget -qO- http://localhost:9009/ready > /dev/null 2>&1; then
echo "Cortex is ready"
exit 0
fi
echo "Waiting for Cortex... ($i)"
sleep 2
done
echo "Cortex failed to start"
docker logs cortex
exit 1
- name: Run Integration Tests
env:
CORTEX_ADDRESS: http://localhost:9009
run: go test -mod=vendor -tags=integration -v -count=1 ./integration/...
- name: Cortex Logs
if: failure()
run: docker logs cortex
- name: Cleanup
if: always()
run: docker stop cortex && docker rm cortex
integration-utf8:
name: Integration Tests (UTF-8)
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-go@v5
with:
go-version: 1.25
- name: Start Cortex (UTF-8 mode)
run: |
docker run -d --name cortex-utf8 \
-p 9009:9009 \
-v ${{ github.workspace }}/integration/cortex-config.yaml:/etc/cortex/config.yaml \
cortexproject/cortex:v1.21.0 \
-config.file=/etc/cortex/config.yaml \
-target=all,alertmanager \
-name-validation-scheme=utf8
- name: Wait for Cortex
run: |
for i in $(seq 1 30); do
if wget -qO- http://localhost:9009/ready > /dev/null 2>&1; then
echo "Cortex is ready"
exit 0
fi
echo "Waiting for Cortex... ($i)"
sleep 2
done
echo "Cortex failed to start"
docker logs cortex-utf8
exit 1
- name: Run UTF-8 Integration Tests
env:
CORTEX_ADDRESS: http://localhost:9009
run: go test -mod=vendor -tags=integration_utf8 -v -count=1 ./integration/...
- name: Cortex Logs
if: failure()
run: docker logs cortex-utf8
- name: Cleanup
if: always()
run: docker stop cortex-utf8 && docker rm cortex-utf8