Skip to content
This repository has been archived by the owner on Feb 22, 2023. It is now read-only.

Increased unit test coverage #72

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -36,10 +36,17 @@ ldflags:=\
-X $(import_path)/build.Commit=$(commit) \
$(NULL)

.PHONY: gen-mocks
gen-mocks:
mockgen -source=provider/cluster_resource.go -destination=provider/cluster_resource_mock.go -package provider
Copy link
Collaborator

Choose a reason for hiding this comment

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

Instead of adding specific files here in the Makefile, add go:generate mockgen comment near the interface to be mocked and use go:genernate command recursively in the project directory


.PHONY: build
build:
go build -ldflags="$(ldflags)" -o ${BINARY}

generate-mocks:
mockgen -source=provider/cluster_resource.go -destination=provider/cluster_resource_mock.go -package provider

.PHONY: install
install: build
platform=$$(terraform version -json | jq -r .platform); \
Expand Down
1 change: 1 addition & 0 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ module github.com/openshift-online/terraform-provider-ocm
go 1.17

require (
github.com/golang/mock v1.4.4
github.com/hashicorp/go-version v1.3.0
github.com/hashicorp/terraform-plugin-framework v0.5.0
github.com/hashicorp/terraform-plugin-go v0.5.0
Expand Down
1 change: 1 addition & 0 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -106,6 +106,7 @@ github.com/golang/mock v1.3.1/go.mod h1:sBzyDLLjw3U8JLTeZvSv8jJB+tU5PVekmnlKIyFU
github.com/golang/mock v1.4.0/go.mod h1:UOMv5ysSaYNkG+OFQykRIcU/QvvxJf3p21QfJ2Bt3cw=
github.com/golang/mock v1.4.1/go.mod h1:UOMv5ysSaYNkG+OFQykRIcU/QvvxJf3p21QfJ2Bt3cw=
github.com/golang/mock v1.4.3/go.mod h1:UOMv5ysSaYNkG+OFQykRIcU/QvvxJf3p21QfJ2Bt3cw=
github.com/golang/mock v1.4.4 h1:l75CXGRSwbaYNpl/Z2X1XIIAMSCquvXgpVZDhwEIJsc=
github.com/golang/mock v1.4.4/go.mod h1:l3mdAwkq5BuhzHwde/uurv3sEJeZMXNpwsxVWU71h+4=
github.com/golang/protobuf v1.1.0/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U=
github.com/golang/protobuf v1.2.0/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U=
Expand Down
Loading