forked from open-telemetry/opentelemetry-collector-contrib
-
Notifications
You must be signed in to change notification settings - Fork 0
79 lines (77 loc) · 2.76 KB
/
e2e-tests.yml
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
name: e2e-tests
on:
push:
branches:
- main
tags:
- 'v[0-9]+.[0-9]+.[0-9]+*'
pull_request:
jobs:
kubernetes-test:
runs-on: ubuntu-latest
steps:
- name: Checkout Repo
uses: actions/checkout@v3
- name: Setup Go
uses: actions/setup-go@v3
with:
go-version: 1.19
- name: Cache Go
id: go-cache
uses: actions/cache@v3
with:
path: |
~/go/bin
~/go/pkg/mod
key: go-cache-${{ runner.os }}-${{ hashFiles('**/go.sum') }}
- name: Install dependencies
if: steps.go-cache.outputs.cache-hit != 'true'
run: make -j2 gomoddownload
- name: Build Collector
run: make otelcontribcol
- name: Build Docker Image
run: |
make docker-otelcontribcol
docker tag otelcontribcol:latest otel/opentelemetry-collector-contrib-dev:$GITHUB_SHA
- name: Set up Helm
uses: azure/setup-helm@v3.5
with:
version: v3.9.0
- name: Set up chart-testing
uses: helm/chart-testing-action@v2.3.0
- name: Create kind cluster
uses: helm/kind-action@v1.5.0
- name: Check kind
run: |
kubectl cluster-info --context kind-chart-testing
kubectl get node
docker ps -a --filter label=io.x-k8s.kind.cluster=chart-testing
- name: Kind load image
run: |
kind load docker-image otel/opentelemetry-collector-contrib-dev:$GITHUB_SHA --name chart-testing
- name: Add Dependencies
shell: bash
run: |
helm repo add open-telemetry https://open-telemetry.github.io/opentelemetry-helm-charts
- uses: actions/checkout@v3
with:
repository: 'open-telemetry/opentelemetry-helm-charts'
path: opentelemetry-helm-charts
- name: Helm install collector
run: helm install test --set image.tag=$GITHUB_SHA -f .github/workflows/e2e/k8s/collector-helm-values.yml opentelemetry-helm-charts/charts/opentelemetry-collector
- name: check collector status
run: |
kubectl wait --for=condition=Ready --timeout=60s pod/test-opentelemetry-collector-0
- name: start telemetrygen job
run: |
kubectl -n default create -f .github/workflows/e2e/k8s/telemetrygen-job.yml
- name: check telemetrygen job status
run: |
kubectl wait --for=condition=Complete --timeout=60s job/test-telemetrygen
- name: copy trace output
run: |
kubectl cp -c filecp default/test-opentelemetry-collector-0:tmp/trace.json processor/k8sattributesprocessor/testdata/trace.json
- name: run e2e test to check output
run: |
cd processor/k8sattributesprocessor
go test -v --tags=e2e