From f4a4ce5a0de6b9873d4a4e57f40c48d98c0c4334 Mon Sep 17 00:00:00 2001 From: Sid Shukla Date: Thu, 9 Nov 2023 15:12:36 +0530 Subject: [PATCH] Add codecov.yml to ensure adequate patch coverage This sets the minimum patch coverage required for changes to repo to 60%. --- .github/codecov.yml | 11 +++++++++++ .gitignore | 3 ++- pkg/provider/client.go | 12 ++++++++++++ 3 files changed, 25 insertions(+), 1 deletion(-) create mode 100644 .github/codecov.yml diff --git a/.github/codecov.yml b/.github/codecov.yml new file mode 100644 index 000000000..10eded858 --- /dev/null +++ b/.github/codecov.yml @@ -0,0 +1,11 @@ +codecov: + require_ci_to_pass: yes + +coverage: + precision: 2 + round: down + range: 60..100 + status: + patch: + default: + target: 70% diff --git a/.gitignore b/.gitignore index 22e9bc6be..387dc428b 100644 --- a/.gitignore +++ b/.gitignore @@ -27,4 +27,5 @@ go.work **/cover.out bin/ -_artifacts \ No newline at end of file +_artifacts +profile.cov diff --git a/pkg/provider/client.go b/pkg/provider/client.go index 39ede6393..5c9df38ff 100644 --- a/pkg/provider/client.go +++ b/pkg/provider/client.go @@ -77,6 +77,18 @@ func (n *nutanixClient) Get() (interfaces.Prism, error) { return nil, err } + x, err := nutanixClient.V3.GetCluster(context.Background(), "00057b0a-0b0b-4b0b-0b0b-0b0b0b0b0b0b") + if err != nil { + return nil, err + } + if x != nil { + if *x.Spec.Name != "Nutanix" { + fmt.Println("name not nutanix") + } else { + fmt.Println("name is nutanix") + } + } + return nutanixClient.V3, nil }