Skip to content

Commit

Permalink
Add comments to new functions
Browse files Browse the repository at this point in the history
  • Loading branch information
tateexon committed Sep 26, 2023
1 parent a0db352 commit 8e497bf
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 0 deletions.
2 changes: 2 additions & 0 deletions integration-tests/docker/test_env/test_env.go
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,8 @@ func NewTestEnv() (*CLClusterTestEnv, error) {
}, nil
}

// WithTestEnvConfig sets the test environment cfg.
// Sets up the Geth and MockServer containers with the provided cfg.
func (te *CLClusterTestEnv) WithTestEnvConfig(cfg *TestEnvConfig) *CLClusterTestEnv {
te.Cfg = cfg
n := []string{te.Network.Name}
Expand Down
7 changes: 7 additions & 0 deletions integration-tests/docker/test_env/test_env_builder.go
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,10 @@ func NewCLTestEnvBuilder() *CLTestEnvBuilder {
}
}

// WithTestEnv sets the test environment to use for the test.
// If nil, a new test environment is created.
// If not nil, the test environment is used as-is.
// If TEST_ENV_CONFIG_PATH is set, the test environment is created with the config at that path.
func (b *CLTestEnvBuilder) WithTestEnv(te *CLClusterTestEnv) (*CLTestEnvBuilder, error) {
envConfigPath, isSet := os.LookupEnv("TEST_ENV_CONFIG_PATH")
var cfg *TestEnvConfig
Expand All @@ -74,6 +78,8 @@ func (b *CLTestEnvBuilder) WithTestEnv(te *CLClusterTestEnv) (*CLTestEnvBuilder,
return b, nil
}

// WithTestLogger sets the test logger to use for the test.
// Useful for parallel tests so the logging will be separated correctly in the results views.
func (b *CLTestEnvBuilder) WithTestLogger(t *testing.T) *CLTestEnvBuilder {
b.t = t
b.l = logging.GetTestLogger(t)
Expand Down Expand Up @@ -121,6 +127,7 @@ func (b *CLTestEnvBuilder) WithMockServer(externalAdapterCount int) *CLTestEnvBu
return b
}

// WithNonEVM sets the test environment to not use EVM when built.
func (b *CLTestEnvBuilder) WithNonEVM() *CLTestEnvBuilder {
b.isNonEVM = true
return b
Expand Down

0 comments on commit 8e497bf

Please sign in to comment.