Skip to content

Commit 1c3496e

Browse files
committed
WIP
On-behalf-of: @SAP [email protected]
1 parent 976d28c commit 1c3496e

File tree

3 files changed

+124
-0
lines changed

3 files changed

+124
-0
lines changed

.prow.yaml

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -87,3 +87,22 @@ presubmits:
8787
requests:
8888
memory: 4Gi
8989
cpu: 2
90+
91+
- name: pull-api-syncagent-test-e2e
92+
always_run: true
93+
decorate: true
94+
clone_uri: "https://github.com/kcp-dev/api-syncagent"
95+
labels:
96+
preset-goproxy: "true"
97+
spec:
98+
containers:
99+
- image: ghcr.io/kcp-dev/infra/build:1.23.5-1
100+
command:
101+
- hack/ci/run-e2e-tests.sh
102+
resources:
103+
requests:
104+
memory: 4Gi
105+
cpu: 2
106+
# docker-in-docker needs privileged mode
107+
securityContext:
108+
privileged: true

hack/ci/run-e2e-tests.sh

Lines changed: 79 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,79 @@
1+
#!/usr/bin/env bash
2+
3+
# Copyright 2025 The KCP Authors.
4+
#
5+
# Licensed under the Apache License, Version 2.0 (the "License");
6+
# you may not use this file except in compliance with the License.
7+
# You may obtain a copy of the License at
8+
#
9+
# http://www.apache.org/licenses/LICENSE-2.0
10+
#
11+
# Unless required by applicable law or agreed to in writing, software
12+
# distributed under the License is distributed on an "AS IS" BASIS,
13+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14+
# See the License for the specific language governing permissions and
15+
# limitations under the License.
16+
17+
set -euo pipefail
18+
19+
# build the image(s)
20+
export IMAGE_TAG=local
21+
22+
echo "Building container images…"
23+
# ARCHITECTURES=amd64 DRY_RUN=yes ./hack/ci/build-image.sh
24+
25+
# start docker so we can run kind
26+
# start-docker.sh
27+
28+
# create a local kind cluster
29+
KIND_CLUSTER_NAME=e2e
30+
31+
# echo "Preloading the kindest/node image…"
32+
# docker load --input /kindest.tar
33+
34+
export KUBECONFIG=$(mktemp)
35+
export KUBECONFIG=e2e.kubeconfig
36+
echo "Creating kind cluster $KIND_CLUSTER_NAME"
37+
kind create cluster --name "$KIND_CLUSTER_NAME"
38+
chmod 600 "$KUBECONFIG"
39+
40+
# load the agent image into the kind cluster
41+
image="ghcr.io/kcp-dev/api-syncagent:$IMAGE_TAG"
42+
archive=agent.tar
43+
44+
echo "Loading api-syncagent image into kind…"
45+
buildah manifest push --all "$image" "oci-archive:$archive:$image"
46+
kind load image-archive "$archive" --name "$KIND_CLUSTER_NAME"
47+
48+
# deploy cert-manager
49+
echo "Installing cert-manager…"
50+
51+
helm repo add jetstack https://charts.jetstack.io
52+
helm repo update
53+
54+
kubectl apply --filename https://github.com/cert-manager/cert-manager/releases/download/v1.17.0/cert-manager.crds.yaml
55+
helm install \
56+
--wait \
57+
--namespace cert-manager \
58+
--create-namespace \
59+
--version v1.17.0 \
60+
cert-manager jetstack/cert-manager
61+
62+
# deploy a kcp which will live for the entire runtime of the e2e tests and be shared among all subtests
63+
echo "Installing kcp into kind…"
64+
65+
helm repo add kcp https://kcp-dev.github.io/helm-charts
66+
helm repo update
67+
68+
helm install \
69+
--wait \
70+
--namespace kcp \
71+
--create-namespace \
72+
--values hack/ci/testdata/kcp-kind-values.yaml \
73+
kcp-e2e kcp/kcp
74+
75+
# time to run the tests
76+
echo "Running e2e tests…"
77+
(set -x; go test -tags e2e -timeout 2h -v ./test/e2e/...)
78+
79+
echo "Done. :-)"
Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
externalHostname: "kcp.dev.local"
2+
externalPort: "8443"
3+
etcd:
4+
resources:
5+
requests:
6+
memory: 256Mi
7+
certificates:
8+
dnsNames:
9+
- localhost
10+
- kcp.dev.local
11+
kcp:
12+
# tag is set via --set flag to make it more dynamic for testing purposes
13+
volumeClassName: "standard"
14+
tokenAuth:
15+
enabled: true
16+
hostAliases:
17+
enabled: true
18+
values:
19+
- ip: "10.96.0.100"
20+
hostnames:
21+
- "kcp.dev.local"
22+
kcpFrontProxy:
23+
service:
24+
type: NodePort
25+
nodePort: 31443
26+
clusterIP: "10.96.0.100"

0 commit comments

Comments
 (0)