Skip to content

Commit 93dd1ae

Browse files
committed
fix tests
1 parent 9cc0f6a commit 93dd1ae

File tree

2 files changed

+14
-9
lines changed

2 files changed

+14
-9
lines changed

framework/components/clnode/clnode_test.go

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,9 @@ func TestDockerNodeWithSharedDB(t *testing.T) {
3333
input: &clnode.Input{
3434
DataProviderURL: "http://example.com",
3535
DbInput: &postgres.Input{
36-
Image: "postgres:15.6",
36+
Image: "postgres:15.6",
37+
Port: "16000",
38+
VolumeName: "a",
3739
},
3840
Node: &clnode.NodeInput{
3941
Image: "public.ecr.aws/chainlink/chainlink:v2.17.0",
@@ -67,7 +69,9 @@ func TestDockerNodeWithDB(t *testing.T) {
6769
input: &clnode.Input{
6870
DataProviderURL: "http://example.com",
6971
DbInput: &postgres.Input{
70-
Image: "postgres:15.6",
72+
Image: "postgres:15.6",
73+
Port: "15000",
74+
VolumeName: "b",
7175
},
7276
Node: &clnode.NodeInput{
7377
Image: "public.ecr.aws/chainlink/chainlink:v2.17.0",

framework/components/postgres/postgres.go

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -19,15 +19,16 @@ const (
1919
Port = "5432"
2020
ExposedStaticPort = "13000"
2121
Database = "chainlink"
22-
DatabaseDir = "postgresql_data"
22+
DBVolumeName = "postgresql_data"
2323
)
2424

2525
type Input struct {
26-
Image string `toml:"image" validate:"required"`
27-
Port string `toml:"port"`
28-
Databases int `toml:"databases"`
29-
PullImage bool `toml:"pull_image"`
30-
Out *Output `toml:"out"`
26+
Image string `toml:"image" validate:"required"`
27+
Port string `toml:"port"`
28+
VolumeName string `toml:"volume_name"`
29+
Databases int `toml:"databases"`
30+
PullImage bool `toml:"pull_image"`
31+
Out *Output `toml:"out"`
3132
}
3233

3334
type Output struct {
@@ -86,7 +87,7 @@ func NewPostgreSQL(in *Input) (*Output, error) {
8687
Mounts: testcontainers.ContainerMounts{
8788
{
8889
Source: testcontainers.GenericVolumeMountSource{
89-
Name: DatabaseDir,
90+
Name: fmt.Sprintf("%s%s", DBVolumeName, in.VolumeName),
9091
},
9192
Target: "/var/lib/postgresql/data",
9293
},

0 commit comments

Comments
 (0)