Skip to content

Commit f1a56e0

Browse files
committed
add: update machinepool tests to identify machines based on label
1 parent 9c0cecc commit f1a56e0

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

test/e2e/instascale_machinepool_test.go

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -50,9 +50,9 @@ func TestInstascaleMachinePool(t *testing.T) {
5050
defer connection.Close()
5151

5252
// check existing cluster machine pool resources
53-
// look for machine pool with aw name - expect not to find it
53+
// look for a machine pool with a label key equal to aw name - expect NOT to find it
5454
test.Expect(GetMachinePools(test, connection)).
55-
ShouldNot(ContainElement(WithTransform(MachinePoolId, Equal("test-instascale-g4dn-xlarge"))))
55+
ShouldNot(ContainElement(WithTransform(MachinePoolLabels, HaveKey("test-instascale"))))
5656

5757
// Setup batch job and AppWrapper
5858
aw := instaScaleJobAppWrapper(test, namespace, cm)
@@ -66,15 +66,15 @@ func TestInstascaleMachinePool(t *testing.T) {
6666
test.Eventually(AppWrapper(test, namespace, aw.Name), TestTimeoutGpuProvisioning).
6767
Should(WithTransform(AppWrapperState, Equal(mcadv1beta1.AppWrapperStateActive)))
6868

69-
// look for machine pool with aw name - expect to find it
69+
// look for a machine pool with a label key equal to aw name - expect to find it
7070
test.Eventually(MachinePools(test, connection), TestTimeoutLong).
71-
Should(ContainElement(WithTransform(MachinePoolId, Equal("test-instascale-g4dn-xlarge"))))
71+
Should(ContainElement(WithTransform(MachinePoolLabels, HaveKey("test-instascale"))))
7272

7373
test.Eventually(AppWrapper(test, namespace, aw.Name), TestTimeoutShort).
7474
Should(WithTransform(AppWrapperState, Equal(mcadv1beta1.AppWrapperStateCompleted)))
7575

76-
// look for machine pool with aw name - expect not to find it
76+
// look for a machine pool with a label key equal to aw name - expect NOT to find it
7777
test.Eventually(MachinePools(test, connection), TestTimeoutLong).
78-
ShouldNot(ContainElement(WithTransform(MachinePoolId, Equal("test-instascale-g4dn-xlarge"))))
78+
ShouldNot(ContainElement(WithTransform(MachinePoolLabels, HaveKey("test-instascale"))))
7979

8080
}

0 commit comments

Comments
 (0)