Skip to content

Commit

Permalink
fix: delete comments for the test case (#1301)
Browse files Browse the repository at this point in the history
  • Loading branch information
PokIsemaine committed Aug 20, 2023
1 parent a50c61c commit 985a914
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions model_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -707,10 +707,10 @@ func TestTemporalRolesModel(t *testing.T) {
e.AddNamedLinkConditionFunc("g", "alice", "data7_admin", util.TimeMatchFunc)
e.AddNamedLinkConditionFunc("g", "alice", "data8_admin", util.TimeMatchFunc)

//testEnforce(t, e, "alice", "data1", "read", true)
//testEnforce(t, e, "alice", "data1", "write", true)
//testEnforce(t, e, "alice", "data2", "read", false)
//testEnforce(t, e, "alice", "data2", "write", false)
testEnforce(t, e, "alice", "data1", "read", true)
testEnforce(t, e, "alice", "data1", "write", true)
testEnforce(t, e, "alice", "data2", "read", false)
testEnforce(t, e, "alice", "data2", "write", false)
testEnforce(t, e, "alice", "data3", "read", true)
testEnforce(t, e, "alice", "data3", "write", true)
testEnforce(t, e, "alice", "data4", "read", true)
Expand Down

2 comments on commit 985a914

@github-actions
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Benchmark

Benchmark suite Current: 985a914 Previous: a50c61c Ratio
BenchmarkCachedRaw - ns/op 25.05 ns/op 20.91 ns/op 1.20
BenchmarkCachedRaw - B/op 0 B/op 0 B/op NaN
BenchmarkCachedRaw - allocs/op 0 allocs/op 0 allocs/op NaN
BenchmarkCachedBasicModel - ns/op 285.8 ns/op 208.2 ns/op 1.37
BenchmarkCachedBasicModel - B/op 104 B/op 104 B/op 1
BenchmarkCachedBasicModel - allocs/op 4 allocs/op 4 allocs/op 1
BenchmarkCachedRBACModel - ns/op 279.3 ns/op 210 ns/op 1.33
BenchmarkCachedRBACModel - B/op 104 B/op 104 B/op 1
BenchmarkCachedRBACModel - allocs/op 4 allocs/op 4 allocs/op 1
BenchmarkCachedRBACModelSmall - ns/op 301.3 ns/op 223.5 ns/op 1.35
BenchmarkCachedRBACModelSmall - B/op 104 B/op 104 B/op 1
BenchmarkCachedRBACModelSmall - allocs/op 4 allocs/op 4 allocs/op 1
BenchmarkCachedRBACModelMedium - ns/op 330.7 ns/op 236.7 ns/op 1.40
BenchmarkCachedRBACModelMedium - B/op 104 B/op 104 B/op 1
BenchmarkCachedRBACModelMedium - allocs/op 4 allocs/op 4 allocs/op 1
BenchmarkCachedRBACModelLarge - ns/op 273.3 ns/op 221.3 ns/op 1.23
BenchmarkCachedRBACModelLarge - B/op 97 B/op 96 B/op 1.01
BenchmarkCachedRBACModelLarge - allocs/op 3 allocs/op 3 allocs/op 1
BenchmarkCachedRBACModelWithResourceRoles - ns/op 310.9 ns/op 217.5 ns/op 1.43
BenchmarkCachedRBACModelWithResourceRoles - B/op 104 B/op 104 B/op 1
BenchmarkCachedRBACModelWithResourceRoles - allocs/op 4 allocs/op 4 allocs/op 1
BenchmarkCachedRBACModelWithDomains - ns/op 308.8 ns/op 231.6 ns/op 1.33
BenchmarkCachedRBACModelWithDomains - B/op 120 B/op 120 B/op 1
BenchmarkCachedRBACModelWithDomains - allocs/op 4 allocs/op 4 allocs/op 1
BenchmarkCachedABACModel - ns/op 4690 ns/op 3827 ns/op 1.23
BenchmarkCachedABACModel - B/op 1522 B/op 1524 B/op 1.00
BenchmarkCachedABACModel - allocs/op 18 allocs/op 18 allocs/op 1
BenchmarkCachedKeyMatchModel - ns/op 331.8 ns/op 230.6 ns/op 1.44
BenchmarkCachedKeyMatchModel - B/op 152 B/op 152 B/op 1
BenchmarkCachedKeyMatchModel - allocs/op 4 allocs/op 4 allocs/op 1
BenchmarkCachedRBACModelWithDeny - ns/op 294.7 ns/op 208.8 ns/op 1.41
BenchmarkCachedRBACModelWithDeny - B/op 104 B/op 104 B/op 1
BenchmarkCachedRBACModelWithDeny - allocs/op 4 allocs/op 4 allocs/op 1
BenchmarkCachedPriorityModel - ns/op 301.1 ns/op 208 ns/op 1.45
BenchmarkCachedPriorityModel - B/op 104 B/op 104 B/op 1
BenchmarkCachedPriorityModel - allocs/op 4 allocs/op 4 allocs/op 1
BenchmarkCachedWithEnforceContext - ns/op 532.4 ns/op 420.6 ns/op 1.27
BenchmarkCachedWithEnforceContext - B/op 240 B/op 240 B/op 1
BenchmarkCachedWithEnforceContext - allocs/op 5 allocs/op 5 allocs/op 1
BenchmarkCachedRBACModelMediumParallel - ns/op 280.2 ns/op 229.2 ns/op 1.22
BenchmarkCachedRBACModelMediumParallel - B/op 105 B/op 105 B/op 1
BenchmarkCachedRBACModelMediumParallel - allocs/op 4 allocs/op 4 allocs/op 1
BenchmarkHasPolicySmall - ns/op 882.7 ns/op 673.1 ns/op 1.31
BenchmarkHasPolicySmall - B/op 150 B/op 150 B/op 1
BenchmarkHasPolicySmall - allocs/op 6 allocs/op 6 allocs/op 1
BenchmarkHasPolicyMedium - ns/op 980.8 ns/op 697 ns/op 1.41
BenchmarkHasPolicyMedium - B/op 157 B/op 157 B/op 1
BenchmarkHasPolicyMedium - allocs/op 6 allocs/op 6 allocs/op 1
BenchmarkHasPolicyLarge - ns/op 1008 ns/op 730.4 ns/op 1.38
BenchmarkHasPolicyLarge - B/op 165 B/op 165 B/op 1
BenchmarkHasPolicyLarge - allocs/op 7 allocs/op 7 allocs/op 1
BenchmarkAddPolicySmall - ns/op 923.7 ns/op 686.8 ns/op 1.34
BenchmarkAddPolicySmall - B/op 152 B/op 152 B/op 1
BenchmarkAddPolicySmall - allocs/op 6 allocs/op 6 allocs/op 1
BenchmarkAddPolicyMedium - ns/op 1221 ns/op 865.2 ns/op 1.41
BenchmarkAddPolicyMedium - B/op 187 B/op 179 B/op 1.04
BenchmarkAddPolicyMedium - allocs/op 7 allocs/op 7 allocs/op 1
BenchmarkAddPolicyLarge - ns/op 1941 ns/op 1507 ns/op 1.29
BenchmarkAddPolicyLarge - B/op 414 B/op 467 B/op 0.89
BenchmarkAddPolicyLarge - allocs/op 9 allocs/op 9 allocs/op 1
BenchmarkRemovePolicySmall - ns/op 923.8 ns/op 672.6 ns/op 1.37
BenchmarkRemovePolicySmall - B/op 166 B/op 166 B/op 1
BenchmarkRemovePolicySmall - allocs/op 7 allocs/op 7 allocs/op 1
BenchmarkRemovePolicyMedium - ns/op 1091 ns/op 782.4 ns/op 1.39
BenchmarkRemovePolicyMedium - B/op 179 B/op 178 B/op 1.01
BenchmarkRemovePolicyMedium - allocs/op 7 allocs/op 7 allocs/op 1
BenchmarkRemovePolicyLarge - ns/op 2318 ns/op 1797 ns/op 1.29
BenchmarkRemovePolicyLarge - B/op 306 B/op 294 B/op 1.04
BenchmarkRemovePolicyLarge - allocs/op 13 allocs/op 13 allocs/op 1
BenchmarkRaw - ns/op 25.15 ns/op 20.91 ns/op 1.20
BenchmarkRaw - B/op 0 B/op 0 B/op NaN
BenchmarkRaw - allocs/op 0 allocs/op 0 allocs/op NaN
BenchmarkBasicModel - ns/op 5701 ns/op 4785 ns/op 1.19
BenchmarkBasicModel - B/op 1490 B/op 1490 B/op 1
BenchmarkBasicModel - allocs/op 17 allocs/op 17 allocs/op 1
BenchmarkRBACModel - ns/op 8636 ns/op 7193 ns/op 1.20
BenchmarkRBACModel - B/op 2036 B/op 2037 B/op 1.00
BenchmarkRBACModel - allocs/op 35 allocs/op 35 allocs/op 1
BenchmarkRBACModelSizes/small - ns/op 87099 ns/op 62049 ns/op 1.40
BenchmarkRBACModelSizes/small - B/op 19966 B/op 19986 B/op 1.00
BenchmarkRBACModelSizes/small - allocs/op 480 allocs/op 480 allocs/op 1
BenchmarkRBACModelSizes/medium - ns/op 1013746 ns/op 655597 ns/op 1.55
BenchmarkRBACModelSizes/medium - B/op 191479 B/op 191198 B/op 1.00
BenchmarkRBACModelSizes/medium - allocs/op 4832 allocs/op 4827 allocs/op 1.00
BenchmarkRBACModelSizes/large - ns/op 10933852 ns/op 7854827 ns/op 1.39
BenchmarkRBACModelSizes/large - B/op 1902627 B/op 1899512 B/op 1.00
BenchmarkRBACModelSizes/large - allocs/op 48256 allocs/op 48175 allocs/op 1.00
BenchmarkRBACModelSmall - ns/op 94659 ns/op 76575 ns/op 1.24
BenchmarkRBACModelSmall - B/op 20081 B/op 20063 B/op 1.00
BenchmarkRBACModelSmall - allocs/op 615 allocs/op 615 allocs/op 1
BenchmarkRBACModelMedium - ns/op 984965 ns/op 744067 ns/op 1.32
BenchmarkRBACModelMedium - B/op 194316 B/op 194242 B/op 1.00
BenchmarkRBACModelMedium - allocs/op 6024 allocs/op 6022 allocs/op 1.00
BenchmarkRBACModelLarge - ns/op 11479809 ns/op 8118629 ns/op 1.41
BenchmarkRBACModelLarge - B/op 1950682 B/op 1946279 B/op 1.00
BenchmarkRBACModelLarge - allocs/op 61027 allocs/op 60864 allocs/op 1.00
BenchmarkRBACModelWithResourceRoles - ns/op 7163 ns/op 5976 ns/op 1.20
BenchmarkRBACModelWithResourceRoles - B/op 1822 B/op 1821 B/op 1.00
BenchmarkRBACModelWithResourceRoles - allocs/op 27 allocs/op 27 allocs/op 1
BenchmarkRBACModelWithDomains - ns/op 8253 ns/op 6734 ns/op 1.23
BenchmarkRBACModelWithDomains - B/op 1803 B/op 1803 B/op 1
BenchmarkRBACModelWithDomains - allocs/op 25 allocs/op 25 allocs/op 1
BenchmarkABACModel - ns/op 4464 ns/op 3676 ns/op 1.21
BenchmarkABACModel - B/op 1511 B/op 1512 B/op 1.00
BenchmarkABACModel - allocs/op 17 allocs/op 17 allocs/op 1
BenchmarkABACRuleModel - ns/op 5840107 ns/op 5131663 ns/op 1.14
BenchmarkABACRuleModel - B/op 1304158 B/op 1303506 B/op 1.00
BenchmarkABACRuleModel - allocs/op 40088 allocs/op 40088 allocs/op 1
BenchmarkKeyMatchModel - ns/op 9898 ns/op 8014 ns/op 1.24
BenchmarkKeyMatchModel - B/op 3020 B/op 3022 B/op 1.00
BenchmarkKeyMatchModel - allocs/op 37 allocs/op 37 allocs/op 1
BenchmarkRBACModelWithDeny - ns/op 12032 ns/op 9195 ns/op 1.31
BenchmarkRBACModelWithDeny - B/op 2443 B/op 2444 B/op 1.00
BenchmarkRBACModelWithDeny - allocs/op 49 allocs/op 49 allocs/op 1
BenchmarkPriorityModel - ns/op 6947 ns/op 5536 ns/op 1.25
BenchmarkPriorityModel - B/op 1738 B/op 1741 B/op 1.00
BenchmarkPriorityModel - allocs/op 22 allocs/op 22 allocs/op 1
BenchmarkRBACModelWithDomainPatternLarge - ns/op 40749 ns/op 29442 ns/op 1.38
BenchmarkRBACModelWithDomainPatternLarge - B/op 16597 B/op 16606 B/op 1.00
BenchmarkRBACModelWithDomainPatternLarge - allocs/op 164 allocs/op 164 allocs/op 1
BenchmarkRoleManagerSmall - ns/op 133072 ns/op 98735 ns/op 1.35
BenchmarkRoleManagerSmall - B/op 11952 B/op 11953 B/op 1.00
BenchmarkRoleManagerSmall - allocs/op 797 allocs/op 797 allocs/op 1
BenchmarkRoleManagerMedium - ns/op 1426750 ns/op 1026525 ns/op 1.39
BenchmarkRoleManagerMedium - B/op 125907 B/op 125908 B/op 1.00
BenchmarkRoleManagerMedium - allocs/op 8741 allocs/op 8741 allocs/op 1
BenchmarkRoleManagerLarge - ns/op 17899649 ns/op 12615491 ns/op 1.42
BenchmarkRoleManagerLarge - B/op 1349922 B/op 1349917 B/op 1.00
BenchmarkRoleManagerLarge - allocs/op 89741 allocs/op 89741 allocs/op 1
BenchmarkBuildRoleLinksWithPatternLarge - ns/op 10816579694 ns/op 7480130172 ns/op 1.45
BenchmarkBuildRoleLinksWithPatternLarge - B/op 5286243352 B/op 5289315544 B/op 1.00
BenchmarkBuildRoleLinksWithPatternLarge - allocs/op 60935971 allocs/op 60937241 allocs/op 1.00
BenchmarkBuildRoleLinksWithDomainPatternLarge - ns/op 293484917 ns/op 206167690 ns/op 1.42
BenchmarkBuildRoleLinksWithDomainPatternLarge - B/op 139795270 B/op 139983531 B/op 1.00
BenchmarkBuildRoleLinksWithDomainPatternLarge - allocs/op 1676170 allocs/op 1676211 allocs/op 1.00
BenchmarkBuildRoleLinksWithPatternAndDomainPatternLarge - ns/op 10659661076 ns/op 7735558852 ns/op 1.38
BenchmarkBuildRoleLinksWithPatternAndDomainPatternLarge - B/op 5423137320 B/op 5424907680 B/op 1.00
BenchmarkBuildRoleLinksWithPatternAndDomainPatternLarge - allocs/op 62546421 allocs/op 62547475 allocs/op 1.00
BenchmarkHasLinkWithPatternLarge - ns/op 17012 ns/op 13204 ns/op 1.29
BenchmarkHasLinkWithPatternLarge - B/op 7537 B/op 7539 B/op 1.00
BenchmarkHasLinkWithPatternLarge - allocs/op 111 allocs/op 111 allocs/op 1
BenchmarkHasLinkWithDomainPatternLarge - ns/op 915 ns/op 708 ns/op 1.29
BenchmarkHasLinkWithDomainPatternLarge - B/op 80 B/op 80 B/op 1
BenchmarkHasLinkWithDomainPatternLarge - allocs/op 5 allocs/op 5 allocs/op 1
BenchmarkHasLinkWithPatternAndDomainPatternLarge - ns/op 16709 ns/op 13065 ns/op 1.28
BenchmarkHasLinkWithPatternAndDomainPatternLarge - B/op 7541 B/op 7538 B/op 1.00
BenchmarkHasLinkWithPatternAndDomainPatternLarge - allocs/op 111 allocs/op 111 allocs/op 1

This comment was automatically generated by workflow using github-action-benchmark.

@github-actions
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Performance Alert ⚠️

Possible performance regression was detected for benchmark.
Benchmark result of this commit is worse than the previous benchmark result exceeding threshold 1.10.

Benchmark suite Current: 985a914 Previous: a50c61c Ratio
BenchmarkCachedRaw - ns/op 25.05 ns/op 20.91 ns/op 1.20
BenchmarkCachedBasicModel - ns/op 285.8 ns/op 208.2 ns/op 1.37
BenchmarkCachedRBACModel - ns/op 279.3 ns/op 210 ns/op 1.33
BenchmarkCachedRBACModelSmall - ns/op 301.3 ns/op 223.5 ns/op 1.35
BenchmarkCachedRBACModelMedium - ns/op 330.7 ns/op 236.7 ns/op 1.40
BenchmarkCachedRBACModelLarge - ns/op 273.3 ns/op 221.3 ns/op 1.23
BenchmarkCachedRBACModelWithResourceRoles - ns/op 310.9 ns/op 217.5 ns/op 1.43
BenchmarkCachedRBACModelWithDomains - ns/op 308.8 ns/op 231.6 ns/op 1.33
BenchmarkCachedABACModel - ns/op 4690 ns/op 3827 ns/op 1.23
BenchmarkCachedKeyMatchModel - ns/op 331.8 ns/op 230.6 ns/op 1.44
BenchmarkCachedRBACModelWithDeny - ns/op 294.7 ns/op 208.8 ns/op 1.41
BenchmarkCachedPriorityModel - ns/op 301.1 ns/op 208 ns/op 1.45
BenchmarkCachedWithEnforceContext - ns/op 532.4 ns/op 420.6 ns/op 1.27
BenchmarkCachedRBACModelMediumParallel - ns/op 280.2 ns/op 229.2 ns/op 1.22
BenchmarkHasPolicySmall - ns/op 882.7 ns/op 673.1 ns/op 1.31
BenchmarkHasPolicyMedium - ns/op 980.8 ns/op 697 ns/op 1.41
BenchmarkHasPolicyLarge - ns/op 1008 ns/op 730.4 ns/op 1.38
BenchmarkAddPolicySmall - ns/op 923.7 ns/op 686.8 ns/op 1.34
BenchmarkAddPolicyMedium - ns/op 1221 ns/op 865.2 ns/op 1.41
BenchmarkAddPolicyLarge - ns/op 1941 ns/op 1507 ns/op 1.29
BenchmarkRemovePolicySmall - ns/op 923.8 ns/op 672.6 ns/op 1.37
BenchmarkRemovePolicyMedium - ns/op 1091 ns/op 782.4 ns/op 1.39
BenchmarkRemovePolicyLarge - ns/op 2318 ns/op 1797 ns/op 1.29
BenchmarkRaw - ns/op 25.15 ns/op 20.91 ns/op 1.20
BenchmarkBasicModel - ns/op 5701 ns/op 4785 ns/op 1.19
BenchmarkRBACModel - ns/op 8636 ns/op 7193 ns/op 1.20
BenchmarkRBACModelSizes/small - ns/op 87099 ns/op 62049 ns/op 1.40
BenchmarkRBACModelSizes/medium - ns/op 1013746 ns/op 655597 ns/op 1.55
BenchmarkRBACModelSizes/large - ns/op 10933852 ns/op 7854827 ns/op 1.39
BenchmarkRBACModelSmall - ns/op 94659 ns/op 76575 ns/op 1.24
BenchmarkRBACModelMedium - ns/op 984965 ns/op 744067 ns/op 1.32
BenchmarkRBACModelLarge - ns/op 11479809 ns/op 8118629 ns/op 1.41
BenchmarkRBACModelWithResourceRoles - ns/op 7163 ns/op 5976 ns/op 1.20
BenchmarkRBACModelWithDomains - ns/op 8253 ns/op 6734 ns/op 1.23
BenchmarkABACModel - ns/op 4464 ns/op 3676 ns/op 1.21
BenchmarkABACRuleModel - ns/op 5840107 ns/op 5131663 ns/op 1.14
BenchmarkKeyMatchModel - ns/op 9898 ns/op 8014 ns/op 1.24
BenchmarkRBACModelWithDeny - ns/op 12032 ns/op 9195 ns/op 1.31
BenchmarkPriorityModel - ns/op 6947 ns/op 5536 ns/op 1.25
BenchmarkRBACModelWithDomainPatternLarge - ns/op 40749 ns/op 29442 ns/op 1.38
BenchmarkRoleManagerSmall - ns/op 133072 ns/op 98735 ns/op 1.35
BenchmarkRoleManagerMedium - ns/op 1426750 ns/op 1026525 ns/op 1.39
BenchmarkRoleManagerLarge - ns/op 17899649 ns/op 12615491 ns/op 1.42
BenchmarkBuildRoleLinksWithPatternLarge - ns/op 10816579694 ns/op 7480130172 ns/op 1.45
BenchmarkBuildRoleLinksWithDomainPatternLarge - ns/op 293484917 ns/op 206167690 ns/op 1.42
BenchmarkBuildRoleLinksWithPatternAndDomainPatternLarge - ns/op 10659661076 ns/op 7735558852 ns/op 1.38
BenchmarkHasLinkWithPatternLarge - ns/op 17012 ns/op 13204 ns/op 1.29
BenchmarkHasLinkWithDomainPatternLarge - ns/op 915 ns/op 708 ns/op 1.29
BenchmarkHasLinkWithPatternAndDomainPatternLarge - ns/op 16709 ns/op 13065 ns/op 1.28

This comment was automatically generated by workflow using github-action-benchmark.

Please sign in to comment.