Skip to content

doc: test code/config snippets in docs#882

Merged
Emantor merged 14 commits intolabgrid-project:masterfrom
Bastian-Krause:bst/doctest
Jan 14, 2022
Merged

doc: test code/config snippets in docs#882
Emantor merged 14 commits intolabgrid-project:masterfrom
Bastian-Krause:bst/doctest

Conversation

@Bastian-Krause
Copy link
Copy Markdown
Member

Description
In the past, a lot of code snippets in the documentation did not work (see #877). Use sphinx' doctest extension to test code snippets and configurations where feasible.

While at it, fix the documentation of the docker strategy.

Checklist

  • PR has been tested

Fixes #301

Signed-off-by: Bastian Krause <bst@pengutronix.de>
Signed-off-by: Bastian Krause <bst@pengutronix.de>
This way doctest is able to test the config and code examples from the
documentation.

Signed-off-by: Bastian Krause <bst@pengutronix.de>
The example code in the documentation expects the example configs/python
files in the current working directory.

Signed-off-by: Bastian Krause <bst@pengutronix.de>
When adding test setup blocks, we need some imports over and over again.
Let's import them here to keep the test setup blocks as small as
possible.

Signed-off-by: Bastian Krause <bst@pengutronix.de>
In an initial version of the patch series, the strategy was called
DockerShellStrategy. But that was changed before the PR was merged. So
adjust the documentation to the actual existing DockerStrategy.

Signed-off-by: Bastian Krause <bst@pengutronix.de>
Signed-off-by: Bastian Krause <bst@pengutronix.de>
…works

Better refer to a working strategy example. This way we can also drop
this untestable code block.

Signed-off-by: Bastian Krause <bst@pengutronix.de>
Signed-off-by: Bastian Krause <bst@pengutronix.de>
Signed-off-by: Bastian Krause <bst@pengutronix.de>
Signed-off-by: Bastian Krause <bst@pengutronix.de>
Signed-off-by: Bastian Krause <bst@pengutronix.de>
Signed-off-by: Bastian Krause <bst@pengutronix.de>
This allows testing of the GraphStrategy graph rendering example in the
development documentation. If graphviz is not installed, the
corresponding test is skipped.

Signed-off-by: Bastian Krause <bst@pengutronix.de>
@codecov
Copy link
Copy Markdown

codecov Bot commented Jan 10, 2022

Codecov Report

Merging #882 (3449a15) into master (9988482) will not change coverage.
The diff coverage is n/a.

Impacted file tree graph

@@          Coverage Diff           @@
##           master    #882   +/-   ##
======================================
  Coverage    57.0%   57.0%           
======================================
  Files         148     148           
  Lines       10973   10973           
======================================
  Hits         6260    6260           
  Misses       4713    4713           

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 9988482...3449a15. Read the comment docs.

@Emantor Emantor merged commit 95bd0fe into labgrid-project:master Jan 14, 2022
@Bastian-Krause Bastian-Krause deleted the bst/doctest branch January 15, 2022 12:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants