Skip to content

Commit

Permalink
Add test for logzio-k8s-telemetry
Browse files Browse the repository at this point in the history
  • Loading branch information
yotamloe committed Jun 6, 2024
1 parent 0586836 commit 766024f
Showing 1 changed file with 69 additions and 0 deletions.
69 changes: 69 additions & 0 deletions .github/workflows/logzio-logs-collector-test.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,69 @@
name: Test Logzio Logs Collector Helm Chart on Kind Kubernetes Environment

on:
pull_request:
branches:
- main
paths:
- 'charts/logzio-logs-collector/**'
jobs:
test-helm-chart:
name: Test Helm Chart on Kind
runs-on: ubuntu-latest
env:
ENV_ID: logs-test-run-${{ github.run_id }}-number-${{ github.run_number }}
steps:
- 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@v3

- 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 }}
kubectl cluster-info
- name: Deploy Helm Chart
run: |
cd charts/logzio-logs-collector
helm upgrade --install \
--set secrets.env_id=${{ env.ENV_ID }} \
--set secrets.logzioLogsToken=${{ env.LOGZIO_LOGS_TOKEN }} \
--set secrets.logzioRegion=us \
logzio-logs-collector .
- name: run log generator
run: |
kubectl apply -f tests/resources/logsgen.yaml
kubectl rollout status deployment/log-generator --timeout=300s
- name: sleep for 2 minutes
run: sleep 120

- name: Run Go Tests
run: |
go get go.uber.org/zap
go test -v ./tests/logs_e2e_test.go ./tests/common.go
- name: Cleanup Environment
run: |
helm uninstall logzio-logs-collector
- name: Delete Kind cluster
if: always()
run: kind delete cluster --name kind-${{ github.run_id }}

0 comments on commit 766024f

Please sign in to comment.