Skip to content

Commit

Permalink
add k8s intg test to pull pr workflow
Browse files Browse the repository at this point in the history
Signed-off-by: Mohamed Mahmoud <mmahmoud@redhat.com>
  • Loading branch information
msherif1234 committed May 29, 2024
1 parent f34acc0 commit 0bf8a16
Show file tree
Hide file tree
Showing 2 changed files with 66 additions and 3 deletions.
63 changes: 63 additions & 0 deletions .github/workflows/pull_request.yml
Original file line number Diff line number Diff line change
Expand Up @@ -37,3 +37,66 @@ jobs:
fail_ci_if_error: true
verbose: true

kubernetes-integration-tests:
needs: [ build-lint-test ]
runs-on: ubuntu-latest
strategy:
matrix:
go: ['1.21','1.22']
env:
BPFMAN_IMG: quay.io/bpfman/bpfman:latest
BPFMAN_AGENT_IMG: quay.io/bpfman/bpfman-agent:int-test
BPFMAN_OPERATOR_IMG: quay.io/bpfman/bpfman-operator:int-test
XDP_PASS_PRIVATE_IMAGE_CREDS: ${{ secrets.XDP_PASS_PRIVATE_IMAGE_CREDS }}
steps:
- name: Check disk space
run: df -h

- name: Free up space
run: |
sudo rm -rf /usr/share/dotnet
sudo rm -rf /opt/ghc
sudo rm -rf "/usr/local/share/boost"
sudo rm -rf "$AGENT_TOOLSDIRECTORY"
sudo rm -rf /usr/local/lib/android
- name: Check disk space again
run: df -h

- name: set up go 1.x
uses: actions/setup-go@v3
with:
go-version: ${{ matrix.go }}

- name: cache go modules
uses: actions/cache@v4
with:
path: ~/go/pkg/mod
key: ${{ runner.os }}-build-codegen-${{ hashFiles('**/go.sum') }}
restore-keys: |
${{ runner.os }}-build-codegen-
- name: checkout repository
uses: actions/checkout@v4
with:
fetch-depth: 0

## TODO(astoycos) Currently this is just done to ensure we have coverage
## on all image builds. Ultimately we should be running the integration
## tests with these locally built bytecode images.
- name: build images
run: make build-images

- name: run integration tests
run: make test-integration

- name: Check disk space
run: df -h

## Upload diagnostics if integration test step failed.
- name: upload diagnostics
if: ${{ failure() }}
uses: actions/upload-artifact@v4
with:
name: kubernetes-integration-test-diag
path: /tmp/ktf-diag*
if-no-files-found: ignore
6 changes: 3 additions & 3 deletions test/integration/suite_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -33,9 +33,9 @@ var (
bpfmanImage = os.Getenv("BPFMAN_IMG")
bpfmanAgentImage = os.Getenv("BPFMAN_AGENT_IMG")
bpfmanOperatorImage = os.Getenv("BPFMAN_OPERATOR_IMG")
tcExampleUsImage = "quay.io/bpfman-userspace/go-tc-counter:latest"
xdpExampleUsImage = "quay.io/bpfman-userspace/go-xdp-counter:latest"
tpExampleUsImage = "quay.io/bpfman-userspace/go-tracepoint-counter:latest"
tcExampleUsImage = "quay.io/organization/bpfman-userspace/go-tc-counter:latest"
xdpExampleUsImage = "quay.io/organization/bpfman-userspace/go-xdp-counter:latest"
tpExampleUsImage = "quay.io/organization/bpfman-userspace/go-tracepoint-counter:latest"

existingCluster = os.Getenv("USE_EXISTING_KIND_CLUSTER")
keepTestCluster = func() bool { return os.Getenv("TEST_KEEP_CLUSTER") == "true" || existingCluster != "" }()
Expand Down

0 comments on commit 0bf8a16

Please sign in to comment.