Skip to content

Commit

Permalink
[EPMDEDP-7391]: test: Add fake kubeconfig to fix unit tests
Browse files Browse the repository at this point in the history
Some tests require kubeconfig to be defined

Signed-off-by: Sergiy Kulanov <[email protected]>
Change-Id: I05b8e212c55cb75a87cd60156aa315b78206fa48
  • Loading branch information
SergK committed Dec 8, 2021
1 parent 1a2834c commit 4e82675
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 1 deletion.
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ help: ## Display this help

# Run tests
test: fmt vet
go test ./... -coverprofile=coverage.out `go list ./...`
KUBECONFIG=${CURRENT_DIR}/hack/kubecfg-stub.yaml go test ./... -coverprofile=coverage.out `go list ./...`

fmt: ## Run go fmt
go fmt ./...
Expand Down
12 changes: 12 additions & 0 deletions hack/kubecfg-stub.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
apiVersion: v1
kind: Config
clusters:
- cluster:
server: https://1.2.3.4
name: mock
contexts:
- context:
cluster: mock
namespace: default
name: mock-ctx
current-context: mock-ctx

0 comments on commit 4e82675

Please sign in to comment.