Skip to content

Commit

Permalink
Remove envtest from webhook tests
Browse files Browse the repository at this point in the history
its not needed to start envtest.
moreover without this change, envtest environment
would have remained running in the system as it was not stopped
when test finished.

Signed-off-by: adrianc <[email protected]>
  • Loading branch information
adrianchiris committed Jan 29, 2024
1 parent 3c15708 commit 4107581
Showing 1 changed file with 1 addition and 8 deletions.
9 changes: 1 addition & 8 deletions pkg/webhook/validate_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,6 @@ import (

. "github.com/onsi/gomega"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
"k8s.io/client-go/kubernetes"
"sigs.k8s.io/controller-runtime/pkg/envtest"

. "github.com/k8snetworkplumbingwg/sriov-network-operator/api/v1"
constants "github.com/k8snetworkplumbingwg/sriov-network-operator/pkg/consts"
Expand Down Expand Up @@ -1044,13 +1042,8 @@ func TestValidatePolicyForNodeStateWithInvalidDevice(t *testing.T) {
},
}
g := NewGomegaWithT(t)
var testEnv = &envtest.Environment{}

cfg, err := testEnv.Start()
g.Expect(err).ToNot(HaveOccurred())
g.Expect(cfg).ToNot(BeNil())
kubeclient = kubernetes.NewForConfigOrDie(cfg)
_, err = validatePolicyForNodeState(policy, state, NewNode())
_, err := validatePolicyForNodeState(policy, state, NewNode())
g.Expect(err).NotTo(HaveOccurred())
}

Expand Down

0 comments on commit 4107581

Please sign in to comment.