NET 6442 - Add tenancy to explicit destinations controller (#19644)

Add tenancy to explicit destinations controller
This commit is contained in:
Ashesh Vidyut 2023-11-15 11:41:56 +05:30 committed by GitHub
parent bc26fbcf2c
commit fbc2a58733
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 592 additions and 471 deletions

View File

@ -4,6 +4,7 @@
package resourcetest
import (
"fmt"
"strings"
"testing"
@ -64,3 +65,15 @@ func DefaultTenancyForType(t *testing.T, reg resource.Registration) *pbresource.
return nil
}
}
func AppendTenancyInfo(name string, tenancy *pbresource.Tenancy) string {
return fmt.Sprintf("%s_%s_Namespace_%s_Partition", name, tenancy.Namespace, tenancy.Partition)
}
func RunWithTenancies(testFunc func(tenancy *pbresource.Tenancy), t *testing.T) {
for _, tenancy := range TestTenancies() {
t.Run(AppendTenancyInfo(t.Name(), tenancy), func(t *testing.T) {
testFunc(tenancy)
})
}
}