Skip to content

Commit

Permalink
Testcases coverage (#225)
Browse files Browse the repository at this point in the history
* include testcases in coverage

* be more explicit

* add a test

* fix
  • Loading branch information
Geal authored May 26, 2024
1 parent c7b7c95 commit 71f4350
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 2 deletions.
3 changes: 1 addition & 2 deletions .github/workflows/rust.yml
Original file line number Diff line number Diff line change
Expand Up @@ -89,8 +89,7 @@ jobs:
uses: actions-rs/cargo@v1
with:
command: tarpaulin
args: --output-dir coverage --out xml --workspace --exclude benchmarks

args: --output-dir coverage --out xml --workspace --features serde-error --tests --example testcases --example third_party
- name: Upload coverage reports to Codecov
uses: codecov/[email protected]
with:
Expand Down
9 changes: 9 additions & 0 deletions biscuit-auth/examples/testcases.rs
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,10 @@ fn main() {
None => {}
};

run(target, root_key, test, json);
}

fn run(target: String, root_key: Option<String>, test: bool, json: bool) {
let root = if let Some(key) = root_key {
KeyPair::from(&PrivateKey::from_bytes_hex(&key).unwrap())
} else {
Expand Down Expand Up @@ -1973,3 +1977,8 @@ fn print_blocks(token: &Biscuit) -> Vec<BlockContent> {

v
}

#[test]
fn test_samples() {
run("./samples".to_string(), None, true, false);
}

0 comments on commit 71f4350

Please sign in to comment.