Skip to content

Clarify required dependencies to run unit tests #1697

Closed

Description

@weiji14

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

Activity

  1. added
    documentation
    on Jan 8, 2022
  2. added this to the 0.6.0 milestone on Jan 8, 2022
  3. added
    help wanted
    on Jan 13, 2022
  4. self-assigned this
    on Mar 4, 2022
  5. seisman commented on Mar 4, 2022

    @seisman
    Member

    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.

  6. maxrjones commented on Mar 4, 2022

    @maxrjones
    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

Metadata

Metadata

Assignees

Labels

documentationhelp wanted

Type

No type

Projects

No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions