test: run doctests in just test
, fix broken doctests
#282
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Because we're using
cargo nextest
, which can't easily learn aboutdoctests from RustDoc, the
just test
command currently only runsnormal unit and integration tests. This means that we have a bunch of
doctests which were silently not being run on CI or when running tests
locally through the Justfile. Whoopsie!
This branch adds a
cargo test --doc
invocation tojust test
as well,so that doctests are also run. Since CI also invokes
just test
, wedon't need to do anything else to ensure that doctests also happen on
CI.
After fixing this, I found that a bunch of our doctests are currently
broken, because...we were never actually testing them lol. In
particular:
mnemos-abi
crate'sbbqueue_ipc
module had a bunch of superbroken tests referincing APIs that don't actually exist in this
module. I believe this probably happened due to @jamesmunns copying
code from his upstream
bbqueue
crate, changing the APIs, andforgetting to update the doctests? Anyway, I just removed them.
mnemos-config
had a bunch of doctests which didn't compile anylonger because I had renamed some APIs and didn't update them, so I
fixed that.