chore: Upgrade to Go 1.19 (#3617)

This is required as part of #3505.
This commit is contained in:
Kyle Carberry
2022-08-21 22:32:53 +00:00
committed by GitHub
parent d37fb054c8
commit b0fe9bcdd1
52 changed files with 144 additions and 86 deletions
+1
View File
@@ -54,6 +54,7 @@ type RegoAuthorizer struct {
}
// Load the policy from policy.rego in this directory.
//
//go:embed policy.rego
var policy string
+2 -1
View File
@@ -491,8 +491,8 @@ func TestAuthorizeDomain(t *testing.T) {
}
// TestAuthorizeLevels ensures level overrides are acting appropriately
//nolint:paralleltest
func TestAuthorizeLevels(t *testing.T) {
t.Parallel()
defOrg := uuid.New()
unusedID := uuid.New()
@@ -638,6 +638,7 @@ func testAuthorize(t *testing.T, name string, subject subject, sets ...[]authTes
for _, cases := range sets {
for _, c := range cases {
t.Run(name, func(t *testing.T) {
t.Parallel()
for _, a := range c.actions {
ctx, cancel := context.WithTimeout(context.Background(), testutil.WaitShort)
t.Cleanup(cancel)
+3 -1
View File
@@ -361,7 +361,9 @@ func ChangeRoleSet(from []string, to []string) (added []string, removed []string
}
// roleName is a quick helper function to return
// role_name:scopeID
//
// role_name:scopeID
//
// If no scopeID is required, only 'role_name' is returned
func roleName(name string, orgID string) string {
if orgID == "" {
+2
View File
@@ -13,6 +13,7 @@ import (
)
// BenchmarkRBACFilter benchmarks the rbac.Filter method.
//
// go test -bench BenchmarkRBACFilter -benchmem -memprofile memprofile.out -cpuprofile profile.out
func BenchmarkRBACFilter(b *testing.B) {
orgs := []uuid.UUID{
@@ -392,6 +393,7 @@ func TestIsOrgRole(t *testing.T) {
// nolint:paralleltest
for _, c := range testCases {
t.Run(c.RoleName, func(t *testing.T) {
t.Parallel()
orgID, ok := rbac.IsOrgRole(c.RoleName)
require.Equal(t, c.OrgRole, ok, "match expected org role")
require.Equal(t, c.OrgID, orgID, "match expected org id")