Skip to content

Commit

Permalink
Default amd64 for all
Browse files Browse the repository at this point in the history
  • Loading branch information
kalverra committed Sep 23, 2024
1 parent 5fb0979 commit 9521294
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
2 changes: 1 addition & 1 deletion tools/citool/cmd/filter_cmd.go
Original file line number Diff line number Diff line change
Expand Up @@ -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)
)

Expand Down
5 changes: 3 additions & 2 deletions tools/citool/cmd/filter_cmd_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand All @@ -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 {
Expand Down

0 comments on commit 9521294

Please sign in to comment.