jordigilh commented on code in PR #372:
URL: 
https://github.com/apache/incubator-kie-kogito-serverless-operator/pull/372#discussion_r1469797790


##########
workflowproj/workflowproj_test.go:
##########
@@ -112,10 +113,21 @@ func 
Test_Handler_WorkflowMinimalAndPropsAndSpecAndGeneric(t *testing.T) {
        assert.Equal(t, "02-hello-resources", proj.Resources[1].Name)
        assert.Equal(t, 
proj.Workflow.Spec.Resources.ConfigMaps[0].ConfigMap.Name, 
proj.Resources[0].Name)
        assert.Equal(t, 
proj.Workflow.Spec.Resources.ConfigMaps[1].ConfigMap.Name, 
proj.Resources[1].Name)
-       assert.NotEmpty(t, proj.Resources[0].Data, fmt.Sprintf("Data in 
proj.Resources[0] is empty %+v", proj.Resources[0]))
-       assert.NotEmpty(t, proj.Resources[1].Data, fmt.Sprintf("Data in 
proj.Resources[1] is empty %+v", proj.Resources[1]))
-       assert.NotEmpty(t, proj.Resources[0].Data["myopenapi.json"])
-       assert.NotEmpty(t, proj.Resources[1].Data["input.json"])
+       data, err := getResourceDataWithFileName(proj.Resources, 
"myopenapi.json")

Review Comment:
   I was able to reproduce the failure locally and it was just as you said in 
slack: the order of the resources, being a slice, is random and 
nondeterministic. In practice the order doesn't matter when executing the 
workflow, but it impacts the unit test, so adding this function to retrieve the 
contents should suffice without impacting the functional code.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to