File tree Expand file tree Collapse file tree 5 files changed +14
-16
lines changed
Expand file tree Collapse file tree 5 files changed +14
-16
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 (t , & sync.Once {}); err != nil {
33+ if err := framework .DefaultNetwork (& 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 (t , & sync.Once {})
52+ err := framework .DefaultNetwork (& 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 (t , & sync.Once {})
87+ err := framework .DefaultNetwork (& 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 @@ -14,7 +14,7 @@ import (
1414// since JD is private this env var should be set locally and in CI
1515// TODO: add ComponentDocker prefix to turn this on when we'll have access to ECRs
1616func TestJD (t * testing.T ) {
17- err := framework .DefaultNetwork (t , & sync.Once {})
17+ err := framework .DefaultNetwork (& sync.Once {})
1818 require .NoError (t , err )
1919 _ , err = jd .NewJD (& jd.Input {
2020 Image : os .Getenv ("CTF_JD_IMAGE" ),
Original file line number Diff line number Diff line change @@ -113,7 +113,7 @@ level = 'info'
113113 }
114114
115115 for _ , tc := range testCases {
116- err := framework .DefaultNetwork (t , & sync.Once {})
116+ err := framework .DefaultNetwork (& sync.Once {})
117117 require .NoError (t , err )
118118
119119 t .Run (tc .name , func (t * testing.T ) {
Original file line number Diff line number Diff line change @@ -6,21 +6,20 @@ import (
66 "encoding/json"
77 "errors"
88 "fmt"
9- "os"
10- "path/filepath"
11- "strings"
12- "sync"
13- "testing"
14- "text/template"
15- "time"
16-
179 "github.com/davecgh/go-spew/spew"
1810 "github.com/go-playground/validator/v10"
1911 "github.com/pelletier/go-toml/v2"
2012 "github.com/rs/zerolog"
2113 "github.com/stretchr/testify/require"
2214 "github.com/testcontainers/testcontainers-go"
2315 "github.com/testcontainers/testcontainers-go/network"
16+ "os"
17+ "path/filepath"
18+ "strings"
19+ "sync"
20+ "testing"
21+ "text/template"
22+ "time"
2423)
2524
2625const (
@@ -143,20 +142,19 @@ func Load[X any](t *testing.T) (*X, error) {
143142 // return nil, fmt.Errorf("failed to connect AWSSecretsManager: %w", err)
144143 // }
145144 //}
146- err = DefaultNetwork (t , once )
145+ err = DefaultNetwork (once )
147146 require .NoError (t , err )
148147 return input , nil
149148}
150149
151- func DefaultNetwork (t * testing. T , once * sync.Once ) error {
150+ func DefaultNetwork (once * sync.Once ) error {
152151 var net * testcontainers.DockerNetwork
153152 var err error
154153 once .Do (func () {
155154 net , err = network .New (
156155 context .Background (),
157156 network .WithLabels (map [string ]string {"framework" : "ctf" }),
158157 )
159- testcontainers .CleanupNetwork (t , net )
160158 DefaultNetworkName = net .Name
161159 })
162160 return err
You can’t perform that action at this time.
0 commit comments