Skip to content

Commit d8ccb00

Browse files
feat: Adding github action to run the operator end-to-end tests. (#4762)
1 parent de2d304 commit d8ccb00

File tree

2 files changed

+59
-0
lines changed

2 files changed

+59
-0
lines changed
Lines changed: 58 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,58 @@
1+
# .github/workflows/operator-e2e-integration-tests.yml
2+
name: Operator e2e tests
3+
4+
on:
5+
push:
6+
branches:
7+
- main
8+
pull_request:
9+
types:
10+
- opened
11+
- synchronize
12+
- labeled
13+
14+
jobs:
15+
operator-e2e-tests:
16+
if:
17+
((github.event.action == 'labeled' && (github.event.label.name == 'approved' || github.event.label.name == 'lgtm' || github.event.label.name == 'ok-to-test')) ||
18+
(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')))) &&
19+
github.repository == 'feast-dev/feast'
20+
runs-on: ubuntu-latest
21+
22+
services:
23+
kind:
24+
# Specify the Kubernetes version
25+
image: kindest/node:v1.30.6
26+
27+
env:
28+
KIND_CLUSTER: "operator-e2e-cluster"
29+
30+
steps:
31+
- name: Checkout code
32+
uses: actions/checkout@v4
33+
34+
- name: Set up Go
35+
uses: actions/setup-go@v5
36+
with:
37+
go-version: '1.21.0'
38+
39+
- name: Create KIND cluster
40+
run: |
41+
kind create cluster --name $KIND_CLUSTER --wait 5m
42+
43+
- name: Set up kubernetes context
44+
run: |
45+
kubectl config use-context kind-$KIND_CLUSTER
46+
echo "kind context is switched to cluster kind-$KIND_CLUSTER"
47+
48+
- name: Run E2E tests
49+
run: |
50+
# Run the e2e tests
51+
cd infra/feast-operator/
52+
make test-e2e
53+
54+
- name: Clean up
55+
if: always()
56+
run: |
57+
# Delete the KIND cluster after tests
58+
kind delete cluster --name kind-$KIND_CLUSTER

infra/feast-operator/test/utils/utils.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -109,6 +109,7 @@ func LoadImageToKindClusterWithName(name string) error {
109109
if v, ok := os.LookupEnv("KIND_CLUSTER"); ok {
110110
cluster = v
111111
}
112+
fmt.Println("cluster used in the test is -", cluster)
112113
kindOptions := []string{"load", "docker-image", name, "--name", cluster}
113114
cmd := exec.Command("kind", kindOptions...)
114115
_, err := Run(cmd)

0 commit comments

Comments
 (0)