Skip to content

Nerf unit tests and fix build directive - #4

Merged
Miciah merged 2 commits into
openshift:mainfrom
sgreene570:nerf-unit-tests
Jun 22, 2021
Merged

Miciah merged 2 commits into
openshift:mainfrom
sgreene570:nerf-unit-tests

Conversation

@sgreene570

Copy link
Copy Markdown

Makefile: Force builds to use vendor/

Add necessary go flags to the make build directive.

Remove mock-cluster unit test

rm controllers/suite_test.go

The suite_test.go unit test file creates a mock cluster using etcd,
among other binaries. This does not intermix well with our CI
environment.

This commit removes this file. We will add unit tests in the near
future.

Add necessary go flags to the `make build` directive.
`rm controllers/suite_test.go`

The suite_test.go unit test file creates a mock cluster using etcd,
among other binaries. This does not intermix well with our CI
environment.

This commit removes this file. We will add unit tests in the near
future.
@openshift-ci
openshift-ci Bot requested review from frobware and knobunc June 22, 2021 14:01
Comment thread Makefile

##@ Build

GO=GO111MODULE=on GOFLAGS=-mod=vendor CGO_ENABLED=0 go

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Presumably CGO_ENABLED=0 is key because the other variables are on by default with the version of Go we currently use, right?

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That, and -mod=vendor

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

According to https://golang.org/ref/mod#vendoring, "If the vendor directory is present in the main module's root directory, it will be used automatically if the go version in the main module's go.mod file is 1.14 or higher." So it seems like specifying GOFLAGS=-mod=vendor is redundant—but it doesn't hurt anything.

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Huh, TIL. Still, can't hurt to be explicit.

@Miciah
Miciah merged commit bd7169e into openshift:main Jun 22, 2021
sgreene570 added a commit to sgreene570/external-dns-operator that referenced this pull request Jun 28, 2021
Run `go mod tidy` and `go mod vendor` and commit the output.
This repo does not have a `verify` job to ensure that
`vendor/` is in sync, and openshift#4
knocked `go.mod` out of sync by removing the need for the gomega and ginkgo
dependency (without also removing the dependency requirement).
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants