Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

guide: add a testing section to the contributing guide #598

Merged
merged 5 commits into from
Aug 30, 2018

Conversation

carllerche
Copy link
Member

Motivation

We would like contributors to be able to help out with documentation tests

Solution

Add some notes in the guide on how to write tests.

Unverified

This user has not yet uploaded their public signing key.
Copy link
Member

@hawkw hawkw left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This looks good to me!

CONTRIBUTING.md Outdated

Ideally, every API has at least one documentation test that demonstrates how to
use the API. Documentation tests are run with `cargo test --doc`. This ensures
that the example is correct and provides additional test coverage.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

TIOLI: might be good to link to https://doc.rust-lang.org/rustdoc/documentation-tests.html somewhere in here?

Verified

This commit was signed with the committer’s verified signature.
hawkw Eliza Weisman
Signed-off-by: Eliza Weisman <eliza@buoyant.io>
Copy link
Member

@tobz tobz left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

A few spelling nits and one sentence reword, otherwise this is good. 👍

CONTRIBUTING.md Outdated
use the API. Documentation tests are run with `cargo test --doc`. This ensures
that the example is correct and provides additional test coverage.

The trick to documentation tests is stricking a balance between being susinct
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: stricking -> striking, sucinct -> succinct

CONTRIBUTING.md Outdated
`FutureExt::timeout`, this is how the documentation test is structured.

Lines that start with `/// #` are removed when the documentation is generated.
They are onlly there to get the test to run. The `block_on_all` function is the
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: onlly -> only

CONTRIBUTING.md Outdated

#### Integration tests

Integration tests go in the crate that they are test. Each sub crate should have
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reword this slightly? Integration tests go in the same crate as the code they are testing, perhaps?

@carllerche carllerche changed the title guide: add guide: add a testing section to the contributing guide Aug 30, 2018

Unverified

This user has not yet uploaded their public signing key.

Unverified

This user has not yet uploaded their public signing key.

Unverified

This user has not yet uploaded their public signing key.
…into writing-a-doc-test
@carllerche carllerche merged commit d8f8b59 into master Aug 30, 2018
@carllerche carllerche deleted the writing-a-doc-test branch August 31, 2018 17:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants