Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Test command-line parsing configuration #60

Merged
merged 2 commits into from
Aug 20, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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.

Loading