Skip to content

Improve the CI tests speed via Codecov Automated Test Selection #2791

Closed

Description

@seisman

I haven't read the full documentation carefully, but it seems the new codecov tool, Automated Test Selection can help improve the tests speed significantly:

Automated Test Selection is a Codecov feature that ensures your CI pipeline only runs the tests needed to completely exercise the diff of a commit. Automated Test Selection is intended to greatly reduce the time needed to run test suites without compromising on test coverage or having to invest in creating the complex CI pipelines and tools (e.g., Bazel) that are typically required to facilitate test selection.

Testing tools typically have a stage of collecting tests followed by a stage of executing tests. The idea behind Automated Test Selection is to live exactly between those 2 stages as a filter to decide which tests necessarily need to be executed, considering the diff of the commit being tested.

I think it may be worth a try.

Activity

  1. added
    question
    maintenance
    on Nov 1, 2023
  2. weiji14 commented on Nov 1, 2023

    @weiji14
    Member

    Linking to #584. I mentioned something similar with pytest-fastest before, but maybe this is easier to set-up.

    Ok to try this Automated Test Selection for Pull Requests, but run full tests still on the main branch (and also for release PRs)? Looking at https://docs.codecov.com/docs/automated-test-selection-quick-start, it sounds like the GitHub Action is only tested on Linux and macOS, so need to check if Windows (our slowest tests) works. We could file an issue at https://github.com/codecov/codecov-ats requesting for Windows support if it doesn't.

  3. added this to the 0.11.0 milestone on Nov 1, 2023
  4. removed
    question
    on Nov 1, 2023
  5. changed the title [-]Improve the CI tests speed via Codecov Automated Test Selection?[/-] [+]Improve the CI tests speed via Codecov Automated Test Selection[/+] on Nov 1, 2023
  6. self-assigned this
    on Nov 1, 2023
  7. modified the milestones: 0.11.0, 0.12.0 on Dec 11, 2023
  8. removed this from the 0.12.0 milestone on Feb 26, 2024
  9. seisman commented on Jun 19, 2024

    @seisman
    MemberAuthor

    As mentioned in #584 (comment), currently running the tests takes < 1 minute on Linux/macOS and 3 minutes on Windows (see https://github.com/GenericMappingTools/pygmt/actions/runs/9574409146/job/26397597813 for the latest run), which is already fast enough. I don't think we need the Codecov ATS anymore. I'm closing the issue and the related PR #2792.

    We may revisit it if the number of tests increases significantly in the future.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

maintenance

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions