-
Notifications
You must be signed in to change notification settings - Fork 33
94 lines (81 loc) · 3.13 KB
/
logzio-telemetry-test.yaml
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
89
90
91
92
93
name: Test `logzio-telemetry` chart
on:
pull_request:
branches:
- master
paths:
- 'charts/logzio-telemetry/templates/**'
- 'charts/logzio-telemetry/Chart.yaml'
- 'charts/logzio-telemetry/values.yaml'
- 'charts/logzio-telemetry/nginx/**'
- 'charts/logzio-telemetry/windows_exporter_installer/**'
jobs:
test-helm-chart:
name: Test Helm Chart on Kind
runs-on: ubuntu-latest
strategy:
matrix:
mode: ['daemonset', 'standalone']
steps:
- name: Generate random id
id: random_id
run: echo "::set-output name=rand::$(echo $RANDOM)"
- name: Set ENV_ID
run: echo "ENV_ID=telemetry-test-run-${{ steps.random_id.outputs.rand }}-${{ matrix.mode }}" >> $GITHUB_ENV
- name: Checkout repository
uses: actions/checkout@v4
- name: Set up Go
uses: actions/setup-go@v5
with:
go-version: '1.20'
- name: Set up Helm
uses: azure/setup-helm@v4.2.0
- name: Set up kubectl
uses: azure/setup-kubectl@v4
- name: Install Kind
run: |
curl -Lo ./kind "https://kind.sigs.k8s.io/dl/v0.11.1/kind-Linux-amd64"
chmod +x ./kind
mv ./kind /usr/local/bin/kind
- name: Create Kind cluster
run: |
kind create cluster --name kind-${{ github.run_id }}-${{ matrix.mode }}
kubectl cluster-info
- name: Deploy Helm Chart
run: |
cd charts/logzio-telemetry
helm dependency build
helm upgrade --install \
--set traces.enabled=true \
--set spm.enabled=true \
--set metrics.enabled=true \
--set secrets.TracesToken=${{ secrets.LOGZIO_TRACES_TOKEN }} \
--set secrets.SpmToken=${{ secrets.LOGZIO_METRICS_TOKEN }} \
--set secrets.MetricsToken=${{ secrets.LOGZIO_METRICS_TOKEN }} \
--set secrets.ListenerHost=https://listener.logz.io:8053 \
--set secrets.p8s_logzio_name=${{ env.ENV_ID }} \
--set secrets.env_id=${{ env.ENV_ID }} \
--set collector.mode=${{ matrix.mode }} \
logzio-k8s-telemetry .
kubectl rollout status deployment/logzio-k8s-telemetry-otel-collector-standalone --timeout=300s
kubectl rollout status deployment/logzio-k8s-telemetry-otel-collector-spm --timeout=300s
- name: Run trace generator
run: |
kubectl apply -f tests/resources/tracegen.yaml
kubectl rollout status deployment/trace-gen --timeout=300s
- name: sleep for 3 minutes
run: sleep 180
- name: Run Go Tests
env:
LOGZIO_METRICS_API_KEY: ${{ secrets.LOGZIO_METRICS_API_KEY }}
LOGZIO_TRACES_API_KEY: ${{ secrets.LOGZIO_TRACES_API_KEY }}
run: |
go get go.uber.org/zap
go test -v ./tests/traces_e2e_test.go ./tests/common.go
go test -v ./tests/metrics_e2e_test.go ./tests/common.go
- name: Cleanup Environment
run: |
helm uninstall logzio-k8s-telemetry
- name: Delete Kind cluster
if: always()
run: kind delete cluster --name kind-${{ github.run_id }}-${{ matrix.mode }}