From 0790eb470d2ada9dd89db22c30f793d64e5a3cf0 Mon Sep 17 00:00:00 2001 From: Aaron Allen Date: Sat, 29 Aug 2026 00:53:50 -0500 Subject: [PATCH] test(ops): run doctests from mise run test and fix the broken one Every task under tasks/test runs nextest, and nextest does not run doctests at all. The workspace's doctests were therefore never run by anything, and one of them had been failing unnoticed: the `extract_note` example calls the function without importing it, and a doctest compiles as its own crate, so nothing is in scope. Add the import, and give `mise run test` a `cargo test --doc` pass. That pass builds outside the coverage target directory, so the reports are unaffected and doctests do not count toward coverage. Checked by breaking the example again: the task exits 101, and 0 once it is fixed. The per-crate tasks still skip doctests. --- crates/ops/src/extract_note.rs | 2 ++ tasks/test/_default | 7 +++++++ 2 files changed, 9 insertions(+) diff --git a/crates/ops/src/extract_note.rs b/crates/ops/src/extract_note.rs index 7276ea4..e6c32a8 100644 --- a/crates/ops/src/extract_note.rs +++ b/crates/ops/src/extract_note.rs @@ -8,6 +8,8 @@ /// # Examples /// /// ``` +/// use doing_ops::extract_note::extract_note; +/// /// let (title, note) = extract_note("Working on project (some context)"); /// assert_eq!(title, "Working on project"); /// assert_eq!(note.unwrap(), "some context"); diff --git a/tasks/test/_default b/tasks/test/_default index d26ae6d..c0c695f 100755 --- a/tasks/test/_default +++ b/tasks/test/_default @@ -8,10 +8,17 @@ set -e FILTER_ARGS="" +DOC_FILTER_ARGS="" if [ -n "${usage_filter}" ]; then FILTER_ARGS="--no-fail-fast --filter-expr 'test(/${usage_filter}/)'" + DOC_FILTER_ARGS="--no-fail-fast ${usage_filter}" fi eval cargo llvm-cov nextest --workspace --summary-only --all-features --no-tests pass $FILTER_ARGS + +# nextest cannot run doctests, so without this pass they are never run at all. +# It builds outside the coverage target dir, so the reports below are unaffected +# and doctests do not count toward coverage. +eval cargo test --doc --workspace --all-features $DOC_FILTER_ARGS cargo llvm-cov report --html --output-dir coverage cargo llvm-cov report --cobertura --output-path coverage/cobertura.xml -- knotmirror 0.0.1