@@ -17,14 +17,16 @@ limitations under the License.
1717package appwrapper
1818
1919import (
20- . "github.com/onsi/ginkgo/v2"
21- . "github.com/onsi/gomega"
22- "github.com/project-codeflare/appwrapper/pkg/config"
2320 v1 "k8s.io/api/core/v1"
2421 "k8s.io/apimachinery/pkg/api/resource"
2522 metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
2623 "k8s.io/apimachinery/pkg/types"
2724 "sigs.k8s.io/controller-runtime/pkg/reconcile"
25+
26+ "github.com/project-codeflare/appwrapper/pkg/config"
27+
28+ . "github.com/onsi/ginkgo/v2"
29+ . "github.com/onsi/gomega"
2830)
2931
3032var _ = Describe ("NodeMonitor Controller" , func () {
@@ -74,7 +76,7 @@ var _ = Describe("NodeMonitor Controller", func() {
7476 Expect (err ).NotTo (HaveOccurred ())
7577
7678 By ("Healthy cluster has no unhealthy nodes" )
77- Expect (len ( noExecuteNodes )) .Should (Equal ( 0 ))
79+ Expect (noExecuteNodes ).Should (BeEmpty ( ))
7880
7981 By ("A node labeled EVICT is detected as unhealthy" )
8082 node := getNode (node1Name .Name )
@@ -84,7 +86,7 @@ var _ = Describe("NodeMonitor Controller", func() {
8486 Expect (err ).NotTo (HaveOccurred ())
8587 _ , err = nodeMonitor .Reconcile (ctx , reconcile.Request {NamespacedName : node2Name })
8688 Expect (err ).NotTo (HaveOccurred ())
87- Expect (len ( noExecuteNodes )) .Should (Equal (1 ))
89+ Expect (noExecuteNodes ).Should (HaveLen (1 ))
8890 Expect (noExecuteNodes ).Should (HaveKey (node1Name .Name ))
8991 Expect (noExecuteNodes [node1Name .Name ]).Should (HaveKey ("nvidia.com/gpu" ))
9092
@@ -93,7 +95,7 @@ var _ = Describe("NodeMonitor Controller", func() {
9395 Expect (err ).NotTo (HaveOccurred ())
9496 _ , err = nodeMonitor .Reconcile (ctx , reconcile.Request {NamespacedName : node2Name })
9597 Expect (err ).NotTo (HaveOccurred ())
96- Expect (len ( noExecuteNodes )) .Should (Equal (1 ))
98+ Expect (noExecuteNodes ).Should (HaveLen (1 ))
9799 Expect (noExecuteNodes ).Should (HaveKey (node1Name .Name ))
98100 Expect (noExecuteNodes [node1Name .Name ]).Should (HaveKey ("nvidia.com/gpu" ))
99101
@@ -102,7 +104,7 @@ var _ = Describe("NodeMonitor Controller", func() {
102104 Expect (k8sClient .Update (ctx , node )).Should (Succeed ())
103105 _ , err = nodeMonitor .Reconcile (ctx , reconcile.Request {NamespacedName : node1Name })
104106 Expect (err ).NotTo (HaveOccurred ())
105- Expect (len ( noExecuteNodes )) .Should (Equal ( 0 ))
107+ Expect (noExecuteNodes ).Should (BeEmpty ( ))
106108
107109 deleteNode (node1Name .Name )
108110 deleteNode (node2Name .Name )
0 commit comments