2245: Add test to validate cli r=irevoire a=MarinPostma

followup on #2242 and #2243

Add a test to make sure the cli is valid, and add a CI task to run the tests in debug to make sure we hit debug assertions.

FYI `@curquiza,` because of CI changes

Co-authored-by: ad hoc <postma.marin@protonmail.com>
This commit is contained in:
bors[bot] 2022-03-17 16:14:31 +00:00 committed by GitHub
commit d1c0ecceb9
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 31 additions and 1 deletions

View File

@ -36,6 +36,25 @@ jobs:
command: test command: test
args: --locked --release args: --locked --release
# We run tests in debug also, to make sure that the debug_assertions are hit
test-debug:
name: Run tests in debug
runs-on: ubuntu-18.04
steps:
- uses: actions/checkout@v2
- uses: actions-rs/toolchain@v1
with:
profile: minimal
toolchain: stable
override: true
- name: Cache dependencies
uses: Swatinem/rust-cache@v1.3.0
- name: Run tests in debug
uses: actions-rs/cargo@v1
with:
command: test
args: --locked
clippy: clippy:
name: Run Clippy name: Run Clippy
runs-on: ubuntu-18.04 runs-on: ubuntu-18.04

View File

@ -3,7 +3,8 @@ status = [
'Tests on macos-latest', 'Tests on macos-latest',
'Tests on windows-latest', 'Tests on windows-latest',
'Run Clippy', 'Run Clippy',
'Run Rustfmt' 'Run Rustfmt',
'Run tests in debug',
] ]
pr_status = ['Milestone Check'] pr_status = ['Milestone Check']
# 3 hours timeout # 3 hours timeout

View File

@ -258,3 +258,13 @@ fn load_ocsp(filename: &Option<PathBuf>) -> anyhow::Result<Vec<u8>> {
Ok(ret) Ok(ret)
} }
#[cfg(test)]
mod test {
use super::*;
#[test]
fn test_valid_opt() {
assert!(Opt::try_parse_from(Some("")).is_ok());
}
}