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

[WIP] Add automated tests #67

Draft
wants to merge 10 commits into
base: main
Choose a base branch
from
Draft

[WIP] Add automated tests #67

wants to merge 10 commits into from

Conversation

ma595
Copy link
Collaborator

@ma595 ma595 commented Sep 17, 2024

Automatic testing

The tests rely on a job being completed before execution as output data needs to be there for a comparison to happen. For automated testing (regression), this presents a problem. We have therefore shown how it may be possible to use github actions to run the job in advance and then execute a single test.

The automated job needs the following data to execute a test.

  • reference data for comparison (zenodo)
  • simulation input data.

The zenodo data is approximately 1.1GB. We cannot run SPINacc from scratch because the data dependencies are just too large. This is explained more here

Testing is steered using a .github actions file. .github/workflows/python.yml, and assumes that the initialisation step has already been executed. Therefore auxil.npy and packdata.npy are already there.

It does the following:

  • Clones reference data from https://github.com/ma595/SPINacc-data.git including:
    • auxil.npy (metadata) and packdata.npy
    • vlad_data/vlad_data
    • Does some sed to change the execution paths and the test to test_clustering. Equally, we could commit a file and move this to the appropriate location. (Doesn't have to be DEF_Trunk, for example).
    • Change paths in varlist.json to the appropriate path corresponding to the directory of the cloned vlad_data.
    • Runsmain.py
    • pytest then executes tests/test_task1.py only.

Outstanding issues

In order to merge the following issues should be addressed:

  • Hardcoded file path in tests directory should be reconsidered.
  • Check that the computed and reference outputs correspond
  • Encapsulate the above steps in pytest (executing the code shouldn't be separate).
  • Fix runtime (reproducibility) tests now that files have been renamed.
  • Consider reducing the dataset size and hosting on zenodo. Pull a sample of data to allow pipeline to proceed from end to end (albeit inaccurately).
  • rebase

@ma595 ma595 marked this pull request as draft September 17, 2024 17:43
@ma595 ma595 changed the title Add automated tests [WIP] Add automated tests Sep 17, 2024
@ma595
Copy link
Collaborator Author

ma595 commented Sep 17, 2024

Copying over Tom's comment here:

#45 (comment)

Discussed idea of generating idealized test case for integration test. Not necessarily physically meaningful but something that uses the code in a realistic manner.

@dsgoll123 will make a new small training set for new version ORCHIDEE

@dorchard dorchard added the iccs label Nov 5, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants