diff --git a/internal/cc/instance.go b/internal/cc/instance.go index 7ea9e3b..fc07dd9 100644 --- a/internal/cc/instance.go +++ b/internal/cc/instance.go @@ -30,14 +30,14 @@ func NewInstance(cfg *config.ComplementCrypto) *Instance { // TestMain is the entry point for running a test suite with this Instance. // The function signature matches the standard Go test suite TestMain() -func (i *Instance) TestMain(m *testing.M) { +func (i *Instance) TestMain(m *testing.M, namespace string) { // Execute PreTestRun lifecycle hook for _, binding := range i.complementCryptoConfig.Bindings() { binding.PreTestRun("") } // Defer to complement to run the test suite - complement.TestMainWithCleanup(m, "crypto", func() { // always teardown even if panicking + complement.TestMainWithCleanup(m, namespace, func() { // always teardown even if panicking i.ssMutex.Lock() if i.ssDeployment != nil { i.ssDeployment.Teardown() diff --git a/tests/main_test.go b/tests/main_test.go index 29a0f50..710856d 100644 --- a/tests/main_test.go +++ b/tests/main_test.go @@ -15,7 +15,7 @@ var ( // Main entry point when users run `go test`. Defined in https://pkg.go.dev/testing#hdr-Main func TestMain(m *testing.M) { instance = cc.NewInstance(config.NewComplementCryptoConfigFromEnvVars("./mitmproxy_addons")) - instance.TestMain(m) + instance.TestMain(m, "crypto") } diff --git a/tests/rust/main_test.go b/tests/rust/main_test.go index bb5068b..ba7628b 100644 --- a/tests/rust/main_test.go +++ b/tests/rust/main_test.go @@ -15,7 +15,7 @@ var ( // Main entry point when users run `go test`. Defined in https://pkg.go.dev/testing#hdr-Main func TestMain(m *testing.M) { instance = cc.NewInstance(config.NewComplementCryptoConfigFromEnvVars("../mitmproxy_addons")) - instance.TestMain(m) + instance.TestMain(m, "rust") }