Skip to content

Commit

Permalink
chore(e2e): support easy halo deploys (#2596)
Browse files Browse the repository at this point in the history
Adds an easy way to deploy all halo nodes by just specifying `halo` as
e2e services regex.

issue: none
  • Loading branch information
corverroos authored Dec 2, 2024
1 parent faa2fe2 commit 8f9ac19
Showing 1 changed file with 20 additions and 0 deletions.
20 changes: 20 additions & 0 deletions e2e/types/infra.go
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,8 @@ const (
regexpCanary = "canary"
// regexpNonCanary is a convenient way to specify non-canary upgrades.
regexpNonCanary = "non-canary"
// regexpHalo is a convenient way to specify all halo nodes (excluding relayer/monitor/solver etc).
regexpHalo = "halo"
)

// canaries define services included in canary upgrades
Expand Down Expand Up @@ -45,6 +47,7 @@ func (c ServiceConfig) MatchService(service string) bool {
return true
}

// isCanary returns true if the service is a canary node.
isCanary := func() bool {
for canary := range canaries {
if strings.HasPrefix(service, canary) {
Expand All @@ -55,10 +58,27 @@ func (c ServiceConfig) MatchService(service string) bool {
return false
}

// isHalo returns true if the service is a halo node.
isHalo := func() bool {
if strings.HasSuffix(service, "_evm") {
return false
}

for _, prefix := range []string{"validator", "full", "seed", "archive"} {
if strings.HasPrefix(service, prefix) {
return true
}
}

return false
}

if c.Regexp == regexpCanary {
return isCanary()
} else if c.Regexp == regexpNonCanary {
return !isCanary()
} else if c.Regexp == regexpHalo {
return isHalo()
}

ok, _ := regexp.MatchString(c.Regexp, service) // Nothing matches invalid regex
Expand Down

0 comments on commit 8f9ac19

Please sign in to comment.