Skip to content

Commit

Permalink
Merge pull request #60 from biscuit-auth/test-clap
Browse files Browse the repository at this point in the history
Test command-line parsing configuration
  • Loading branch information
divarvel authored Aug 20, 2024
2 parents f1ec5d0 + e75a7e3 commit 79da651
Show file tree
Hide file tree
Showing 5 changed files with 7 additions and 72 deletions.
3 changes: 0 additions & 3 deletions .github/workflows/rust.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,6 @@ jobs:
runs-on: ubuntu-latest

steps:
- uses: mig4/setup-bats@v1
- uses: brokenpip3/[email protected]
- uses: actions/checkout@v2
- name: Cache
uses: actions/cache@v2
Expand All @@ -36,4 +34,3 @@ jobs:
- name: Tests
run: |
cargo test
bats test.bats
18 changes: 0 additions & 18 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -145,21 +145,3 @@ cargo fmt --check
# CI ensures that there are no outstanding clippy hints
cargo clippy
```
### Integration tests
To run integration tests locally, you will need `bats`. For now, only installation through `brew` and github actions is supported (`bats` needs to load its modules manually, and their installation path depends how they were installed). Feel free to add support for more systems as needed.
```sh
bats test.bats
```
<details>
<summary>Installation with brew</summary>
```sh
brew install bats-core
brew tap kaos/shell
brew install bats-assert
brew install bats-file
```
</details>
6 changes: 6 additions & 0 deletions src/cli.rs
Original file line number Diff line number Diff line change
Expand Up @@ -351,3 +351,9 @@ mod common_args {
pub raw_input: bool,
}
}

#[test]
fn verify_cli() {
use clap::CommandFactory;
Opts::command().debug_assert();
}
2 changes: 1 addition & 1 deletion src/inspect.rs
Original file line number Diff line number Diff line change
Expand Up @@ -414,7 +414,7 @@ pub fn handle_inspect_inner(inspect: &Inspect) -> Result<InspectionResults> {

if let Some(key_from) = public_key_from {
let key = read_public_key_from(&key_from)?;
let sig_result = biscuit.check_signature(|_| key);
let sig_result = biscuit.verify(key);
signatures_check = Some(sig_result.is_ok());

if let Ok(biscuit) = sig_result {
Expand Down
50 changes: 0 additions & 50 deletions test.bats

This file was deleted.

0 comments on commit 79da651

Please sign in to comment.