You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@kie.apache.org by ri...@apache.org on 2023/09/25 17:09:29 UTC

[incubator-kie-kogito-serverless-operator] branch main updated: Fix workflowproj flacky tests by sorting arrays (#263)

This is an automated email from the ASF dual-hosted git repository.

ricardozanini pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/incubator-kie-kogito-serverless-operator.git


The following commit(s) were added to refs/heads/main by this push:
     new f4d3d34e Fix workflowproj flacky tests by sorting arrays (#263)
f4d3d34e is described below

commit f4d3d34e68e6bd36cb9200130a10b207af551522
Author: Ricardo Zanini <15...@users.noreply.github.com>
AuthorDate: Mon Sep 25 14:09:24 2023 -0300

    Fix workflowproj flacky tests by sorting arrays (#263)
    
    Signed-off-by: Ricardo Zanini <za...@redhat.com>
---
 workflowproj/workflowproj_test.go | 8 ++++++++
 1 file changed, 8 insertions(+)

diff --git a/workflowproj/workflowproj_test.go b/workflowproj/workflowproj_test.go
index 6cf3f412..8b67189e 100644
--- a/workflowproj/workflowproj_test.go
+++ b/workflowproj/workflowproj_test.go
@@ -18,6 +18,7 @@ import (
 	"io"
 	"os"
 	"path"
+	"sort"
 	"strings"
 	"testing"
 
@@ -84,6 +85,13 @@ func Test_Handler_WorkflowMinimalAndPropsAndSpecAndGeneric(t *testing.T) {
 	assert.NotNil(t, proj.Workflow)
 	assert.NotNil(t, proj.Properties)
 	assert.NotEmpty(t, proj.Resources)
+	sort.Slice(proj.Resources, func(i, j int) bool {
+		return proj.Resources[i].Name < proj.Resources[j].Name
+	})
+	sort.Slice(proj.Workflow.Spec.Resources.ConfigMaps, func(i, j int) bool {
+		return proj.Workflow.Spec.Resources.ConfigMaps[i].ConfigMap.Name < proj.Workflow.Spec.Resources.ConfigMaps[j].ConfigMap.Name
+	})
+
 	assert.Equal(t, "hello", proj.Workflow.Name)
 	assert.Equal(t, "hello-props", proj.Properties.Name)
 	assert.NotEmpty(t, proj.Properties.Data)


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@kie.apache.org
For additional commands, e-mail: commits-help@kie.apache.org