-
Notifications
You must be signed in to change notification settings - Fork 37
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #406 from jakobmoellerdev/OCPVE-677-vgtesting-refa…
…ctor OCPVE-677: chore: refactor vgmanager into different interfaces and introduce tests
- Loading branch information
Showing
39 changed files
with
6,666 additions
and
437 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
with-expecter: true | ||
filename: "mock_{{.InterfaceNameSnake}}.go" | ||
dir: "{{.InterfaceDir}}/mocks" | ||
mockname: "{{.Mock}}{{.InterfaceName}}" | ||
outpkg: "{{.PackageName}}" | ||
packages: | ||
github.com/openshift/lvm-operator/pkg/lsblk: | ||
interfaces: | ||
LSBLK: | ||
github.com/openshift/lvm-operator/pkg/lvm: | ||
interfaces: | ||
LVM: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -139,7 +139,10 @@ SKIP_RANGE ?= | |
manifests: controller-gen ## Generate WebhookConfiguration, ClusterRole and CustomResourceDefinition objects. | ||
$(CONTROLLER_GEN) rbac:roleName=manager-role crd webhook paths="./..." output:crd:artifacts:config=config/crd/bases | ||
|
||
generate: controller-gen ## Generate code containing DeepCopy, DeepCopyInto, and DeepCopyObject method implementations. | ||
mocks: mockery ## Generate mocks for unit test code | ||
$(shell $(MOCKERY) --log-level error) | ||
|
||
generate: controller-gen mocks ## Generate code containing DeepCopy, DeepCopyInto, and DeepCopyObject method implementations. Also retriggers mock generation | ||
$(CONTROLLER_GEN) object:headerFile="hack/boilerplate.go.txt" paths="./..." | ||
|
||
fmt: ## Run go fmt against code. | ||
|
@@ -319,6 +322,10 @@ GINKGO = $(shell pwd)/bin/ginkgo | |
ginkgo: ## Download ginkgo and gomega locally if necessary. | ||
$(call go-get-tool,$(GINKGO),github.com/onsi/ginkgo/v2/[email protected]) | ||
|
||
MOCKERY = $(shell pwd)/bin/mockery | ||
mockery: ## Download mockery and add locally if necessary | ||
$(call go-get-tool,$(MOCKERY),github.com/vektra/mockery/[email protected]) | ||
|
||
# go-get-tool will 'go get' any package $2 and install it to $1. | ||
PROJECT_DIR := $(shell dirname $(abspath $(lastword $(MAKEFILE_LIST)))) | ||
define go-get-tool | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.