From 95212946b92c2bacb36dc9382b6db62d4db3a24d Mon Sep 17 00:00:00 2001 From: Adam Hamrick Date: Mon, 23 Sep 2024 14:57:57 -0400 Subject: [PATCH] Default amd64 for all --- tools/citool/cmd/filter_cmd.go | 2 +- tools/citool/cmd/filter_cmd_test.go | 5 +++-- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/tools/citool/cmd/filter_cmd.go b/tools/citool/cmd/filter_cmd.go index 0cd6a24df..b1d5215d1 100644 --- a/tools/citool/cmd/filter_cmd.go +++ b/tools/citool/cmd/filter_cmd.go @@ -32,7 +32,7 @@ func filterTests( var ( workflowMatch = workflow == "" || contains(test.Workflows, workflowFilter) testTypeMatch = testType == "" || test.TestEnvType == testTypeFilter - imageTypeMatch = chainlinkImageType == "" || contains(test.ChainlinkImageTypes, imageTypeFilter) + imageTypeMatch = chainlinkImageType == "" || contains(test.ChainlinkImageTypes, imageTypeFilter) || (len(test.ChainlinkImageTypes) == 0 && imageTypeFilter == "amd64") // Default amd64 for all idMatch = ids == "*" || ids == "" || contains(idFilter, test.ID) ) diff --git a/tools/citool/cmd/filter_cmd_test.go b/tools/citool/cmd/filter_cmd_test.go index 34b98cc25..7524af52d 100644 --- a/tools/citool/cmd/filter_cmd_test.go +++ b/tools/citool/cmd/filter_cmd_test.go @@ -37,6 +37,7 @@ func TestFilterTestsByChainlinkImageType(t *testing.T) { {ChainlinkImageTypes: []string{"arm64"}, TestEnvType: "docker"}, {ChainlinkImageTypes: []string{"amd64"}, TestEnvType: "docker"}, {ChainlinkImageTypes: []string{"plugins", "arm64"}, TestEnvType: "k8s_remote_runner"}, + {ChainlinkImageTypes: []string{}, TestEnvType: "docker"}, // Empty image type should default to amd64 } cases := []struct { @@ -45,9 +46,9 @@ func TestFilterTestsByChainlinkImageType(t *testing.T) { expectedLen int }{ {"Filter by single type", "arm64", 2}, - {"Filter by single type once", "amd64", 1}, + {"Filter by single type once", "amd64", 2}, {"Filter by non-existent type", "nonsense", 0}, - {"Empty type string to include all", "", 3}, + {"Empty type string to include all", "", 4}, } for _, c := range cases {