Skip to content

[WIP] Run tests as part of the CI process #89

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

Merged
merged 36 commits into from
Jan 20, 2025

Conversation

AdelekeBankole
Copy link
Collaborator

@AdelekeBankole AdelekeBankole commented Jan 9, 2025

On moving forward for the test suite in CAM-ML. This PR aims to run our tests as part of the continuous integration process.

@AdelekeBankole AdelekeBankole self-assigned this Jan 9, 2025
@AdelekeBankole AdelekeBankole marked this pull request as draft January 9, 2025 16:51
@AdelekeBankole AdelekeBankole removed the request for review from jatkinson1000 January 9, 2025 16:51
Copy link
Member

@jatkinson1000 jatkinson1000 left a comment

Choose a reason for hiding this comment

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

Hi @AdelekeBankole This is a good start and it is good to see it is running with GitHub CI!

There are a few things that I don't think we need here (I know I said to start with the FTorch CI as an example) that I have provided 'suggestions' to remove.

The next step I think is to define a series of steps to run the test suite as we would on a local machine. This will include:

  • Install any python dependencies
  • Generate the sounding files using python
  • Build the code using CMake
  • Run the test suites
  • Modify the test suites to return exit codes for success/failure

Let me know if you want me to take another look after further changes or have any queries.

AdelekeBankole and others added 4 commits January 13, 2025 23:06
Co-authored-by: Jack Atkinson <109271713+jatkinson1000@users.noreply.github.com>
Co-authored-by: Jack Atkinson <109271713+jatkinson1000@users.noreply.github.com>
Co-authored-by: Jack Atkinson <109271713+jatkinson1000@users.noreply.github.com>
Copy link
Member

@jatkinson1000 jatkinson1000 left a comment

Choose a reason for hiding this comment

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

I think the CI currently fails because it does not build the sounding in the correct location.
Try the suggestion below, and we can take a closer look this afternoon.

AdelekeBankole and others added 2 commits January 14, 2025 14:25
Co-authored-by: Jack Atkinson <109271713+jatkinson1000@users.noreply.github.com>
@jatkinson1000
Copy link
Member

@AdelekeBankole Looking at the latest failure on the test script it seems python netcdf cannot find the HDF5 library or something.
It may be that you need to install netcdf4 and/or HDF5 libraries to the CI runner as well.

@jatkinson1000
Copy link
Member

@AdelekeBankole Looks like the versions are too strict in the YOG/resources/requirements.txt
Perhaps remove the specifiers and see if things run OK.

Though note you may need to restrict numpy to <2.0 as I recall it had issues with the major version change and I do not know if they have been resolved yet.

@AdelekeBankole
Copy link
Collaborator Author

@AdelekeBankole Looks like the versions are too strict in the YOG/resources/requirements.txt Perhaps remove the specifiers and see if things run OK.

Though note you may need to restrict numpy to <2.0 as I recall it had issues with the major version change and I do not know if they have been resolved yet.

@jatkinson1000, you mean restricting it to >=3.7,<3.11 ?

@jatkinson1000
Copy link
Member

@AdelekeBankole I meant from the pip dependencies in the requirements.txt file - the workflow was complaining that it could not find the exact version of numpy.

See PR #90 to this branch that has a patch to do this.
This worked, but there were still issues (documented various places online) with running netcdf.save on GitHub CI so I uploaded the NetCDF file as an artifact to fix this.

I also added netCDF-Fortran that was missing from the dependencies.

My branch now builds the test suite so hopefully allows you to continue troubleshooting.

It is a binary, but unlikely to change and cannot be generated in the CI due to issues
with netcdf save in python requiring os.getlogin which doesn't work on
CI runners for some reason (similar issues can be found elsewhere).
Copy link
Member

@jatkinson1000 jatkinson1000 left a comment

Choose a reason for hiding this comment

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

That's looking good @AdelekeBankole !
Now you just need to un-break it ;)

A quick thought - did you also want to run the other test suite as well?

@AdelekeBankole AdelekeBankole marked this pull request as ready for review January 17, 2025 15:46
Copy link
Member

@jatkinson1000 jatkinson1000 left a comment

Choose a reason for hiding this comment

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

Hi @AdelekeBankole This all looks like good work to me and I have approved.

I have made one small suggestions regarding what I believe is an unnecessary python setup in the job that you might want to look at.
I'm happy for you to merge after checking this.

Co-authored-by: Jack Atkinson <109271713+jatkinson1000@users.noreply.github.com>
@AdelekeBankole AdelekeBankole merged commit a968db9 into main Jan 20, 2025
3 checks passed
@AdelekeBankole AdelekeBankole deleted the continuous_integration branch January 20, 2025 17:36
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.

2 participants