casbin / casbin-rs

An authorization library that supports access control models like ACL, RBAC, ABAC in Rust.
https://casbin.org
Apache License 2.0
851 stars 72 forks source link

feat: Migrate to Criterion benchmark #242

Closed 0xethsign closed 3 years ago

0xethsign commented 3 years ago
codecov[bot] commented 3 years ago

Codecov Report

Merging #242 (968da71) into master (1be8610) will decrease coverage by 0.26%. The diff coverage is 100.00%.

:exclamation: Current head 968da71 differs from pull request most recent head f435d0a. Consider uploading reports for the commit f435d0a to get more accurate results Impacted file tree graph

@@            Coverage Diff             @@
##           master     #242      +/-   ##
==========================================
- Coverage   80.25%   79.99%   -0.27%     
==========================================
  Files          22       22              
  Lines        3429     3429              
==========================================
- Hits         2752     2743       -9     
- Misses        677      686       +9     
Impacted Files Coverage Δ
src/enforcer.rs 85.54% <100.00%> (-0.40%) :arrow_down:
src/effector.rs 74.54% <0.00%> (-3.64%) :arrow_down:
src/model/default_model.rs 92.58% <0.00%> (-0.90%) :arrow_down:
src/config.rs 86.33% <0.00%> (-0.63%) :arrow_down:

Continue to review full report at Codecov.

Legend - Click here to learn more Δ = absolute <relative> (impact), ø = not affected, ? = missing data Powered by Codecov. Last update 1be8610...f435d0a. Read the comment docs.

0xethsign commented 3 years ago

run benchmark is failing because of a deprecated function in the master branch -

cargo bench -- --save-baseline master
   Compiling num-traits v0.2.14
   Compiling rhai v0.19.15
   Compiling casbin v2.0.6 (/home/runner/work/casbin-rs/casbin-rs)
warning: unused import: `RegisterFn`
  --> src/enforcer.rs:34:54
   |
34 |     Dynamic, Engine, EvalAltResult, ImmutableString, RegisterFn, Scope,
   |                                                      ^^^^^^^^^^
   |
   = note: `#[warn(unused_imports)]` on by default

warning: use of deprecated trait `rhai::RegisterFn`: this trait is no longer needed and will be removed in the future
  --> src/enforcer.rs:34:54
   |
34 |     Dynamic, Engine, EvalAltResult, ImmutableString, RegisterFn, Scope,
   |                                                      ^^^^^^^^^^
   |
   = note: `#[warn(deprecated)]` on by default

error[E0599]: no method named `set_fn_1` found for mutable reference `&mut Module` in the current scope
  --> src/enforcer.rs:43:9
   |
43 |     lib.set_fn_1("escape_assertion", |s: ImmutableString| {
   |         ^^^^^^^^ help: there is an associated function with a similar name: `set_fn`

error: aborting due to previous error; 2 warnings emitted

The second commit fixes that.

0xethsign commented 3 years ago

@hackerchai please review this.

hsluoyz commented 3 years ago

@smrpn remove merge commits

image

hsluoyz commented 3 years ago

@hackerchai

hackerchai commented 3 years ago

@smrpn please fix the bench error

hsluoyz commented 3 years ago

@smrpn

image