From 22c61a1ecbfc6a2fd109f704d9c2449c7981a0b5 Mon Sep 17 00:00:00 2001 From: ad hoc Date: Wed, 16 Mar 2022 17:01:05 +0100 Subject: [PATCH 1/2] chore(http): add test for validity of cli --- meilisearch-http/src/option.rs | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/meilisearch-http/src/option.rs b/meilisearch-http/src/option.rs index 0f1ff5970..7284b4588 100644 --- a/meilisearch-http/src/option.rs +++ b/meilisearch-http/src/option.rs @@ -258,3 +258,13 @@ fn load_ocsp(filename: &Option) -> anyhow::Result> { Ok(ret) } + +#[cfg(test)] +mod test { + use super::*; + + #[test] + fn test_valid_opt() { + assert!(Opt::try_parse_from(Some("")).is_ok()); + } +} From 1d683865cfc9efd99d3aca03a6c1eb50f28eb1c3 Mon Sep 17 00:00:00 2001 From: ad hoc Date: Wed, 16 Mar 2022 17:13:49 +0100 Subject: [PATCH 2/2] chore(CI): add debug test to CI --- .github/workflows/rust.yml | 19 +++++++++++++++++++ bors.toml | 3 ++- 2 files changed, 21 insertions(+), 1 deletion(-) diff --git a/.github/workflows/rust.yml b/.github/workflows/rust.yml index a98e29f44..ff28f82ca 100644 --- a/.github/workflows/rust.yml +++ b/.github/workflows/rust.yml @@ -36,6 +36,25 @@ jobs: command: test 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: name: Run Clippy runs-on: ubuntu-18.04 diff --git a/bors.toml b/bors.toml index ba97aaf43..b357e8d61 100644 --- a/bors.toml +++ b/bors.toml @@ -3,7 +3,8 @@ status = [ 'Tests on macos-latest', 'Tests on windows-latest', 'Run Clippy', - 'Run Rustfmt' + 'Run Rustfmt', + 'Run tests in debug', ] pr_status = ['Milestone Check'] # 3 hours timeout