acl: remove t.Parallel
These tests run faster without it, and it was causing races in enterprise tests.
This commit is contained in:
parent
a7fec642fc
commit
0f9b80dfa6
|
@ -195,8 +195,6 @@ func (m *mockAuthorizer) Snapshot(ctx *AuthorizerContext) EnforcementDecision {
|
|||
}
|
||||
|
||||
func TestACL_Enforce(t *testing.T) {
|
||||
t.Parallel()
|
||||
|
||||
type testCase struct {
|
||||
method string
|
||||
resource Resource
|
||||
|
|
|
@ -94,11 +94,7 @@ func (authz testAuthorizer) Snapshot(*AuthorizerContext) EnforcementDecision {
|
|||
}
|
||||
|
||||
func TestChainedAuthorizer(t *testing.T) {
|
||||
t.Parallel()
|
||||
|
||||
t.Run("No Authorizers", func(t *testing.T) {
|
||||
t.Parallel()
|
||||
|
||||
authz := NewChainedAuthorizer([]Authorizer{})
|
||||
checkDenyACLRead(t, authz, "foo", nil)
|
||||
checkDenyACLWrite(t, authz, "foo", nil)
|
||||
|
@ -129,8 +125,6 @@ func TestChainedAuthorizer(t *testing.T) {
|
|||
})
|
||||
|
||||
t.Run("Authorizer Defaults", func(t *testing.T) {
|
||||
t.Parallel()
|
||||
|
||||
authz := NewChainedAuthorizer([]Authorizer{testAuthorizer(Default)})
|
||||
checkDenyACLRead(t, authz, "foo", nil)
|
||||
checkDenyACLWrite(t, authz, "foo", nil)
|
||||
|
@ -161,8 +155,6 @@ func TestChainedAuthorizer(t *testing.T) {
|
|||
})
|
||||
|
||||
t.Run("Authorizer No Defaults", func(t *testing.T) {
|
||||
t.Parallel()
|
||||
|
||||
authz := NewChainedAuthorizer([]Authorizer{testAuthorizer(Allow)})
|
||||
checkAllowACLRead(t, authz, "foo", nil)
|
||||
checkAllowACLWrite(t, authz, "foo", nil)
|
||||
|
@ -193,8 +185,6 @@ func TestChainedAuthorizer(t *testing.T) {
|
|||
})
|
||||
|
||||
t.Run("First Found", func(t *testing.T) {
|
||||
t.Parallel()
|
||||
|
||||
authz := NewChainedAuthorizer([]Authorizer{testAuthorizer(Deny), testAuthorizer(Allow)})
|
||||
checkDenyACLRead(t, authz, "foo", nil)
|
||||
checkDenyACLWrite(t, authz, "foo", nil)
|
||||
|
|
|
@ -13,8 +13,6 @@ import (
|
|||
// ensure compatibility from version to version those tests have been only minimally altered. The tests in this
|
||||
// file are specific to the newer functionality.
|
||||
func TestPolicyAuthorizer(t *testing.T) {
|
||||
t.Parallel()
|
||||
|
||||
type aclCheck struct {
|
||||
name string
|
||||
prefix string
|
||||
|
@ -446,8 +444,6 @@ func TestPolicyAuthorizer(t *testing.T) {
|
|||
name := name
|
||||
tcase := tcase
|
||||
t.Run(name, func(t *testing.T) {
|
||||
t.Parallel()
|
||||
|
||||
authz, err := NewPolicyAuthorizer([]*Policy{tcase.policy}, nil)
|
||||
require.NoError(t, err)
|
||||
|
||||
|
@ -458,7 +454,6 @@ func TestPolicyAuthorizer(t *testing.T) {
|
|||
}
|
||||
t.Run(checkName, func(t *testing.T) {
|
||||
check := check
|
||||
t.Parallel()
|
||||
|
||||
check.check(t, authz, check.prefix, nil)
|
||||
})
|
||||
|
@ -468,8 +463,6 @@ func TestPolicyAuthorizer(t *testing.T) {
|
|||
}
|
||||
|
||||
func TestAnyAllowed(t *testing.T) {
|
||||
t.Parallel()
|
||||
|
||||
type radixInsertion struct {
|
||||
segment string
|
||||
value *policyAuthorizerRadixLeaf
|
||||
|
@ -719,8 +712,6 @@ func TestAnyAllowed(t *testing.T) {
|
|||
}
|
||||
|
||||
func TestAllAllowed(t *testing.T) {
|
||||
t.Parallel()
|
||||
|
||||
type radixInsertion struct {
|
||||
segment string
|
||||
value *policyAuthorizerRadixLeaf
|
||||
|
|
|
@ -5,11 +5,7 @@ import (
|
|||
)
|
||||
|
||||
func TestStaticAuthorizer(t *testing.T) {
|
||||
t.Parallel()
|
||||
|
||||
t.Run("AllowAll", func(t *testing.T) {
|
||||
t.Parallel()
|
||||
|
||||
authz := AllowAll()
|
||||
checkDenyACLRead(t, authz, "foo", nil)
|
||||
checkDenyACLWrite(t, authz, "foo", nil)
|
||||
|
@ -40,7 +36,6 @@ func TestStaticAuthorizer(t *testing.T) {
|
|||
})
|
||||
|
||||
t.Run("DenyAll", func(t *testing.T) {
|
||||
t.Parallel()
|
||||
authz := DenyAll()
|
||||
checkDenyACLRead(t, authz, "foo", nil)
|
||||
checkDenyACLWrite(t, authz, "foo", nil)
|
||||
|
@ -71,7 +66,6 @@ func TestStaticAuthorizer(t *testing.T) {
|
|||
})
|
||||
|
||||
t.Run("ManageAll", func(t *testing.T) {
|
||||
t.Parallel()
|
||||
authz := ManageAll()
|
||||
checkAllowACLRead(t, authz, "foo", nil)
|
||||
checkAllowACLWrite(t, authz, "foo", nil)
|
||||
|
|
Loading…
Reference in New Issue