Skip to content

Commit c1a02cc

Browse files
Merge pull request #44 from Fedosin/modernize_tooling
OCPCLOUD-1811: Modernize test tooling
2 parents 578be79 + bb08c79 commit c1a02cc

File tree

262 files changed

+30094
-423
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

262 files changed

+30094
-423
lines changed

Dockerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
# See the License for the specific language governing permissions and
1313
# limitations under the License.
1414

15-
FROM registry.ci.openshift.org/openshift/release:golang-1.18 AS builder
15+
FROM registry.ci.openshift.org/openshift/release:golang-1.19 AS builder
1616
WORKDIR /go/src/github.com/openshift/machine-api-provider-azure
1717
COPY . .
1818
# VERSION env gets set in the openshift/release image and refers to the golang version, which interferes with our own

Makefile

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,16 @@ endif
2424
VERSION ?= $(shell git describe --always --abbrev=7)
2525
REPO_PATH ?= github.com/openshift/machine-api-provider-azure
2626
LD_FLAGS ?= -X $(REPO_PATH)/pkg/version.Raw=$(VERSION) -extldflags -static
27-
BUILD_IMAGE ?= registry.ci.openshift.org/openshift/release:golang-1.18
27+
BUILD_IMAGE ?= registry.ci.openshift.org/openshift/release:golang-1.19
28+
29+
# ENVTEST_K8S_VERSION refers to the version of kubebuilder assets to be downloaded by envtest binary.
30+
ENVTEST_K8S_VERSION = 1.25
31+
32+
PROJECT_DIR := $(shell dirname $(abspath $(lastword $(MAKEFILE_LIST))))
33+
CONTROLLER_GEN = go run ${PROJECT_DIR}/vendor/sigs.k8s.io/controller-tools/cmd/controller-gen
34+
ENVTEST = go run ${PROJECT_DIR}/vendor/sigs.k8s.io/controller-runtime/tools/setup-envtest
35+
GINKGO = go run ${PROJECT_DIR}/vendor/github.com/onsi/ginkgo/v2/ginkgo
36+
GOLANGCI_LINT = go run ${PROJECT_DIR}/vendor/github.com/golangci/golangci-lint/cmd/golangci-lint
2837

2938
GO111MODULE = on
3039
export GO111MODULE
@@ -53,7 +62,7 @@ endif
5362

5463
# race tests need CGO_ENABLED, everything else should have it disabled
5564
CGO_ENABLED = 0
56-
unit : CGO_ENABLED = 1
65+
unit test : CGO_ENABLED = 1
5766

5867
ifeq ($(NO_DOCKER), 1)
5968
DOCKER_CMD = CGO_ENABLED=$(CGO_ENABLED) GOARCH=$(GOARCH) GOOS=$(GOOS)
@@ -106,7 +115,7 @@ build: ## build binaries
106115
.PHONY: test
107116
test: ## Run tests
108117
@echo -e "\033[32mTesting...\033[0m"
109-
$(DOCKER_CMD) hack/ci-test.sh
118+
KUBEBUILDER_ASSETS="$(shell $(ENVTEST) use $(ENVTEST_K8S_VERSION) -p path --bin-dir $(PROJECT_DIR)/bin)" ./hack/ci-test.sh
110119

111120
.PHONY: unit
112121
unit: # Run unit test

go.mod

Lines changed: 17 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
module github.com/openshift/machine-api-provider-azure
22

3-
go 1.18
3+
go 1.19
44

55
require (
66
github.com/Azure/azure-sdk-for-go v66.0.0+incompatible
@@ -13,8 +13,8 @@ require (
1313
github.com/google/go-cmp v0.5.9
1414
github.com/hashicorp/golang-lru v0.5.1
1515
github.com/mitchellh/mapstructure v1.4.2
16-
github.com/onsi/ginkgo/v2 v2.6.0
17-
github.com/onsi/gomega v1.24.0
16+
github.com/onsi/ginkgo/v2 v2.7.0
17+
github.com/onsi/gomega v1.24.1
1818
github.com/openshift/api v0.0.0-20220921125526-1866ef90edbf
1919
github.com/openshift/machine-api-operator v0.2.1-0.20220922080915-f7f326323f37
2020
github.com/pkg/errors v0.9.1
@@ -28,6 +28,7 @@ require (
2828
k8s.io/klog/v2 v2.80.1
2929
k8s.io/utils v0.0.0-20220823124924-e9cbc92d1a73
3030
sigs.k8s.io/controller-runtime v0.13.0
31+
sigs.k8s.io/controller-runtime/tools/setup-envtest v0.0.0-20221219225944-92234b3c49a3
3132
sigs.k8s.io/controller-tools v0.10.0
3233
sigs.k8s.io/yaml v1.3.0
3334
)
@@ -53,9 +54,11 @@ require (
5354
github.com/fatih/color v1.13.0 // indirect
5455
github.com/fsnotify/fsnotify v1.5.4 // indirect
5556
github.com/go-errors/errors v1.0.1 // indirect
57+
github.com/go-logr/zapr v1.2.3 // indirect
5658
github.com/go-openapi/jsonpointer v0.19.5 // indirect
5759
github.com/go-openapi/jsonreference v0.19.5 // indirect
5860
github.com/go-openapi/swag v0.19.14 // indirect
61+
github.com/go-task/slim-sprig v0.0.0-20210107165309-348f09dbbbc0 // indirect
5962
github.com/gobuffalo/flect v0.2.5 // indirect
6063
github.com/gogo/protobuf v1.3.2 // indirect
6164
github.com/golang-jwt/jwt/v4 v4.2.0 // indirect
@@ -64,6 +67,7 @@ require (
6467
github.com/google/btree v1.0.1 // indirect
6568
github.com/google/gnostic v0.5.7-v3refs // indirect
6669
github.com/google/gofuzz v1.2.0 // indirect
70+
github.com/google/pprof v0.0.0-20210407192527-94a9f03dee38 // indirect
6771
github.com/google/shlex v0.0.0-20191202100458-e7afc7fbc510 // indirect
6872
github.com/google/uuid v1.3.0 // indirect
6973
github.com/gregjones/httpcache v0.0.0-20180305231024-9cad4c3443a7 // indirect
@@ -91,17 +95,21 @@ require (
9195
github.com/prometheus/common v0.32.1 // indirect
9296
github.com/prometheus/procfs v0.7.3 // indirect
9397
github.com/russross/blackfriday v1.5.2 // indirect
98+
github.com/spf13/afero v1.6.0 // indirect
9499
github.com/spf13/pflag v1.0.5 // indirect
95100
github.com/xlab/treeprint v1.1.0 // indirect
96101
go.starlark.net v0.0.0-20200306205701-8dd3e2ee1dd5 // indirect
97-
golang.org/x/mod v0.6.0 // indirect
98-
golang.org/x/net v0.1.0 // indirect
102+
go.uber.org/atomic v1.7.0 // indirect
103+
go.uber.org/multierr v1.6.0 // indirect
104+
go.uber.org/zap v1.21.0 // indirect
105+
golang.org/x/mod v0.7.0 // indirect
106+
golang.org/x/net v0.3.0 // indirect
99107
golang.org/x/oauth2 v0.0.0-20220411215720-9780585627b5 // indirect
100-
golang.org/x/sys v0.2.0 // indirect
101-
golang.org/x/term v0.1.0 // indirect
102-
golang.org/x/text v0.4.0 // indirect
108+
golang.org/x/sys v0.3.0 // indirect
109+
golang.org/x/term v0.3.0 // indirect
110+
golang.org/x/text v0.5.0 // indirect
103111
golang.org/x/time v0.0.0-20220609170525-579cf78fd858 // indirect
104-
golang.org/x/tools v0.2.0 // indirect
112+
golang.org/x/tools v0.4.0 // indirect
105113
gomodules.xyz/jsonpatch/v2 v2.2.0 // indirect
106114
google.golang.org/appengine v1.6.7 // indirect
107115
google.golang.org/protobuf v1.28.0 // indirect

0 commit comments

Comments
 (0)