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

Streamline local and remote development testing with tox/ GitHub CI #1295

Closed
2 tasks done
Zeitsperre opened this issue Feb 14, 2023 · 0 comments · Fixed by #1297
Closed
2 tasks done

Streamline local and remote development testing with tox/ GitHub CI #1295

Zeitsperre opened this issue Feb 14, 2023 · 0 comments · Fixed by #1297
Assignees
Labels
enhancement New feature or request priority Immediate priority standards / conventions Suggestions on ways forward

Comments

@Zeitsperre
Copy link
Collaborator

Addressing a Problem?

There are three issues at hand here:

  • Presently, local development and CI tests are largely identical workflows thanks to tools like tox. While this reduces the need to update our development steps considerably (documentation and CI stages), there are instances where this is not well suited to local development. One such issue is the use of pytest-cov, which is helpful for CI and noisy for local developers.

  • In order to speed up testing, in a recent release we adopted pytest-xdist as a means of distributing tests between processes. GitHub CI offers Linux VMs with two cores, so this effectively halves testing time needed (which is great!). This becomes an issue when running tests for individual tests locally, as regardless of the number of tests being run, workers need to be spun-up to meet this configuration (automatic distribution; 6 workers maximum). To add insult to injury, importing xclim remains something of a lengthy process (several seconds), despite advancements that have sped this up considerably.

  • For us to maintain and ensure that the test are being run with the most recent testing data, the test data is synchronized with the main branch of xclim-testdata at every call of pytest by default. This adds a lot of delay to the running of tests as these files are always verified at every run.

Potential Solution

Most of these configurations work very well for our CI configurations. With some tweaking, there are some ways to further streamline this but we seem to have a workable configuration for our test ensemble.

We need to define a set of configurations for local development, and this will neccessitate making some decisions:

  • How do we want to enable distributed testing (pytest-xdist) when running tests locally?
    • Where should distributed testing configurations be housed?
  • What logic/checks should we use to determine when we should perform a synchronization of the local testdata with remote?
    • Can we think of a better approach to gathering the testdata across workers?

Some approaches could be:

Perhaps it would be good to define a an ideal set of configs for each use-case and seeing how best we can accomodate them?

  • CI Testing
  • Local Testing (full suite of tests)
  • Local Testing (individual tests)

Additional context

No response

Contribution

  • I would be willing/able to open a Pull Request to contribute this feature.

Code of Conduct

  • I agree to follow this project's Code of Conduct
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request priority Immediate priority standards / conventions Suggestions on ways forward
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants