Skip to content
This repository has been archived by the owner on May 29, 2024. It is now read-only.

Commit

Permalink
[optimism-rebasing] Fixed lint/test errors
Browse files Browse the repository at this point in the history
  • Loading branch information
Ethen Pociask committed Oct 9, 2023
1 parent f052151 commit dd2091e
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 11 deletions.
1 change: 1 addition & 0 deletions e2e/heuristic_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -242,6 +242,7 @@ func TestWithdrawalEnforcement(t *testing.T) {
},
},
})
assert.NoError(t, err, "Error bootstrapping heuristic session")

optimismPortal, err := bindings.NewOptimismPortal(ts.Cfg.L1Deployments.OptimismPortalProxy, ts.L1Client)
assert.NoError(t, err)
Expand Down
17 changes: 8 additions & 9 deletions e2e/setup.go
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ func CreateL2TestSuite(t *testing.T) *L2TestSuite {
pagerdutyURL := fmt.Sprintf("http://127.0.0.1:%d", pagerdutyServer.Port)

appCfg.AlertConfig.PagerdutyAlertEventsURL = pagerdutyURL
appCfg.AlertConfig.RoutingParams = DefaultRoutingParams(slackURL)
appCfg.AlertConfig.RoutingParams = DefaultRoutingParams(core.StringFromEnv(slackURL))

pess, kill, err := app.NewPessimismApp(ctx, appCfg)
if err != nil {
Expand Down Expand Up @@ -130,6 +130,7 @@ func CreateSysTestSuite(t *testing.T) *SysTestSuite {
cfg := op_e2e.DefaultSystemConfig(t)
cfg.DeployConfig.FinalizationPeriodSeconds = 2

// Don't output rollup service logs unless ENABLE_ROLLUP_LOGS is set
if len(os.Getenv("ENABLE_ROLLUP_LOGS")) == 0 {
t.Log("set env 'ENABLE_ROLLUP_LOGS' to show rollup logs")
for name, logger := range cfg.Loggers {
Expand Down Expand Up @@ -167,7 +168,7 @@ func CreateSysTestSuite(t *testing.T) *SysTestSuite {
pagerdutyURL := fmt.Sprintf("http://127.0.0.1:%d", pagerdutyServer.Port)

appCfg.AlertConfig.PagerdutyAlertEventsURL = pagerdutyURL
appCfg.AlertConfig.RoutingParams = DefaultRoutingParams(slackURL)
appCfg.AlertConfig.RoutingParams = DefaultRoutingParams(core.StringFromEnv(slackURL))

pess, kill, err := app.NewPessimismApp(ctx, appCfg)
if err != nil {
Expand Down Expand Up @@ -231,23 +232,21 @@ func DefaultTestConfig() *config.Config {
}

// DefaultRoutingParams ... Returns a default routing params configuration for testing
func DefaultRoutingParams(slackURL string) *core.AlertRoutingParams {

envURL := core.StringFromEnv(slackURL)
func DefaultRoutingParams(slackURL core.StringFromEnv) *core.AlertRoutingParams {
return &core.AlertRoutingParams{
AlertRoutes: &core.SeverityMap{
Low: &core.AlertClientCfg{
Slack: map[string]*core.AlertConfig{
"config": {
URL: envURL,
URL: slackURL,
Channel: "#test-low",
},
},
},
Medium: &core.AlertClientCfg{
Slack: map[string]*core.AlertConfig{
"config": {
URL: envURL,
URL: slackURL,
Channel: "#test-medium",
},
},
Expand All @@ -260,11 +259,11 @@ func DefaultRoutingParams(slackURL string) *core.AlertRoutingParams {
High: &core.AlertClientCfg{
Slack: map[string]*core.AlertConfig{
"config": {
URL: envURL,
URL: slackURL,
Channel: "#test-high",
},
"config_2": {
URL: envURL,
URL: slackURL,
Channel: "#test-high-2",
},
},
Expand Down
4 changes: 3 additions & 1 deletion internal/app/app_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ import (
"github.com/base-org/pessimism/internal/api/server"
"github.com/base-org/pessimism/internal/app"
"github.com/base-org/pessimism/internal/config"
"github.com/base-org/pessimism/internal/core"
"github.com/base-org/pessimism/internal/metrics"

"github.com/stretchr/testify/assert"
Expand All @@ -27,8 +28,9 @@ func Test_AppFlow(t *testing.T) {
Enabled: false,
},
AlertConfig: &alert.Config{
RoutingCfgPath: "../../e2e/alert-routing-cfg.yaml",
RoutingCfgPath: "",
PagerdutyAlertEventsURL: "test",
RoutingParams: &core.AlertRoutingParams{},
},
}

Expand Down
2 changes: 1 addition & 1 deletion internal/mocks/oracle.go
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ func (md *mockOracleDefinition) ReadRoutine(_ context.Context, _ chan core.Trans
}

func (md *mockOracleDefinition) Height() (*big.Int, error) {
return nil, nil
return big.NewInt(0), nil
}

// NewDummyOracle ... Takes in a register type that specifies the mocked output type
Expand Down

0 comments on commit dd2091e

Please sign in to comment.