Skip to content

Commit a7d766f

Browse files
committed
fix tests
1 parent 11ff679 commit a7d766f

File tree

3 files changed

+10
-2
lines changed

3 files changed

+10
-2
lines changed

framework/components/clnode/clnode_test.go

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ func checkBasicOutputs(t *testing.T, output *clnode.Output) {
2424
require.Contains(t, output.Node.DockerP2PUrl, "cl-node")
2525
require.NotNil(t, output.PostgreSQL)
2626
require.Contains(t, output.PostgreSQL.Url, "postgresql://chainlink:[email protected]")
27-
require.Contains(t, output.PostgreSQL.DockerInternalURL, "postgresql://chainlink:thispasswordislongenough@ns-postgresql")
27+
require.Contains(t, output.PostgreSQL.DockerInternalURL, "postgresql://chainlink:thispasswordislongenough@pg")
2828
}
2929

3030
func TestComponentDockerNodeWithSharedDB(t *testing.T) {
@@ -35,6 +35,7 @@ func TestComponentDockerNodeWithSharedDB(t *testing.T) {
3535
DbInput: &postgres.Input{
3636
Image: "postgres:12.0",
3737
Port: 16000,
38+
Name: "pg-1",
3839
VolumeName: "a",
3940
},
4041
Node: &clnode.NodeInput{
@@ -70,6 +71,7 @@ func TestComponentDockerNodeWithDB(t *testing.T) {
7071
DbInput: &postgres.Input{
7172
Image: "postgres:12.0",
7273
Port: 15000,
74+
Name: "pg-2",
7375
VolumeName: "b",
7476
},
7577
Node: &clnode.NodeInput{

framework/components/postgres/postgres.go

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,12 @@ func NewPostgreSQL(in *Input) (*Output, error) {
4747
ctx := context.Background()
4848

4949
bindPort := fmt.Sprintf("%s/tcp", Port)
50-
containerName := in.Name
50+
var containerName string
51+
if in.Name == "" {
52+
containerName = "ns-postgresql"
53+
} else {
54+
containerName = in.Name
55+
}
5156

5257
var sqlCommands []string
5358
for i := 0; i <= in.Databases; i++ {

framework/examples/myproject/smoke.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77
port = 9111
88

99
[nodeset]
10+
name = "don"
1011
nodes = 5
1112
override_mode = "all"
1213

0 commit comments

Comments
 (0)