HomePhabricator
Diffusion Comm cd565aeb9012

[comm-services-lib] Fix doctests

Description

[comm-services-lib] Fix doctests

Summary:
We have some examples in services lib (which is great!) but when running cargo test in comm-services-lib they all fail. This diff improves the examples so they can also be run alongside tests.

Here is some more info about documentation tests: https://doc.rust-lang.org/rustdoc/write-documentation/documentation-tests.html

We can use /// # syntax to include utility code that allows the example to be run, but won't be visible when generating the docs/ hovering over the definition in IDE.

This all adds some verbosity, so if it's decided that it's not the best option we should at least add ignore so the examples aren't run/compiled when running cargo test

Test Plan: cargo test --all-features

Reviewers: bartek, patryk, jon

Reviewed By: bartek

Subscribers: ashoat, tomek

Differential Revision: https://phab.comm.dev/D8889

Details

Provenance
Michal Gniadek <michal.gniadek@swmansion.com>Authored on Aug 21 2023, 4:39 AM
Reviewer
bartek
Differential Revision
D8889: [comm-services-lib] Fix doctests
Parents
rCOMM3e386a6483a4: [backup] Use blob client
Branches
Unknown
Tags
Unknown

Event Timeline

Michal Gniadek <michal.gniadek@swmansion.com> committed rCOMMcd565aeb9012: [comm-services-lib] Fix doctests (authored by Michal Gniadek <michal.gniadek@swmansion.com>).Aug 25 2023, 9:40 AM