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

feat: Adding github action to run the operator end-to-end tests. #4762

Merged
Show file tree
Hide file tree
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
58 changes: 58 additions & 0 deletions .github/workflows/operator-e2e-integration-tests.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
# .github/workflows/operator-e2e-integration-tests.yml
name: Operator e2e tests

on:
push:
branches:
- main
pull_request:
types:
- opened
- synchronize
- labeled

jobs:
operator-e2e-tests:
if:
((github.event.action == 'labeled' && (github.event.label.name == 'approved' || github.event.label.name == 'lgtm' || github.event.label.name == 'ok-to-test')) ||
(github.event.action != 'labeled' && (contains(github.event.pull_request.labels.*.name, 'ok-to-test') || contains(github.event.pull_request.labels.*.name, 'approved') || contains(github.event.pull_request.labels.*.name, 'lgtm')))) &&
github.repository == 'feast-dev/feast'
runs-on: ubuntu-latest

services:
kind:
# Specify the Kubernetes version
Copy link
Member

@franciscojavierarceo franciscojavierarceo Nov 15, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

is this the Kind version or the Kubernetes version?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

kind version, my understanding is each kind image version is having associated k8 version.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I have revalidated again, each kind image version is mapped to the same kubernetes version.

image: kindest/node:v1.30.6

env:
KIND_CLUSTER: "operator-e2e-cluster"

steps:
- name: Checkout code
uses: actions/checkout@v4

- name: Set up Go
uses: actions/setup-go@v5
with:
go-version: '1.21.0'

- name: Create KIND cluster
run: |
kind create cluster --name $KIND_CLUSTER --wait 5m

- name: Set up kubernetes context
run: |
kubectl config use-context kind-$KIND_CLUSTER
echo "kind context is switched to cluster kind-$KIND_CLUSTER"

- name: Run E2E tests
run: |
# Run the e2e tests
cd infra/feast-operator/
make test-e2e

- name: Clean up
if: always()
run: |
# Delete the KIND cluster after tests
kind delete cluster --name kind-$KIND_CLUSTER
1 change: 1 addition & 0 deletions infra/feast-operator/test/utils/utils.go
Original file line number Diff line number Diff line change
Expand Up @@ -109,6 +109,7 @@ func LoadImageToKindClusterWithName(name string) error {
if v, ok := os.LookupEnv("KIND_CLUSTER"); ok {
cluster = v
}
fmt.Println("cluster used in the test is -", cluster)
kindOptions := []string{"load", "docker-image", name, "--name", cluster}
cmd := exec.Command("kind", kindOptions...)
_, err := Run(cmd)
Expand Down
Loading