-
Notifications
You must be signed in to change notification settings - Fork 1
Add running the unittests to the GitHub workflow #321
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
base: main
Are you sure you want to change the base?
Conversation
mo-nikosbaltas
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Although the unit tests block is correct and works, my suggestion is:
Instead of:
eval "$(conda shell.bash hook)"
conda activate cmew
...
Use conda run:
conda run -n cmew cylc validate -O metoffice -O unittest .
This eliminates shell activation issues and is more reliable in Actions.
This also applies to other tests in this file.
As already said this is a suggestion.
- name: Run Cylc unit tests
run: |
cd CMEW
conda run -n cmew cylc vip -O metoffice -O unittest .
Although not applicable for this issue I would suggest to include some logging by adding at the end:
- name: Upload cylc-run logs on failure
if: failure()
uses: actions/upload-artifact@v4
with:
name: cylc-run-logs
path: ~/cylc-run
Otherwise it is all good for me.
|
The unit tests should read: not In my previous comment I was giving an example for 'cylc validate'. Sorry if I confused you. Also the checks failed when pushing. Can you correct? |
Made the changes and also added the logging. Working fine. |
mo-nikosbaltas
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Modify PR title to : #321: Add running the unittests to the GitHub workflow. See https://github.com/MetOffice/CMEW/wiki/Detailed-Working-Practices#create-a-pull-request
Done |
|
Also, @zmaalick can you change the copyright years (# (C) Crown Copyright 2022-2025, Met Office.) in the file to 2022-2026. |
Done |
mo-nikosbaltas
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
All looks good.
ehogan
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks @zmaalick 😊
The issue states "It may be worth configuring pytest so that it can be run from the GitHub workflow and via -O unittest without needing to change directories"; would it be possible for you to look into this, please? 👍
ehogan
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks @zmaalick! 🥳
ehogan
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks @zmaalick 🥳
The "end of new line" issue with one of the files in this branch suggests you have not set up the pre-commit hooks. Please set up the pre-commit hooks. Instructions are available at https://github.com/MetOffice/CMEW/wiki/First-time-developer-instructions#first-time-developer-instructions.
ehogan
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| # (C) Crown Copyright 2024-2025, Met Office. | ||
| # The LICENSE.md file contains full licensing details. | ||
| import os | ||
|
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please revert this change 😊
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This change still needs reverting 😊
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ehogan
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Almost there! 🤪
| # (C) Crown Copyright 2024-2025, Met Office. | ||
| # The LICENSE.md file contains full licensing details. | ||
| import os | ||
|
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This change still needs reverting 😊
| @@ -1,5 +1,5 @@ | |||
| #!/usr/bin/env python | |||
| # (C) Crown Copyright 2024-2025, Met Office. | |||
| # (C) Crown Copyright 2024-2026, Met Office. | |||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please revert this change (there are now no changes in this file, so the copyright doesn't need updating) 👍
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
mo-nikosbaltas
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks ok.
Closes #165 .
PR creation checklist for the developer
<issue_number>above ☝️ been replaced with the issue number?mainbeen selected as the base branch?<issue_number>_<short_description_of_feature>?good first issuelabel) been added to the PR?Climate Model Evaluation Workflow (CMEW)project been added to the PR?Definition of Done for the developer
docdirectory) related to the change been updated appropriately, including the Quick Start section?PR creation checklist for the reviewer
<issue_number>above ☝️ been replaced with the issue number?mainbeen selected as the base branch?<issue_number>_<short_description_of_feature>?good first issuelabel) been added to the PR?Climate Model Evaluation Workflow (CMEW)project been added to the PR?Definition of Done for the reviewer
docdirectory) related to the change been updated appropriately including the Quick Start section? N/A