Skip to content

Conversation

@calvinp0
Copy link
Member

@calvinp0 calvinp0 commented Jan 21, 2026

Speeds up testing by enabling parallel execution of unit and functional tests using the pytest-xdist plugin.

Adds pytest-xdist as a dependency in environment.yml and requirements.txt.

Adds the -n auto flag to the pytest command in the CI workflow to automatically determine the number of workers.

This pull request also introduces several improvements to the project's environment setup and CI workflows. The main changes involve switching to micromamba for environment management in CI, enforcing stricter channel priorities, and enhancing the test suite with parallelization support.

  • Updated the CI workflow (.github/workflows/ci.yml) to set MAMBA_ALWAYS_YES and CONDA_ALWAYS_YES environment variables, ensuring non-interactive installs for more reliable automation.
  • Modified the environment update and creation commands in devtools/install_rmg.sh to use the --strict-channel-priority flag, enforcing stricter dependency resolution for reproducible environments.
  • Migrated the cache and environment setup in .github/workflows/update-cache.yml from setup-miniconda to setup-micromamba, enabling faster, more reliable builds and leveraging built-in caching for environments and downloads.
  • Therefore, update-cache does not cache the arc environment anymore as that is handled by micromamba in the CI.

Copilot AI review requested due to automatic review settings January 21, 2026 14:31
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR enables parallel pytest execution to speed up CI testing by adding the pytest-xdist plugin and configuring pytest to use automatic worker detection.

Changes:

  • Adds pytest-xdist as a testing dependency
  • Configures pytest to run with -n auto flag for parallel execution in CI workflows

Reviewed changes

Copilot reviewed 2 out of 3 changed files in this pull request and generated no comments.

File Description
requirements.txt Adds pytest-xdist to the testing dependencies
environment.yml Adds conda-forge::pytest-xdist to the conda environment
.github/workflows/ci.yml Adds -n auto flag to pytest commands for both unit and functional tests

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@alongd
Copy link
Member

alongd commented Jan 22, 2026

Thanks @calvinp0 ! This is very important.
Could you take a look at the update_cache test?

@calvinp0 calvinp0 changed the title Enables parallel pytest execution Enables parallel pytest execution and micromamba CI Jan 22, 2026
@calvinp0 calvinp0 requested a review from Lilachn91 January 22, 2026 19:20
JintaoWu98
JintaoWu98 previously approved these changes Jan 23, 2026
Copy link
Member

@JintaoWu98 JintaoWu98 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, just one minor comment\question. Thanks!

Speeds up testing by enabling parallel execution of pytest using the `-n auto` flag.

Adds `pytest-xdist` as a dependency for parallel testing.

Removes the redundant conda environment caching from the `update-cache.yml` workflow, as environment caching is already managed in the CI workflow, and adds `CONDA_ALWAYS_YES` and `MAMBA_ALWAYS_YES` variables to automatically accept prompts.

Also adds the `--strict-channel-priority` flag when creating or updating the conda environment to ensure channel priorities are respected.
Lilachn91
Lilachn91 previously approved these changes Jan 23, 2026
Copy link
Contributor

@Lilachn91 Lilachn91 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM :)

@calvinp0 calvinp0 force-pushed the pytest_parallel branch 2 times, most recently from 204b6c8 to bb3e966 Compare January 23, 2026 16:53
…ian function in torchani.utils

Since we unrestricted the installation of torchani, it would download the latest version as well as pythoin 3.13, thus breaking our tests:
`AttributeError: module 'torchani.utils' has no attribute 'hessian'`
@Lilachn91 Lilachn91 self-requested a review January 23, 2026 18:37
@calvinp0 calvinp0 merged commit d03b56a into main Jan 23, 2026
6 checks passed
@calvinp0 calvinp0 deleted the pytest_parallel branch January 23, 2026 18:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants