66	. "github.com/onsi/gomega" 
77	mcadv1beta1 "github.com/project-codeflare/multi-cluster-app-dispatcher/pkg/apis/controller/v1beta1" 
88
9+ 	metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" 
10+ 
911	. "github.com/project-codeflare/codeflare-operator/test/support" 
1012)
1113
@@ -29,27 +31,30 @@ func TestInstascaleMachineSet(t *testing.T) {
2931		"mnist.py" : ReadFile (test , "mnist.py" ),
3032	})
3133
34+ 	// // Setup batch job and AppWrapper 
35+ 	aw  :=  instaScaleJobAppWrapper (test , namespace , cm )
36+ 
3237	// look for machine set with aw name - expect to find it 
33- 	test .Expect (GetMachineSets (test )).Should (ContainElement (WithTransform (MachineSetId , Equal ("test-instascale" ))))
38+ 	test .Expect (GetMachineSets (test )).Should (ContainElement (WithTransform (MachineSetId , Equal (aw . Name ))))
3439	// look for machine belonging to the machine set, there should be none 
35- 	test .Expect (GetMachines (test , "test-instascale" )).Should (BeEmpty ())
40+ 	test .Expect (GetMachines (test , aw . Name )).Should (BeEmpty ())
3641
37- 	// // Setup batch job and AppWrapper  
38- 	_ , aw ,  err  :=  createInstaScaleJobAppWrapper ( test ,  namespace ,  cm )
42+ 	// apply AppWrapper to cluster  
43+ 	_ , err  :=  test . Client (). MCAD (). WorkloadV1beta1 (). AppWrappers ( namespace . Name ). Create ( test . Ctx (),  aw , metav1. CreateOptions {} )
3944	test .Expect (err ).NotTo (HaveOccurred ())
4045
4146	// assert that AppWrapper goes to "Running" state 
4247	test .Eventually (AppWrapper (test , namespace , aw .Name ), TestTimeoutGpuProvisioning ).
4348		Should (WithTransform (AppWrapperState , Equal (mcadv1beta1 .AppWrapperStateActive )))
4449
4550	// look for machine belonging to the machine set - expect to find it 
46- 	test .Eventually (Machines (test , "test-instascale" ), TestTimeoutLong ).Should (HaveLen (1 ))
51+ 	test .Eventually (Machines (test , aw . Name ), TestTimeoutLong ).Should (HaveLen (1 ))
4752
4853	// assert that the AppWrapper goes to "Completed" state 
4954	test .Eventually (AppWrapper (test , namespace , aw .Name ), TestTimeoutMedium ).
5055		Should (WithTransform (AppWrapperState , Equal (mcadv1beta1 .AppWrapperStateCompleted )))
5156
5257	// look for machine belonging to the machine set - there should be none 
53- 	test .Eventually (Machines (test , "test-instascale" ), TestTimeoutLong ).Should (BeEmpty ())
58+ 	test .Eventually (Machines (test , aw . Name ), TestTimeoutLong ).Should (BeEmpty ())
5459
5560}
0 commit comments