Skip to content

Make test suite more efficient to run in 10 minutes #584

Closed
@weiji14

Description

@weiji14

Description of the desired feature

PyGMT's test suite is growing, and in the long-term, we'll need to make testing a bit more efficient for contributors. As a goal, we should aim for ~10 minutes for the whole test suite (Windows takes up ~30min 15min now (see #586)), and <1 minute for local tests on just one module.

Here's a few ways we can tackle this (note to maintainers, feel free to edit this top post):

Local tests

Running make test can be slow since it runs everything, but sometimes we only want to test one function (e.g. grdimage).

  • E.g. at Wrap meca #516 (comment), we should document that contributors can run just one test using something like pytest -v --mpl pygmt/tests/test_grdimage.py.
  • Alternatively, look into something like pytest-fastest to automate testing only the code that has changed between the current branch and master.

Github Actions tests

Installing dependencies

The bulk of the CI time is spent installing dependencies from conda (4min on Linux, 9min on Windows). We could:

Speed up full test suite

Find a way to run a minimal set of tests when Pull Request is in draft, and only full test suite when Pull Request is ready to review/in review?

Are you willing to help implement and maintain this feature? Let's do it together 😄

Metadata

Metadata

Assignees

No one assigned

    Labels

    maintenanceBoring but important stuff for the core devs

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions