Improve documentation of how to run the test suite
ProfJanetDavis opened this issue · comments
I can't find any documentation on how to run the automated test suite. This seems like an oversight.
It isn't blocking me. There are enough clues in the source code that I think I can figure out on my own how to run the tests. Once I've done so, I would be happy to write up the documentation. (I'll make notes here on this issue.)
The documentation should go in CONTRIBUTING.md
. ETA: There is one line on running tests already there; we agree it's not enough.
We probably also need documentation on how to write new tests, but that should be a separate issue.
This is a good task for a pair. It will involve reading the existing document carefully to decide where this new information fits, perhaps looking at other README
s for guidance, learning Markdown, and writing the documentation based on notes here. Let's have a different pair do this than the other documentation task, so that everyone can learn. We estimate this is a total of 4 story points.
Notes:
- Of course, tests are in the
tests
directory. - There is a script
run_tests.sh
in the main directory. It callspytest
andpylint
. - So, those packages need to be installed:
pip install -U pytest
(see https://docs.pytest.org/en/stable/getting-started.html)pip install -U pylint
(see https://pypi.org/project/pylint/)- Find where
pip
installs libraries on your computer. (See https://stackoverflow.com/questions/35898734/pip-installs-packages-successfully-but-executables-not-found-from-command-line.) On mine, it's~/Library/Python/3.7
. Then append/bin
to find the directory to add to your$PATH
:~/Library/Python/3.7/bin
.
- Finally! You can execute
./run_tests.sh
at the command line.
Further issues to create:
- A lot of tests fail. Getting the automated tests in sync with the current source code should be a further issue.
- The test suites are named inconsistently. Should all tests of detectors be grouped in a common
detectors
directory? - We need documentation for how to test a detector. Maybe this should go in or with the "how to write a detector" document.
To run a single test suite, run
pytest tests/test_suite.py
For example, to test only the Publications Detector, run
pytest tests/test_publication_detector.py
(Fortunately for purposes of resolving #62, these tests all pass, so we can do test-driven development. Yay!)
Hey, @j6k4m8, I think I'm ready to write this documentation as soon as I have the time. Should it go in CONTRIBUTING.md
or somewhere else?
@Life1999 has a local commit she has not pushed yet. @nidhi2509 will get the instructions from her to test them out.
Sorry, just saw this! Contrib is a great place for it, or we can start docs in the Wiki (which i think is totally empty right now)
Resolved in PR #74