Run doctests as part of CI pipeline (#9939)

This commit is contained in:
Micha Reiser 2024-02-12 10:18:58 +01:00 committed by GitHub
parent a50e2787df
commit 341c2698a7
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
14 changed files with 37 additions and 3 deletions

8
.config/nextest.toml Normal file
View File

@ -0,0 +1,8 @@
[profile.ci]
# Print out output for failing tests as soon as they fail, and also at the end
# of the run (for easy scrollability).
failure-output = "immediate-final"
# Do not cancel the test run on the first failure.
fail-fast = false
status-level = "skip"

View File

@ -117,10 +117,17 @@ jobs:
uses: taiki-e/install-action@v2
with:
tool: cargo-nextest
- name: "Install cargo insta"
uses: taiki-e/install-action@v2
with:
tool: cargo-insta
- uses: Swatinem/rust-cache@v2
- name: "Run tests"
shell: bash
run: cargo nextest run --workspace --status-level skip --failure-output immediate-final --no-fail-fast -j 12
env:
NEXTEST_PROFILE: "ci"
run: cargo insta test --all-features --unreferenced reject --test-runner nextest
# Check for broken links in the documentation.
- run: cargo doc --all --no-deps
env:
@ -148,7 +155,9 @@ jobs:
- uses: Swatinem/rust-cache@v2
- name: "Run tests"
shell: bash
run: cargo nextest run --workspace --status-level skip --failure-output immediate-final --no-fail-fast -j 12
run: |
cargo nextest run --all-features --profile ci
cargo test --all-features --doc
cargo-test-wasm:
name: "cargo test (wasm)"

View File

@ -13,6 +13,7 @@ license = { workspace = true }
[lib]
bench = false
doctest = false
[[bench]]
name = "linter"

View File

@ -11,6 +11,7 @@ repository = { workspace = true }
license = { workspace = true }
[lib]
doctest = false
[dependencies]
ruff_text_size = { path = "../ruff_text_size" }

View File

@ -11,6 +11,7 @@ repository = { workspace = true }
license = { workspace = true }
[lib]
doctest = false
[dependencies]
ruff_macros = { path = "../ruff_macros" }

View File

@ -92,7 +92,9 @@ pub fn derive_message_formats(_attr: TokenStream, item: TokenStream) -> TokenStr
///
/// Good:
///
/// ```rust
/// ```ignroe
/// use ruff_macros::newtype_index;
///
/// #[newtype_index]
/// #[derive(Ord, PartialOrd)]
/// struct MyIndex;

View File

@ -11,6 +11,7 @@ repository = { workspace = true }
license = { workspace = true }
[lib]
doctest = false
[dependencies]
ruff_diagnostics = { path = "../ruff_diagnostics" }

View File

@ -11,6 +11,7 @@ repository = { workspace = true }
license = { workspace = true }
[lib]
doctest = false
[dependencies]
ruff_python_ast = { path = "../ruff_python_ast" }

View File

@ -10,6 +10,9 @@ documentation = { workspace = true }
repository = { workspace = true }
license = { workspace = true }
[lib]
doctest= false
[dependencies]
ruff_cache = { path = "../ruff_cache" }
ruff_formatter = { path = "../ruff_formatter" }

View File

@ -11,6 +11,7 @@ repository = { workspace = true }
license = { workspace = true }
[lib]
doctest = false
[dependencies]
ruff_python_ast = { path = "../ruff_python_ast" }

View File

@ -11,6 +11,9 @@ documentation = { workspace = true }
repository = { workspace = true }
license = { workspace = true }
[lib]
doctest = false
[dependencies]
bitflags = { workspace = true }
hexf-parse = { workspace = true }

View File

@ -12,6 +12,7 @@ repository = { workspace = true }
license = { workspace = true }
[lib]
doctest = false
[dependencies]
log = { workspace = true }

View File

@ -11,6 +11,7 @@ repository = { workspace = true }
license = { workspace = true }
[lib]
doctest = false
[dependencies]
ruff_index = { path = "../ruff_index" }

View File

@ -13,6 +13,7 @@ description = "WebAssembly bindings for Ruff"
[lib]
crate-type = ["cdylib", "rlib"]
doctest = false
[features]
default = ["console_error_panic_hook"]