Skip to content

Commit 6adff3b

Browse files
Merge pull request #800 from madAndroid/main
⚠️ Introduce separate go modules for e2e tests to allow them to be imported independently
2 parents fa6a055 + f188c6d commit 6adff3b

23 files changed

+1348
-368
lines changed

Dockerfile

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,8 +27,10 @@ ENV GOPROXY=$goproxy
2727
# Copy the Go Modules manifests
2828
COPY go.mod go.mod
2929
COPY api/go.mod api/go.mod
30+
COPY test/go.mod test/go.mod
3031
COPY go.sum go.sum
3132
COPY api/go.sum api/go.sum
33+
COPY test/go.sum test/go.sum
3234
# Cache deps before building and copying source so that we don't need to re-download as much
3335
# and so that source changes don't invalidate our downloaded layer
3436
RUN go mod download

Makefile

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,7 @@ export GO111MODULE=on
3535
ROOT_DIR := $(shell dirname $(realpath $(firstword $(MAKEFILE_LIST))))
3636
TOOLS_DIR := hack/tools
3737
APIS_DIR := api
38+
TEST_DIR := test
3839
TOOLS_BIN_DIR := $(TOOLS_DIR)/bin
3940
BIN_DIR := bin
4041

@@ -171,7 +172,8 @@ e2e-tests: e2e-substitutions cluster-templates ## This target should be called f
171172
for image in $(E2E_CONTAINERS); do \
172173
$(CONTAINER_RUNTIME) pull $$image; \
173174
done
174-
time go test -v -timeout 24h --tags=e2e ./test/e2e/... -args \
175+
cd test; \
176+
time go test -v -timeout 24h --tags=e2e ./e2e/... -args \
175177
--ginkgo.timeout=6h --ginkgo.v --ginkgo.trace --ginkgo.show-node-events --ginkgo.no-color=$(GINKGO_NOCOLOR) \
176178
--ginkgo.junit-report="junit.e2e_suite.1.xml" \
177179
--ginkgo.focus="$(GINKGO_FOCUS)" $(_SKIP_ARGS) \
@@ -216,7 +218,8 @@ $(KUBEBUILDER): $(TOOLS_DIR)/go.mod
216218
cd $(TOOLS_DIR); ./install_kubebuilder.sh
217219

218220
$(SETUP_ENVTEST): $(TOOLS_DIR)/go.mod
219-
cd $(TOOLS_DIR); go build -tags=tools -o $(BIN_DIR)/setup-envtest sigs.k8s.io/controller-runtime/tools/setup-envtest
221+
cd $(TOOLS_DIR); go get sigs.k8s.io/controller-runtime/tools/setup-envtest; \
222+
go build -tags=tools -o $(BIN_DIR)/setup-envtest sigs.k8s.io/controller-runtime/tools/setup-envtest
220223

221224
.PHONY: $(KUSTOMIZE)
222225
$(KUSTOMIZE): # Download kustomize using hack script into tools folder.
@@ -270,6 +273,8 @@ modules: ## Runs go mod to ensure proper vendoring.
270273
cd $(TOOLS_DIR); go mod verify
271274
cd $(APIS_DIR); go mod tidy
272275
cd $(APIS_DIR); go mod verify
276+
cd $(TEST_DIR); go mod tidy
277+
cd $(TEST_DIR); go mod verify
273278

274279
.PHONY: generate
275280
generate: ## Generate code

docs/releasing.md

Lines changed: 33 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -48,22 +48,46 @@ For version v0.x.y:
4848

4949
#### Automated Process
5050

51-
1. Create an annotated tag `git tag -a -s v0.x.y -m v0.x.y`.
52-
1. Push the tag to the GitHub repository `git push origin v0.x.y`
51+
1. Create annotated tags:
52+
53+
```bash
54+
git tag -a -s v0.x.y -m v0.x.y
55+
git tag -a -s test/v0.x.y -m test/v0.x.y
56+
```
57+
58+
1. Push the tags to the GitHub repository:
59+
60+
```bash
61+
git push origin v0.x.y
62+
git push origin test/v0.x.y
63+
```
64+
5365
NB: `origin` should be the name of the remote pointing to
5466
`github.com/metal3-io/cluster-api-provider-metal3`.
55-
1. Check the tag is existent in upstream repository. If it is,
56-
GitHub workflow should have automatically created a draft
57-
release for you. Please make sure the release notes are checked
58-
thoroughly before it is published.
67+
1. Check the tags are existent in upstream repository. If they are,
68+
GitHub workflow should have automatically created draft releases
69+
for you. Please make sure the release notes are checked
70+
thoroughly before they are published.
5971

6072
#### Manual Process
6173

