Skip to content

Commit

Permalink
[chore] Parallelize e2e tests (open-telemetry#31004)
Browse files Browse the repository at this point in the history
Reorganizes job dependencies and parallelizes the k8s tests

Related to
open-telemetry#30880

**Testing**
https://github.com/open-telemetry/opentelemetry-collector-contrib/actions/runs/7745609364
  • Loading branch information
TylerHelmuth authored and cparkins committed Feb 1, 2024
1 parent e1aa852 commit 7e323ac
Showing 1 changed file with 59 additions and 49 deletions.
108 changes: 59 additions & 49 deletions .github/workflows/e2e-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -41,12 +41,12 @@ jobs:
with:
name: collector-binary
path: ./bin/*
docker-build:

supervisor-test:
runs-on: ubuntu-latest
needs: collector-build
steps:
- name: Checkout
uses: actions/checkout@v4
- uses: actions/checkout@v4
- uses: actions/setup-go@v5
with:
go-version: ~1.20.8
Expand All @@ -69,6 +69,32 @@ jobs:
name: collector-binary
path: bin/
- run: chmod +x bin/*
- name: Run opampsupervisor e2e tests
run: |
cd cmd/opampsupervisor
go test -v --tags=e2e
docker-build:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- uses: actions/setup-go@v5
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: |
make docker-otelcontribcol
Expand All @@ -80,12 +106,22 @@ jobs:
with:
name: otelcontribcol
path: /tmp/otelcontribcol.tar
kubernetes-test:

kubernetes-test-matrix:
env:
KUBECONFIG: /tmp/kube-config-otelcol-e2e-testing
strategy:
matrix:
k8s-version: ["v1.26.0", "v1.25.3", "v1.24.7", "v1.23.13"]
k8s-version:
- "v1.26.0"
- "v1.25.3"
- "v1.24.7"
- "v1.23.13"
component:
- receiver/k8sclusterreceiver
- processor/k8sattributesprocessor
- receiver/kubeletstatsreceiver
- receiver/k8sobjectsreceiver
runs-on: ubuntu-latest
needs: docker-build
steps:
Expand All @@ -102,7 +138,7 @@ jobs:
path: |
~/go/bin
~/go/pkg/mod
key: go-cache-${{ runner.os }}-${{ hashFiles('**/go.sum') }}
key: go-cache-${{ runner.os }}-${{ hashFiles('**/go.sum') }}
- name: Install dependencies
if: steps.go-cache.outputs.cache-hit != 'true'
run: make -j2 gomoddownload
Expand All @@ -127,51 +163,25 @@ jobs:
- name: Kind load image
run: |
kind load docker-image otelcontribcol:latest --name kind
- name: run k8sclusterreceiver e2e tests
- name: Run e2e tests
run: |
cd receiver/k8sclusterreceiver
cd ${{ matrix.component }}
go test -v --tags=e2e
- name: run k8sattributesprocessor e2e tests
run: |
cd processor/k8sattributesprocessor
go test -v --tags=e2e
- name: run receiver/kubeletstatsreceiver e2e tests
run: |
cd receiver/kubeletstatsreceiver
go test -v --tags=e2e
- name: run receiver/k8sobjectsreceiver e2e tests
run: |
cd receiver/k8sobjectsreceiver
go test -v --tags=e2e
supervisor-test:
kubernetes-test:
if: ${{ github.actor != 'dependabot[bot]' && always() }}
runs-on: ubuntu-latest
needs: collector-build
needs: [ kubernetes-test-matrix ]
steps:
- uses: actions/checkout@v4
- uses: actions/setup-go@v5
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: Download Collector Binary
uses: actions/download-artifact@v3
with:
name: collector-binary
path: bin/
- run: chmod +x bin/*
- name: Run opampsupervisor e2e tests
run: |
cd cmd/opampsupervisor
go test -v --tags=e2e
- name: Print result
run: echo ${{ needs.kubernetes-test-matrix.result }}
- name: Interpret result
run: |
if [[ success == ${{ needs.kubernetes-test-matrix.result }} ]]
then
echo "All matrix jobs passed!"
else
echo "One or more matrix jobs failed."
false
fi

0 comments on commit 7e323ac

Please sign in to comment.