Skip to content

Commit

Permalink
options to include customized pg and chainlink image (#11570)
Browse files Browse the repository at this point in the history
  • Loading branch information
AnieeG authored Dec 13, 2023
1 parent c274c23 commit 917b74f
Showing 1 changed file with 23 additions and 0 deletions.
23 changes: 23 additions & 0 deletions integration-tests/docker/test_env/cl_node.go
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ import (
"github.com/smartcontractkit/chainlink-testing-framework/logging"
"github.com/smartcontractkit/chainlink-testing-framework/logstream"
"github.com/smartcontractkit/chainlink-testing-framework/utils/testcontext"

"github.com/smartcontractkit/chainlink/v2/core/services/chainlink"
"github.com/smartcontractkit/chainlink/v2/core/services/keystore/chaintype"

Expand Down Expand Up @@ -83,6 +84,28 @@ func WithLogStream(ls *logstream.LogStream) ClNodeOption {
}
}

func WithImage(image string) ClNodeOption {
return func(c *ClNode) {
c.ContainerImage = image
}
}

func WithVersion(version string) ClNodeOption {
return func(c *ClNode) {
c.ContainerVersion = version
}
}

func WithPgDBOptions(opts ...test_env.PostgresDbOption) ClNodeOption {
return func(c *ClNode) {
var err error
c.PostgresDb, err = test_env.NewPostgresDb(c.EnvComponent.Networks, opts...)
if err != nil {
c.t.Fatalf("failed to create postgres db: %v", err)
}
}
}

func NewClNode(networks []string, imageName, imageVersion string, nodeConfig *chainlink.Config, opts ...ClNodeOption) (*ClNode, error) {
nodeDefaultCName := fmt.Sprintf("%s-%s", "cl-node", uuid.NewString()[0:8])
pgDefaultCName := fmt.Sprintf("pg-%s", nodeDefaultCName)
Expand Down

0 comments on commit 917b74f

Please sign in to comment.