Skip to content

Commit e3ab91e

Browse files
committed
test workflow
1 parent 7e8b914 commit e3ab91e

1 file changed

Lines changed: 113 additions & 0 deletions

File tree

Lines changed: 113 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,113 @@
1+
# .github/workflows/registry-rest-api-tests.yml
2+
name: Rest API tests
3+
4+
on:
5+
push:
6+
branches: [master, addRegistryRESTAPITest,test-addRegistryRESTAPITest]
7+
pull_request:
8+
types: [opened, synchronize, labeled]
9+
workflow_dispatch:
10+
11+
jobs:
12+
registry-rest-api-tests:
13+
timeout-minutes: 40
14+
runs-on: ubuntu-latest
15+
16+
services:
17+
kind:
18+
# Specify the Kubernetes version
19+
image: kindest/node:v1.30.6
20+
21+
env:
22+
KIND_CLUSTER: "registry-rest-api-cluster"
23+
24+
steps:
25+
- name: Checkout code
26+
uses: actions/checkout@v4
27+
28+
- name: Free Disk Space (Ubuntu)
29+
uses: jlumbroso/free-disk-space@v1.3.1
30+
with:
31+
android: true
32+
dotnet: true
33+
haskell: true
34+
large-packages: false
35+
docker-images: false
36+
swap-storage: false
37+
tool-cache: false
38+
39+
- name: Set up Go
40+
uses: actions/setup-go@v5
41+
with:
42+
go-version: 1.22.9
43+
44+
- name: Create KIND cluster
45+
run: |
46+
cat <<EOF | kind create cluster --name $KIND_CLUSTER --wait 10m --config=-
47+
kind: Cluster
48+
apiVersion: kind.x-k8s.io/v1alpha4
49+
nodes:
50+
- role: control-plane
51+
extraMounts:
52+
- hostPath: /mnt/kind
53+
containerPath: /var/lib/containerd
54+
extraPortMappings:
55+
- containerPort: 80
56+
hostPort: 80
57+
protocol: TCP
58+
- containerPort: 443
59+
hostPort: 443
60+
protocol: TCP
61+
kubeadmConfigPatches:
62+
- |
63+
kind: InitConfiguration
64+
nodeRegistration:
65+
kubeletExtraArgs:
66+
node-labels: "ingress-ready=true"
67+
EOF
68+
69+
- name: Set up kubernetes context
70+
run: |
71+
kubectl config use-context kind-$KIND_CLUSTER
72+
echo "kind context is switched to cluster kind-$KIND_CLUSTER"
73+
74+
75+
- name: Set up Ingress controller
76+
run: |
77+
echo "Installing ingress-nginx for KIND..."
78+
kubectl apply -f https://raw.githubusercontent.com/kubernetes/ingress-nginx/controller-v1.9.5/deploy/static/provider/kind/deploy.yaml
79+
80+
echo "⏳ Waiting for ingress controller to become ready..."
81+
kubectl wait --namespace ingress-nginx \
82+
--for=condition=Ready pod \
83+
--selector=app.kubernetes.io/component=controller \
84+
--timeout=180s
85+
86+
- name: Add ingress DNS to /etc/hosts
87+
run: |
88+
echo "127.0.0.1 feast.test" | sudo tee -a /etc/hosts
89+
echo "✅ Added 'feast.test' to /etc/hosts"
90+
91+
- name: Setup and Run Registry Rest API tests
92+
run: |
93+
echo "Running Registry REST API tests..."
94+
cd sdk/python/tests/registry_rest_api_tests/
95+
pytest test_feast_registry.py -s
96+
97+
- name: Clean up docker images
98+
if: always()
99+
run: |
100+
docker images --format '{{.Repository}}:{{.Tag}}' | grep 'feast' | xargs -r docker rmi -f
101+
docker system prune -a -f
102+
103+
- name: Debug KIND Cluster when there is a failure
104+
if: failure()
105+
run: |
106+
kubectl get pods --all-namespaces
107+
kubectl describe nodes
108+
109+
- name: Clean up
110+
if: always()
111+
run: |
112+
# Delete the KIND cluster after tests
113+
kind delete cluster --name kind-$KIND_CLUSTER

0 commit comments

Comments
 (0)