Skip to content

Commit

Permalink
split the tests and add mercury related tests
Browse files Browse the repository at this point in the history
  • Loading branch information
shileiwill committed Jul 1, 2024
1 parent 5ea40b1 commit c28c33f
Show file tree
Hide file tree
Showing 2 changed files with 40 additions and 22 deletions.
44 changes: 24 additions & 20 deletions integration-tests/smoke/automation_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ import (
"net/http"
"os"
"strconv"
"strings"
"testing"
"time"

Expand Down Expand Up @@ -98,22 +99,25 @@ func TestAutomationBasic(t *testing.T) {
func SetupAutomationBasic(t *testing.T, nodeUpgrade bool) {
t.Parallel()

// native, mercury_v02, mercury_v03 and logtrigger are reserved keywords, use them with caution
registryVersions := map[string]ethereum.KeeperRegistryVersion{
"registry_2_0": ethereum.RegistryVersion_2_0,
"registry_2_1_conditional": ethereum.RegistryVersion_2_1,
"registry_2_1_logtrigger": ethereum.RegistryVersion_2_1,
"registry_2_1_with_mercury_v02": ethereum.RegistryVersion_2_1,
"registry_2_1_with_mercury_v03": ethereum.RegistryVersion_2_1,
"registry_2_1_with_logtrigger_and_mercury_v02": ethereum.RegistryVersion_2_1,
"registry_2_2_conditional": ethereum.RegistryVersion_2_2,
"registry_2_2_logtrigger": ethereum.RegistryVersion_2_2,
"registry_2_2_with_mercury_v02": ethereum.RegistryVersion_2_2,
"registry_2_2_with_mercury_v03": ethereum.RegistryVersion_2_2,
"registry_2_2_with_logtrigger_and_mercury_v02": ethereum.RegistryVersion_2_2,
"registry_2_3_conditional_native": ethereum.RegistryVersion_2_3,
"registry_2_3_conditional_link": ethereum.RegistryVersion_2_3,
"registry_2_3_logtrigger_native": ethereum.RegistryVersion_2_3,
"registry_2_3_logtrigger_link": ethereum.RegistryVersion_2_3,
"registry_2_0": ethereum.RegistryVersion_2_0,
"registry_2_1_conditional": ethereum.RegistryVersion_2_1,
"registry_2_1_logtrigger": ethereum.RegistryVersion_2_1,
"registry_2_1_with_mercury_v02": ethereum.RegistryVersion_2_1,
"registry_2_1_with_mercury_v03": ethereum.RegistryVersion_2_1,
"registry_2_1_with_logtrigger_and_mercury_v02": ethereum.RegistryVersion_2_1,
"registry_2_2_conditional": ethereum.RegistryVersion_2_2,
"registry_2_2_logtrigger": ethereum.RegistryVersion_2_2,
"registry_2_2_with_mercury_v02": ethereum.RegistryVersion_2_2,
"registry_2_2_with_mercury_v03": ethereum.RegistryVersion_2_2,
"registry_2_2_with_logtrigger_and_mercury_v02": ethereum.RegistryVersion_2_2,
"registry_2_3_conditional_native": ethereum.RegistryVersion_2_3,
"registry_2_3_conditional_link": ethereum.RegistryVersion_2_3,
"registry_2_3_logtrigger_native": ethereum.RegistryVersion_2_3,
"registry_2_3_logtrigger_link": ethereum.RegistryVersion_2_3,
"registry_2_3_with_mercury_v03_link": ethereum.RegistryVersion_2_3,
"registry_2_3_with_logtrigger_and_mercury_v02_link": ethereum.RegistryVersion_2_3,
}

for n, rv := range registryVersions {
Expand All @@ -132,11 +136,11 @@ func SetupAutomationBasic(t *testing.T, nodeUpgrade bool) {
}
}

// Use the name to determine if this is a log trigger or mercury or billing token is LINK
isBillingTokenNative := name == "registry_2_3_conditional_native" || name == "registry_2_3_logtrigger_native"
isLogTrigger := name == "registry_2_1_logtrigger" || name == "registry_2_1_with_logtrigger_and_mercury_v02" || name == "registry_2_2_logtrigger" || name == "registry_2_2_with_logtrigger_and_mercury_v02" || name == "registry_2_3_logtrigger_native" || name == "registry_2_3_logtrigger_link"
isMercuryV02 := name == "registry_2_1_with_mercury_v02" || name == "registry_2_1_with_logtrigger_and_mercury_v02" || name == "registry_2_2_with_mercury_v02" || name == "registry_2_2_with_logtrigger_and_mercury_v02"
isMercuryV03 := name == "registry_2_1_with_mercury_v03" || name == "registry_2_2_with_mercury_v03"
// Use the name to determine if this is a log trigger or mercury or billing token is native
isBillingTokenNative := strings.Contains(name, "native")
isLogTrigger := strings.Contains(name, "logtrigger")
isMercuryV02 := strings.Contains(name, "mercury_v02")
isMercuryV03 := strings.Contains(name, "mercury_v03")
isMercury := isMercuryV02 || isMercuryV03

a := setupAutomationTestDocker(
Expand Down
18 changes: 16 additions & 2 deletions integration-tests/smoke/automation_test.go_test_list.json
Original file line number Diff line number Diff line change
Expand Up @@ -37,14 +37,28 @@
},
{
"name": "TestAutomationBasic",
"nodes": 4,
"nodes": 2,
"run":[
{"name":"registry_2_3_conditional_native"},
{"name":"registry_2_3_conditional_link"},
{"name":"registry_2_3_conditional_link"}
]
},
{
"name": "TestAutomationBasic",
"nodes": 2,
"run":[
{"name":"registry_2_3_logtrigger_native"},
{"name":"registry_2_3_logtrigger_link"}
]
},
{
"name": "TestAutomationBasic",
"nodes": 2,
"run":[
{"name":"registry_2_3_with_mercury_v03_link"},
{"name":"registry_2_3_with_logtrigger_and_mercury_v02_link"}
]
},
{
"name": "TestSetUpkeepTriggerConfig",
"nodes": 2
Expand Down

0 comments on commit c28c33f

Please sign in to comment.