File tree Expand file tree Collapse file tree 5 files changed +14
-15
lines changed
Expand file tree Collapse file tree 5 files changed +14
-15
lines changed Original file line number Diff line number Diff line change @@ -30,7 +30,7 @@ func createComponentsFromForm(form *nodeSetForm) error {
3030 _ * simple_node_set.Output
3131 err error
3232 )
33- if _ , err := framework .DefaultNetwork (& sync.Once {}); err != nil {
33+ if err := framework .DefaultNetwork (t , & sync.Once {}); err != nil {
3434 return err
3535 }
3636 switch form .Network {
Original file line number Diff line number Diff line change @@ -49,7 +49,7 @@ func TestComponentDockerNodeWithSharedDB(t *testing.T) {
4949 }
5050
5151 for _ , tc := range testCases {
52- _ , err := framework .DefaultNetwork (& sync.Once {})
52+ err := framework .DefaultNetwork (t , & sync.Once {})
5353 require .NoError (t , err )
5454
5555 t .Run (tc .name , func (t * testing.T ) {
@@ -84,7 +84,7 @@ func TestComponentDockerNodeWithDB(t *testing.T) {
8484 }
8585
8686 for _ , tc := range testCases {
87- _ , err := framework .DefaultNetwork (& sync.Once {})
87+ err := framework .DefaultNetwork (t , & sync.Once {})
8888 require .NoError (t , err )
8989
9090 t .Run (tc .name , func (t * testing.T ) {
Original file line number Diff line number Diff line change 11package jd_test
22
33import (
4- "os"
5- "sync"
6- "testing"
7-
84 "github.com/smartcontractkit/chainlink-testing-framework/framework"
95 "github.com/smartcontractkit/chainlink-testing-framework/framework/components/jd"
106 "github.com/stretchr/testify/require"
7+ "os"
8+ "sync"
9+ "testing"
1110)
1211
1312// here we only test that we can boot up JD
1413// client examples are under "examples" dir
1514// since JD is private this env var should be set locally and in CI
1615// TODO: add ComponentDocker prefix to turn this on when we'll have access to ECRs
1716func TestJD (t * testing.T ) {
18- _ , err := framework .DefaultNetwork (& sync.Once {})
17+ err := framework .DefaultNetwork (t , & sync.Once {})
1918 require .NoError (t , err )
2019 _ , err = jd .NewJD (& jd.Input {
2120 Image : os .Getenv ("CTF_JD_IMAGE" ),
Original file line number Diff line number Diff line change 11package simple_node_set_test
22
33import (
4- "sync"
5- "testing"
6-
74 "github.com/smartcontractkit/chainlink-testing-framework/framework"
85 "github.com/smartcontractkit/chainlink-testing-framework/framework/components/blockchain"
96 "github.com/smartcontractkit/chainlink-testing-framework/framework/components/clnode"
107 "github.com/smartcontractkit/chainlink-testing-framework/framework/components/postgres"
118 ns "github.com/smartcontractkit/chainlink-testing-framework/framework/components/simple_node_set"
129 "github.com/stretchr/testify/require"
10+ "sync"
11+ "testing"
1312)
1413
1514type testCase struct {
@@ -114,7 +113,7 @@ level = 'info'
114113 }
115114
116115 for _ , tc := range testCases {
117- _ , err := framework .DefaultNetwork (& sync.Once {})
116+ err := framework .DefaultNetwork (t , & sync.Once {})
118117 require .NoError (t , err )
119118
120119 t .Run (tc .name , func (t * testing.T ) {
Original file line number Diff line number Diff line change @@ -143,22 +143,23 @@ func Load[X any](t *testing.T) (*X, error) {
143143 // return nil, fmt.Errorf("failed to connect AWSSecretsManager: %w", err)
144144 // }
145145 //}
146- _ , err = DefaultNetwork (once )
146+ err = DefaultNetwork (t , once )
147147 require .NoError (t , err )
148148 return input , nil
149149}
150150
151- func DefaultNetwork (once * sync.Once ) ( * testcontainers. DockerNetwork , error ) {
151+ func DefaultNetwork (t * testing. T , once * sync.Once ) error {
152152 var net * testcontainers.DockerNetwork
153153 var err error
154154 once .Do (func () {
155155 net , err = network .New (
156156 context .Background (),
157157 network .WithLabels (map [string ]string {"framework" : "ctf" }),
158158 )
159+ testcontainers .CleanupNetwork (t , net )
159160 DefaultNetworkName = net .Name
160161 })
161- return net , err
162+ return err
162163}
163164
164165func RenderTemplate (tmpl string , data interface {}) (string , error ) {
You can’t perform that action at this time.
0 commit comments