From 58f23554cb2198fa167dc7ad3d46c9dfcdb84ec6 Mon Sep 17 00:00:00 2001 From: Cristian Maglie Date: Mon, 27 Mar 2023 12:08:54 +0200 Subject: [PATCH] Made an integration test more reliable --- internal/integrationtest/core/core_test.go | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/internal/integrationtest/core/core_test.go b/internal/integrationtest/core/core_test.go index a3408418009..7b9c4aaedf8 100644 --- a/internal/integrationtest/core/core_test.go +++ b/internal/integrationtest/core/core_test.go @@ -160,8 +160,8 @@ func TestCoreSearchNoArgs(t *testing.T) { for _, v := range strings.Split(strings.TrimSpace(string(stdout)), "\n") { lines = append(lines, strings.Fields(strings.TrimSpace(v))) } - // The header is printed on the first lines - require.Equal(t, []string{"test:x86", "2.0.0", "test_core"}, lines[21]) + // Check the presence of test:x86@2.0.0 + require.Contains(t, lines, []string{"test:x86", "2.0.0", "test_core"}) numPlatforms := len(lines) - 1 // same thing in JSON format, also check the number of platforms found is the same @@ -177,8 +177,8 @@ func TestCoreSearchNoArgs(t *testing.T) { for _, v := range strings.Split(strings.TrimSpace(string(stdout)), "\n") { lines = append(lines, strings.Fields(strings.TrimSpace(v))) } - // The header is printed on the first lines - require.Equal(t, []string{"test:x86", "3.0.0", "test_core"}, lines[22]) + // Check the presence of test:x86@3.0.0 + require.Contains(t, lines, []string{"test:x86", "3.0.0", "test_core"}) numPlatforms = len(lines) - 1 // same thing in JSON format, also check the number of platforms found is the same