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

Clarify required dependencies to run unit tests #1697

Closed
weiji14 opened this issue Jan 8, 2022 · 2 comments · Fixed by #1783
Closed

Clarify required dependencies to run unit tests #1697

weiji14 opened this issue Jan 8, 2022 · 2 comments · Fixed by #1783
Assignees
Labels
documentation Improvements or additions to documentation help wanted Helping hands are appreciated
Milestone

Comments

@weiji14
Copy link
Member

weiji14 commented Jan 8, 2022

Description of the desired feature

Originally posted by @SimonMolinsky in pyOpenSci/software-submission#43 (comment)

  • [ ] Automated tests: Tests cover essential functions of the package and a reasonable range of inputs and conditions. All tests pass on the local machine.

Yes, the test coverage is 99% and pyGMT has a description of tests in Contributing Guide. But I have two comments here:

  1. For full test coverage you need to install not only pytest but pytest-mpl and sphinx-gallery too. Those information are presented in the documentation here but in different paragraphs. Maybe it is a good idea to rewrite this part of documentation slightly and present list of all additional packages needed for testing?
  2. The other problem is more confusing. When I run all tests then I got results with 2/3 of tests passing but there is 1/3 that fail. When I look into the test output I see a text This is expected for new tests. So I run test again and I see the same communicate. It is extremely misleading, especially for contributors - if I create new functionalities and run all tests to check if everything is ok I must manually check each failed test if it has phrase This is expected for new tests. Did I miss something?

Looks like we'll need to include a list of the test dependencies in the contributing documentation rather than hide it in https://github.com/GenericMappingTools/pygmt/blob/main/environment.yml

E.g. make a list like:

  • pytest-mpl
  • sphinx-gallery
  • dvc
  • etc

Are you willing to help implement and maintain this feature? Yes/No

@weiji14 weiji14 added the documentation Improvements or additions to documentation label Jan 8, 2022
@weiji14 weiji14 added this to the 0.6.0 milestone Jan 8, 2022
@weiji14 weiji14 added the help wanted Helping hands are appreciated label Jan 13, 2022
@weiji14 weiji14 self-assigned this Mar 4, 2022
@seisman
Copy link
Member

seisman commented Mar 4, 2022

2. The other problem is more confusing. When I run all tests then I got results with 2/3 of tests passing but there is 1/3 that fail. When I look into the test output I see a text This is expected for new tests. So I run test again and I see the same communicate. It is extremely misleading, especially for contributors - if I create new functionalities and run all tests to check if everything is ok I must manually check each failed test if it has phrase This is expected for new tests

Does anyone see the same message "This is expected for new tests"? It's not in the PyGMT code.

@maxrjones
Copy link
Member

Does anyone see the same message "This is expected for new tests"? It's not in the PyGMT code.

Wei Ji explained this as a consequence of not running dvc pull before make test during the last community meeting. I recently got this message when I create a new image based test but had not yet added the image to the baseline images directory. The warning is generated by the pytest-mpl plugin.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
documentation Improvements or additions to documentation help wanted Helping hands are appreciated
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants