Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[chore] Parallelize e2e tests #31004

Merged
merged 1 commit into from
Feb 1, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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

Loading