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

Packaging the tests #3

Closed
jo-basevi opened this issue Apr 29, 2024 · 3 comments · Fixed by #22
Closed

Packaging the tests #3

jo-basevi opened this issue Apr 29, 2024 · 3 comments · Fixed by #22
Assignees

Comments

@jo-basevi
Copy link
Collaborator

Package up the tests so they can be installed via conda/pip and versioned.

It is possible to pass a package to pytest pytest --pyargs my-package which runs test code inside that package: https://docs.pytest.org/en/7.1.x/explanation/goodpractices.html#tests-as-part-of-application-code.
However, will need to test that custom command line args such as --control-path , --output-path etc still work (see https://stackoverflow.com/questions/41270604/using-command-line-parameters-with-pytest-pyargs). Otherwise will need to create wrapper commands that call pytest. (Will also need to restructure code into src and test, and add pyproject.toml etc.)

It will also need a think of how it is deployed in CI tests that is run on NCI. As the tests are currently run using the deployed payu module (https://github.com/ACCESS-NRI/payu-condaenv). This package can be added to this conda environment but then the version in the payu conda environment is fixed - which could be fine when the package is in a stable state or the environment can be redeployed with an updated version.

@jo-basevi
Copy link
Collaborator Author

Versioning tests were discussed in this issue #12, so older configurations can run earlier versions of test code.

@jo-basevi
Copy link
Collaborator Author

Also add CI to test packaging, and also CI to run any local tests

@jo-basevi
Copy link
Collaborator Author

Could use pip install PACKAGE_NAME as part of CI tests in access-om2-configs and reproducibility. A potential issue is in repro tests run on NCI, if there were two concurrent repro tests which were installing different versions

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 a pull request may close this issue.

1 participant