6274
1. Run `make release-notes` to create the release notes . Copy the output and sort
6375
manually the items that need to be sorted.
64-
1. Create an annotated tag `git tag -a v0.x.y -m v0.x.y`. To use your GPG
65-
signature when pushing the tag, use `git tag -s [...]` instead
66-
1. Push the tag to the GitHub repository `git push origin v0.x.y`
76+
1. Create annotated tags:
77+
78+
```bash
79+
git tag -a -s v0.x.y -m v0.x.y
80+
git tag -a -s test/v0.x.y -m test/v0.x.y
81+
```
82+
83+
To use your GPG signature when pushing the tag, use `git tag -s [...]` instead
84+
1. Push the tags to the GitHub repository:
85+
86+
```bash
87+
git push origin v0.x.y
88+
git push origin test/v0.x.y
89+
```
90+
6791
NB: `origin` should be the name of the remote pointing to
6892
`github.com/metal3-io/cluster-api-provider-metal3`
6993
1. Run `make release` to build artifacts (the image is automatically built by CI)

go.mod

Lines changed: 2 additions & 45 deletions
Original file line numberDiff line numberDiff line change
@@ -3,10 +3,8 @@ module github.com/metal3-io/cluster-api-provider-metal3
33
go 1.19
44

55
require (
6-
github.com/docker/docker v20.10.21+incompatible
76
github.com/go-logr/logr v1.2.3
87
github.com/golang/mock v1.6.0
9-
github.com/jinzhu/copier v0.3.2
108
github.com/metal3-io/baremetal-operator/apis v0.2.0
119
github.com/metal3-io/cluster-api-provider-metal3/api v0.0.0
1210
github.com/metal3-io/ip-address-manager/api v0.0.0-20221208094636-8892d31b812f
@@ -15,7 +13,6 @@ require (
1513
github.com/pkg/errors v0.9.1
1614
github.com/spf13/pflag v1.0.5
1715
gopkg.in/yaml.v2 v2.4.0
18-
gopkg.in/yaml.v3 v3.0.1
1916
k8s.io/api v0.25.0
2017
k8s.io/apiextensions-apiserver v0.25.0
2118
k8s.io/apimachinery v0.25.0
@@ -24,7 +21,6 @@ require (
2421
k8s.io/klog/v2 v2.80.1
2522
k8s.io/utils v0.0.0-20220823124924-e9cbc92d1a73
2623
sigs.k8s.io/cluster-api v1.3.0
27-
sigs.k8s.io/cluster-api/test v1.3.0
2824
sigs.k8s.io/controller-runtime v0.13.1
2925
sigs.k8s.io/yaml v1.3.0
3026
)
@@ -37,26 +33,13 @@ replace github.com/docker/distribution => github.com/docker/distribution v2.8.1+
3733

3834
require (
3935
cloud.google.com/go/compute v1.7.0 // indirect
40-
github.com/BurntSushi/toml v1.0.0 // indirect
41-
github.com/MakeNowJust/heredoc v1.0.0 // indirect
42-
github.com/Masterminds/goutils v1.1.1 // indirect
43-
github.com/Masterminds/semver/v3 v3.1.1 // indirect
44-
github.com/Masterminds/sprig/v3 v3.2.2 // indirect
45-
github.com/Microsoft/go-winio v0.5.1 // indirect
46-
github.com/alessio/shellescape v1.4.1 // indirect
47-
github.com/antlr/antlr4/runtime/Go/antlr v0.0.0-20220418222510-f25a4f6275ed // indirect
48-
github.com/asaskevich/govalidator v0.0.0-20190424111038-f61b66f89f4a // indirect
4936
github.com/beorn7/perks v1.0.1 // indirect
5037
github.com/blang/semver v3.5.1+incompatible // indirect
51-
github.com/blang/semver/v4 v4.0.0 // indirect
5238
github.com/cespare/xxhash/v2 v2.1.2 // indirect
5339
github.com/coredns/caddy v1.1.0 // indirect
5440
github.com/coredns/corefile-migration v1.0.18 // indirect
5541
github.com/davecgh/go-spew v1.1.1 // indirect
5642
github.com/docker/distribution v2.8.1+incompatible // indirect
57-
github.com/docker/go-connections v0.4.0 // indirect
58-
github.com/docker/go-units v0.4.0 // indirect
59-
github.com/drone/envsubst/v2 v2.0.0-20210730161058-179042472c46 // indirect
6043
github.com/emicklei/go-restful/v3 v3.9.0 // indirect
6144
github.com/evanphx/json-patch v5.6.0+incompatible // indirect
6245
github.com/evanphx/json-patch/v5 v5.6.0 // indirect
@@ -69,53 +52,30 @@ require (
6952
github.com/gogo/protobuf v1.3.2 // indirect
7053
github.com/golang/groupcache v0.0.0-20210331224755-41bb18bfe9da // indirect
7154
github.com/golang/protobuf v1.5.2 // indirect
72-
github.com/google/cel-go v0.12.4 // indirect
7355
github.com/google/gnostic v0.6.9 // indirect
7456
github.com/google/go-cmp v0.5.9 // indirect
75-
github.com/google/go-github/v45 v45.2.0 // indirect
76-
github.com/google/go-querystring v1.1.0 // indirect
7757
github.com/google/gofuzz v1.2.0 // indirect
78-
github.com/google/safetext v0.0.0-20220905092116-b49f7bc46da2 // indirect
7958
github.com/google/uuid v1.3.0 // indirect
80-
github.com/hashicorp/hcl v1.0.0 // indirect
81-
github.com/huandu/xstrings v1.3.3 // indirect
8259
github.com/imdario/mergo v0.3.13 // indirect
8360
github.com/inconshreveable/mousetrap v1.0.1 // indirect
8461
github.com/josharian/intern v1.0.0 // indirect
8562
github.com/json-iterator/go v1.1.12 // indirect
86-
github.com/magiconair/properties v1.8.6 // indirect
63+
github.com/kr/pretty v0.3.0 // indirect
8764
github.com/mailru/easyjson v0.7.7 // indirect
88-
github.com/mattn/go-isatty v0.0.16 // indirect
8965
github.com/matttproud/golang_protobuf_extensions v1.0.2-0.20181231171920-c182affec369 // indirect
9066
github.com/metal3-io/baremetal-operator/pkg/hardwareutils v0.2.0 // indirect
91-
github.com/mitchellh/copystructure v1.2.0 // indirect
92-
github.com/mitchellh/mapstructure v1.5.0 // indirect
93-
github.com/mitchellh/reflectwalk v1.0.2 // indirect
9467
github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd // indirect
9568
github.com/modern-go/reflect2 v1.0.2 // indirect
9669
github.com/munnerz/goautoneg v0.0.0-20191010083416-a7dc8b61c822 // indirect
9770
github.com/opencontainers/go-digest v1.0.0 // indirect
98-
github.com/opencontainers/image-spec v1.0.2 // indirect
99-
github.com/pelletier/go-toml v1.9.5 // indirect
100-
github.com/pelletier/go-toml/v2 v2.0.5 // indirect
10171
github.com/prometheus/client_golang v1.13.0 // indirect
10272
github.com/prometheus/client_model v0.2.0 // indirect
10373
github.com/prometheus/common v0.37.0 // indirect
10474
github.com/prometheus/procfs v0.8.0 // indirect
105-
github.com/shopspring/decimal v1.3.1 // indirect
106-
github.com/sirupsen/logrus v1.8.1 // indirect
107-
github.com/spf13/afero v1.9.2 // indirect
108-
github.com/spf13/cast v1.5.0 // indirect
10975
github.com/spf13/cobra v1.6.1 // indirect
110-
github.com/spf13/jwalterweatherman v1.1.0 // indirect
111-
github.com/spf13/viper v1.13.0 // indirect
112-
github.com/stoewer/go-strcase v1.2.0 // indirect
113-
github.com/subosito/gotenv v1.4.1 // indirect
114-
github.com/valyala/fastjson v1.6.3 // indirect
11576
go.uber.org/atomic v1.7.0 // indirect
11677
go.uber.org/multierr v1.6.0 // indirect
11778
go.uber.org/zap v1.21.0 // indirect
118-
golang.org/x/crypto v0.1.0 // indirect
11979
golang.org/x/net v0.2.0 // indirect
12080
golang.org/x/oauth2 v0.0.0-20220909003341-f21342109be1 // indirect
12181
golang.org/x/sys v0.2.0 // indirect
@@ -124,14 +84,11 @@ require (
12484
golang.org/x/time v0.0.0-20220722155302-e5dcc9cfc0b9 // indirect
12585
gomodules.xyz/jsonpatch/v2 v2.2.0 // indirect
12686
google.golang.org/appengine v1.6.7 // indirect
127-
google.golang.org/genproto v0.0.0-20220616135557-88e70c0c3a90 // indirect
12887
google.golang.org/protobuf v1.28.1 // indirect
12988
gopkg.in/inf.v0 v0.9.1 // indirect
130-
gopkg.in/ini.v1 v1.67.0 // indirect
131-
k8s.io/apiserver v0.25.0 // indirect
89+
gopkg.in/yaml.v3 v3.0.1 // indirect
13290
k8s.io/cluster-bootstrap v0.25.0 // indirect
13391
k8s.io/kube-openapi v0.0.0-20220803164354-a70c9af30aea // indirect
13492
sigs.k8s.io/json v0.0.0-20220713155537-f223a00ba0e2 // indirect
135-
sigs.k8s.io/kind v0.17.0 // indirect
13693
sigs.k8s.io/structured-merge-diff/v4 v4.2.3 // indirect
13794
)

0 commit comments

Comments
 (0)