-
Notifications
You must be signed in to change notification settings - Fork 151
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[chore] add e2e tests that test cluster receiver metrics and an attem…
…pt to test trace auto-instrumentation
- Loading branch information
Showing
10 changed files
with
4,450 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
kind: Cluster | ||
apiVersion: kind.x-k8s.io/v1alpha4 | ||
kubeadmConfigPatches: | ||
- | | ||
kind: KubeletConfiguration | ||
serverTLSBootstrap: true |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,106 @@ | ||
name: e2e-tests | ||
|
||
|
||
on: pull_request | ||
|
||
env: | ||
# Make sure to exit early if cache segment download times out after 2 minutes. | ||
# We limit cache download as a whole to 5 minutes. | ||
SEGMENT_DOWNLOAD_TIMEOUT_MINS: 2 | ||
jobs: | ||
docker-build: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v4 | ||
- uses: actions/setup-go@v4 | ||
with: | ||
go-version: ~1.20.8 | ||
cache: false | ||
- name: Cache Go | ||
id: go-cache | ||
timeout-minutes: 5 | ||
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 Docker Image | ||
run: | | ||
cd e2e_tests/testdata/nodejs | ||
docker build -t nodejs_test:latest . | ||
- name: export image to tar | ||
run: | | ||
docker save nodejs_test:latest > /tmp/nodejs_test.tar | ||
- name: Upload artifact | ||
uses: actions/upload-artifact@v3 | ||
with: | ||
name: nodejs_test | ||
path: /tmp/nodejs_test.tar | ||
kubernetes-test: | ||
env: | ||
KUBECONFIG: /tmp/kube-config-splunk-otel-collector-chart-e2e-testing | ||
strategy: | ||
matrix: | ||
k8s-version: ["v1.28.0"] | ||
runs-on: ubuntu-latest | ||
needs: docker-build | ||
steps: | ||
- uses: actions/checkout@v4 | ||
- uses: actions/setup-go@v4 | ||
with: | ||
go-version: ~1.20.8 | ||
cache: false | ||
- name: Cache Go | ||
id: go-cache | ||
timeout-minutes: 5 | ||
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: Create kind cluster | ||
uses: helm/kind-action@v1.8.0 | ||
with: | ||
node_image: kindest/node:${{ matrix.k8s-version }} | ||
kubectl_version: ${{ matrix.k8s-version }} | ||
cluster_name: kind | ||
config: ./.github/workflows/configs/e2e-kind-config.yaml | ||
- name: Fix kubelet TLS server certificates | ||
run: | | ||
kubectl get csr -o=jsonpath='{range.items[?(@.spec.signerName=="kubernetes.io/kubelet-serving")]}{.metadata.name}{" "}{end}' | xargs kubectl certificate approve | ||
- name: Download artifact | ||
uses: actions/download-artifact@v3 | ||
with: | ||
name: nodejs_test | ||
path: /tmp | ||
- name: Load Docker image | ||
run: | | ||
docker load --input /tmp/nodejs_test.tar | ||
- name: Kind load image | ||
run: | | ||
kind load docker-image nodejs_test:latest --name kind | ||
- name: 'Deploy' | ||
uses: 'deliverybot/helm@v1' | ||
with: | ||
release: 'sock' | ||
namespace: 'default' | ||
chart: helm-charts/splunk-otel-collector | ||
value-files: >- | ||
[ | ||
"e2e_tests/testdata/nodejs_traces_values.yaml", | ||
] | ||
env: | ||
KUBECONFIG_FILE: /tmp/kube-config-splunk-otel-collector-chart-e2e-testing | ||
- name: run e2e tests | ||
run: | | ||
cd e2e_tests | ||
go test -v |
Oops, something went wrong.