-
Notifications
You must be signed in to change notification settings - Fork 4
72 lines (57 loc) · 1.85 KB
/
test.yml
File metadata and controls
72 lines (57 loc) · 1.85 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
name: Tests
on:
push:
branches: [main]
pull_request:
branches: [main]
jobs:
unit:
name: Unit Tests
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Install dependencies
run: |
sudo apt-get update -qq
sudo apt-get install -y -qq jq shellcheck
pip install pyyaml
- name: Install promtool
run: |
PROM_VER="3.9.1"
curl -sLO "https://github.com/prometheus/prometheus/releases/download/v${PROM_VER}/prometheus-${PROM_VER}.linux-amd64.tar.gz"
tar xzf "prometheus-${PROM_VER}.linux-amd64.tar.gz" --strip-components=1 -C /usr/local/bin "prometheus-${PROM_VER}.linux-amd64/promtool"
rm "prometheus-${PROM_VER}.linux-amd64.tar.gz"
promtool --version
- name: Shell syntax
run: bash tests/test-shell-syntax.sh
- name: Config validation
run: bash tests/test-config-validate.sh
- name: Hook behavior
run: bash tests/test-hooks.sh
- name: Session parsers
run: bash tests/test-parsers.sh
e2e:
name: E2E Smoke
runs-on: ubuntu-latest
needs: unit
steps:
- uses: actions/checkout@v4
- name: Install dependencies
run: sudo apt-get update -qq && sudo apt-get install -y -qq jq
- name: Start stack
run: docker compose up -d --wait
timeout-minutes: 3
- name: Wait for services
run: |
for i in $(seq 1 30); do
curl -sf http://localhost:3100/ready && curl -sf http://localhost:9090/-/healthy && break
sleep 2
done
- name: Run signal pipeline test
run: bash scripts/test-signal.sh
- name: Collect logs on failure
if: failure()
run: docker compose logs --tail=50
- name: Stop stack
if: always()
run: docker compose down -v