inveniosoftware / inveniosoftware/invenio-webhooks

tests: simplify doctest execution

Open
#52 0 comments 0 reactions 0 assignees View on GitHub
Size: easy Status: ready for work
Dominant language
Python
Stars
1
Forks
19
PR merge metrics
No merged PRs in 30d

Description

The following cookiecutter change:

https://github.com/inveniosoftware/cookiecutter-invenio-module/pull/98

should be propagated to this Invenio module.

Namely, in `run-tests.sh`, the sphinx for doctests is invoked after pytest run:

```console
$ tail -3 ./\{\{\ cookiecutter.project_shortname\ \}\}/run-tests.sh
sphinx-build -qnNW docs docs/_build/html && python setup.py test && sphinx-build -qnNW -b doctest docs docs/_build/doctest
```

This sometimes led to problems on Travis CI with the second sphinx-build run due
to "disappearing" dependencies after the example application was tested.

A solution that worked for invenio-marc21 (see
https://github.com/inveniosoftware/invenio-marc21/pull/49#issuecomment-281287103)
and that was integrated in cookiecutter (see
https://github.com/inveniosoftware/cookiecutter-invenio-module/pull/98) was to
run doctest execution in pytest, removing the second `sphinx-build` invocation.

This both solved Travis CI build failures and simplified test suite execution.

Note that this change may necessitate to amend the code tests etc so that things
would be executed with the Flask application context (see
https://github.com/inveniosoftware/invenio-marc21/pull/49/commits/09e98fc18fd5591dc65d806286e8da51b7e384b4).

Contributor guide

Open the contributing guide

Research direction

Start with run-tests.sh and compare its current test sequence with the cookiecutter change linked in the issue. Move doctest execution into pytest, remove the second sphinx-build invocation, and run the test suite to identify tests needing Flask application context. Done means the suite executes doctests through pytest without the redundant Sphinx run.

Written by the indexing model from the issue text.

Assessment

Tech stack
flask, python
Domain
documentation, testing
Issue type
Refactor
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
48/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.