Skip to content

Commit 3f7b445

Browse files
authored
Add smoke tests (#528)
Signed-off-by: Amulyam24 <[email protected]>
1 parent b56542d commit 3f7b445

File tree

8 files changed

+55
-16
lines changed

8 files changed

+55
-16
lines changed

Dockerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ COPY go.mod go.mod
2323
COPY go.sum go.sum
2424
# cache deps before building and copying source so that we don't need to re-download as much
2525
# and so that source changes don't invalidate our downloaded layer
26-
ENV GOPROXY https://goproxy.io,direct
26+
ENV GOPROXY https://proxy.golang.org,direct
2727
RUN go mod download
2828

2929
# Copy the go source

Makefile

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -62,6 +62,7 @@ CORE_MANIFEST_FILE := infrastructure-components
6262
CORE_CONFIG_DIR := config/default
6363
CORE_NAMESPACE := capi-ibmcloud-system
6464

65+
PATH := $(abspath $(TOOLS_BIN_DIR)):$(PATH)
6566
# Get the currently used golang install path (in GOPATH/bin, unless GOBIN is set)
6667
ifeq (,$(shell go env GOBIN))
6768
GOBIN=$(shell go env GOPATH)/bin
@@ -168,9 +169,9 @@ ARTIFACTS ?= $(REPO_ROOT)/_artifacts
168169
SKIP_CLEANUP ?= false
169170
SKIP_CREATE_MGMT_CLUSTER ?= false
170171

171-
#Run the end-to-end tests
172+
# Run the end-to-end tests
172173
.PHONY: test-e2e
173-
test-e2e: $(KUBECTL) $(GINKGO) $(ENVSUBST) set-flavor e2e-image
174+
test-e2e: $(KUBECTL) $(GINKGO) $(KUSTOMIZE) $(ENVSUBST) set-flavor e2e-image
174175
$(ENVSUBST) < $(E2E_CONF_FILE) > $(E2E_CONF_FILE_ENVSUBST)
175176
$(GINKGO) $(GINKGO_ARGS) ./test/e2e -- \
176177
-e2e.artifacts-folder="$(ARTIFACTS)" \
@@ -179,6 +180,11 @@ test-e2e: $(KUBECTL) $(GINKGO) $(ENVSUBST) set-flavor e2e-image
179180
-e2e.use-existing-cluster=$(SKIP_CREATE_MGMT_CLUSTER) \
180181
-e2e.flavor="$(E2E_FLAVOR)"
181182

183+
# Basic checks for deploying kind cluster and required providers
184+
.PHONY: test-sanity
185+
test-sanity:
186+
GINKGO_FOCUS="Run Sanity tests" $(MAKE) test-e2e
187+
182188
## --------------------------------------
183189
## Docker
184190
## --------------------------------------

go.mod

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -20,8 +20,8 @@ require (
2020
k8s.io/client-go v0.23.0
2121
k8s.io/klog/v2 v2.30.0
2222
k8s.io/utils v0.0.0-20210930125809-cb0fa318a74b
23-
sigs.k8s.io/cluster-api v1.1.0-rc.0
24-
sigs.k8s.io/cluster-api/test v1.1.0-rc.0
23+
sigs.k8s.io/cluster-api v1.1.0
24+
sigs.k8s.io/cluster-api/test v1.1.0
2525
sigs.k8s.io/controller-runtime v0.11.0
2626
)
2727

@@ -138,4 +138,4 @@ require (
138138
sigs.k8s.io/yaml v1.3.0 // indirect
139139
)
140140

141-
replace sigs.k8s.io/cluster-api => sigs.k8s.io/cluster-api v1.1.0-rc.0
141+
replace sigs.k8s.io/cluster-api => sigs.k8s.io/cluster-api v1.1.0

go.sum

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1807,10 +1807,10 @@ rsc.io/sampler v1.3.0/go.mod h1:T1hPZKmBbMNahiBKFy5HrXp6adAjACjK9JXDnKaTXpA=
18071807
sigs.k8s.io/apiserver-network-proxy/konnectivity-client v0.0.14/go.mod h1:LEScyzhFmoF5pso/YSeBstl57mOzx9xlU9n85RGrDQg=
18081808
sigs.k8s.io/apiserver-network-proxy/konnectivity-client v0.0.15/go.mod h1:LEScyzhFmoF5pso/YSeBstl57mOzx9xlU9n85RGrDQg=
18091809
sigs.k8s.io/apiserver-network-proxy/konnectivity-client v0.0.25/go.mod h1:Mlj9PNLmG9bZ6BHFwFKDo5afkpWyUISkb9Me0GnK66I=
1810-
sigs.k8s.io/cluster-api v1.1.0-rc.0 h1:YLNabhJpbfuujnJUsR2wONBy+GU5ji9RrZb2SokG4vQ=
1811-
sigs.k8s.io/cluster-api v1.1.0-rc.0/go.mod h1:aSxmmNwDjmg9rDaL0RhRELpGX9uSTTwLF02AMtk/XGY=
1812-
sigs.k8s.io/cluster-api/test v1.1.0-rc.0 h1:U0HK82eHJJq1H3uMSf26BOOGu8ioIXuGNIoUAhvISpE=
1813-
sigs.k8s.io/cluster-api/test v1.1.0-rc.0/go.mod h1:ct7zQrWXsYIAhL/lMLFPfCAqGLDBTEzx+AtwIXpI45o=
1810+
sigs.k8s.io/cluster-api v1.1.0 h1:zJJzIUezEveYK3Ljmk/jku+DYd96RP5bZ181l2W9gVg=
1811+
sigs.k8s.io/cluster-api v1.1.0/go.mod h1:aSxmmNwDjmg9rDaL0RhRELpGX9uSTTwLF02AMtk/XGY=
1812+
sigs.k8s.io/cluster-api/test v1.1.0 h1:eBVFCWxu9/fb/By02uFjOreG9GAd9eax9uZKsCXP58s=
1813+
sigs.k8s.io/cluster-api/test v1.1.0/go.mod h1:ct7zQrWXsYIAhL/lMLFPfCAqGLDBTEzx+AtwIXpI45o=
18141814
sigs.k8s.io/controller-runtime v0.11.0 h1:DqO+c8mywcZLFJWILq4iktoECTyn30Bkj0CwgqMpZWQ=
18151815
sigs.k8s.io/controller-runtime v0.11.0/go.mod h1:KKwLiTooNGu+JmLZGn9Sl3Gjmfj66eMbCQznLP5zcqA=
18161816
sigs.k8s.io/json v0.0.0-20211020170558-c049b76a60c6 h1:fD1pz4yfdADVNfFmcP2aBEtudwUQ1AlLnRBALr33v3s=

scripts/ci-smoke-test.sh

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
#!/bin/bash
2+
3+
# Copyright 2022 The Kubernetes 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 -o errexit
18+
set -o nounset
19+
set -o pipefail
20+
21+
REPO_ROOT=$(dirname "${BASH_SOURCE[0]}")/..
22+
# shellcheck source=../hack/ensure-go.sh
23+
source "${REPO_ROOT}/hack/ensure-go.sh"
24+
25+
echo "**** Running basic checks by deploying the required CAPI providers on a kind cluster ***"
26+
cd "${REPO_ROOT}" && make test-sanity

test/e2e/config/ibmcloud-e2e-powervs.yaml

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -9,24 +9,24 @@ providers:
99
- name: cluster-api
1010
type: CoreProvider
1111
versions:
12-
- name: v1.0.2
13-
value: https://github.com/kubernetes-sigs/cluster-api/releases/download/v1.0.2/core-components.yaml
12+
- name: v1.1.0
13+
value: https://github.com/kubernetes-sigs/cluster-api/releases/download/v1.1.0/core-components.yaml
1414
type: url
1515
files:
1616
- sourcePath: "${PWD}/test/e2e/data/shared/metadata.yaml"
1717
- name: kubeadm
1818
type: BootstrapProvider
1919
versions:
20-
- name: v1.0.2
21-
value: https://github.com/kubernetes-sigs/cluster-api/releases/download/v1.0.2/bootstrap-components.yaml
20+
- name: v1.1.0
21+
value: https://github.com/kubernetes-sigs/cluster-api/releases/download/v1.1.0/bootstrap-components.yaml
2222
type: url
2323
files:
2424
- sourcePath: "${PWD}/test/e2e/data/shared/metadata.yaml"
2525
- name: kubeadm
2626
type: ControlPlaneProvider
2727
versions:
28-
- name: v1.0.2
29-
value: https://github.com/kubernetes-sigs/cluster-api/releases/download/v1.0.2/control-plane-components.yaml
28+
- name: v1.1.0
29+
value: https://github.com/kubernetes-sigs/cluster-api/releases/download/v1.1.0/control-plane-components.yaml
3030
type: url
3131
files:
3232
- sourcePath: "${PWD}/test/e2e/data/shared/metadata.yaml"

test/e2e/data/shared/metadata.yaml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,9 @@
55
# update this file only when a new major or minor version is released
66
apiVersion: clusterctl.cluster.x-k8s.io/v1alpha3
77
releaseSeries:
8+
- major: 1
9+
minor: 1
10+
contract: v1beta1
811
- major: 1
912
minor: 0
1013
contract: v1beta1

test/e2e/suite_test.go

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -223,6 +223,10 @@ func initBootstrapCluster(bootstrapClusterProxy framework.ClusterProxy, config *
223223
}, config.GetIntervals(bootstrapClusterProxy.GetName(), "wait-controllers")...)
224224
}
225225

226+
var _ = Describe("Run Sanity tests", func() {
227+
// TO DO- Add additional testcases for sanity checks
228+
})
229+
226230
func tearDown(bootstrapClusterProvider bootstrap.ClusterProvider, bootstrapClusterProxy framework.ClusterProxy) {
227231
if bootstrapClusterProxy != nil {
228232
bootstrapClusterProxy.Dispose(context.TODO())

0 commit comments

Comments
 (0)