Skip to content

Commit

Permalink
Namespace containers
Browse files Browse the repository at this point in the history
  • Loading branch information
kegsay committed Sep 26, 2024
1 parent acd99c6 commit 81cd0c0
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions internal/cc/instance.go
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand Down
2 changes: 1 addition & 1 deletion tests/main_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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")

}

Expand Down
2 changes: 1 addition & 1 deletion tests/rust/main_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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")

}

Expand Down

0 comments on commit 81cd0c0

Please sign in to comment.