Skip to content

Commit

Permalink
feat: Add benchmark test
Browse files Browse the repository at this point in the history
  • Loading branch information
leeqvip committed Dec 17, 2021
1 parent 16e826f commit c0edb14
Show file tree
Hide file tree
Showing 6 changed files with 4,007 additions and 3 deletions.
7 changes: 5 additions & 2 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -32,10 +32,13 @@ jobs:
run: composer install --prefer-dist --no-progress --no-suggest

- name: Run phpstan analyse
run: ./vendor/bin/phpstan analyse
run: composer analyse

- name: Run test suite
run: ./vendor/bin/phpunit -v
run: composer test

- name: Run benchmark
run: composer benchmark

- name: Run Coveralls
env:
Expand Down
5 changes: 5 additions & 0 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -37,5 +37,10 @@
"psr-4": {
"Casbin\\Tests\\": "tests/"
}
},
"scripts": {
"test": "./vendor/bin/phpunit -v --testsuite test",
"benchmark": "./vendor/bin/phpunit -v --testsuite benchmark",
"analyse": "./vendor/bin/phpstan analyse"
}
}
14 changes: 14 additions & 0 deletions examples/performance/rbac_with_pattern_large_scale_model.conf
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
[request_definition]
r = sub, obj, act

[policy_definition]
p = sub, obj, act

[role_definition]
g = _, _, _

[policy_effect]
e = some(where (p.eft == allow))

[matchers]
m = g(r.sub, p.sub, r.obj) && keyMatch4(r.obj, p.obj) && regexMatch(r.act, p.act)
Loading

0 comments on commit c0edb14

Please sign in to comment.