-
Notifications
You must be signed in to change notification settings - Fork 12
Add tests for submitter and improve coverage ignoring pass/NotImplementedError #2604
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
Conversation
67bae16 to
9f71998
Compare
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #2604 +/- ##
==========================================
+ Coverage 65.86% 67.60% +1.74%
==========================================
Files 84 84
Lines 19697 19564 -133
Branches 3815 3809 -6
==========================================
+ Hits 12974 13227 +253
+ Misses 5771 5419 -352
+ Partials 952 918 -34
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
f370634 to
57169d1
Compare
550bd93 to
aa19601
Compare
|
Still need tests for |
|
Link to Codecov issue about not respecting ignored lines -- codecov/codecov-action#1326 |
aa19601 to
81addb4
Compare
|
@manuel-g-castro updated this one with more tests for Paramiko. Let's see if test-slurm passes 🤞 |
81addb4 to
9585f49
Compare
|
Rebased, triggering a new build as I think now it will succeed with the new slurm docker container 🤞 |
6989b8a to
540714e
Compare
|
Fixed the slurm errors, rebased, and added more tests today. Now slowly going through missing lines in ParamikoPlatform to have enough tests for 4.1.16 💪 |
540714e to
8dcc8ee
Compare
|
To check later why x11 didn't work in my local tests: #1321 (also check if wayland). Thanks @dbeltrankyl for the link & tip. |
|
Uploaded container to https://hub.docker.com/r/autosubmit/linuxserverio-ssh-2fa-x11. Now we have a small box to test SSH + 2FA + X11. Let's see if we can finally test this code without mocks... |
e710163 to
8d55153
Compare
9228769 to
fc8e424
Compare
|
@VindeeR , I've covered as much of the code in paramiko_plataform.py as I could. There are some lines in Once GH Actions build passes, this should be ready for review. There is a bunch of changes, but I think if you exclude the ones for coverage and linting, and the tests, that should leave you with just some parts of the code that were modified. |
VindeeR
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.
I learned a lot during this review, so many things I never knew I could implement the way you did, thanks for it 🙌
I've done a few comments but I have nothing major to point out, I believe everything to be working just fine, just asked a few things to understand better.
|
|
||
| def _get_serial_platforms(platforms_used: set[str], platforms_data: dict) -> dict[str, list]: | ||
| """Traverse used platforms and look for serial platforms.""" | ||
| serial_platforms = defaultdict(list) |
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.
The more you know, this kind of resource sounds really useful! Thanks ❤️
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.
It is! I also learn a lot (Python/shell/AS/pytest/etc.) reviewing code :slig
...ssh/linuxserverio-ssh-with-2fa-x11/rootfs/etc/s6-overlay/s6-rc.d/init-openssh-mfa-config/run
Show resolved
Hide resolved
| # FIXME: I thought this was supposed to be equal to the number of hetsize, | ||
| # and at some point during debugging it it; but then there is a call | ||
| # to other functions that reset it to just one hetjob. Looks like it | ||
| # might be better to create the job from the dictionary configuration, | ||
| # instead of trying to create the object here. |
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.
Sorry to nitpick but the message is a bit confusing at the beginning
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.
Will rewrite it! 💪 thanks for proof-reading it!
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.
Clarified a bit, or tried at least. Here's the updated text (incoming in some minutes in a new push).
# FIXME: I thought this was supposed to be equal to the number of hetsize
# components (2, set above), and at some point during debugging it is;
# but then there is a call to other functions somewhere that reset it
# to just one hetjob. Looks like it might be better to create the job
# from the dictionary configuration, instead of trying to create the
# object here (i.e. an integration test that loads everything from
# YAML configuration).
| submitter.load_platforms(as_conf, None, None) | ||
| assert len(submitter.platforms) == 2 | ||
|
|
||
| assert 'ecaccess' not in submitter.platforms |
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.
I'm a bit confused by this test, you're loading the platform from the config into the submitter plus the Paramiko, but the platform ecaccess is not within the submitter even though there are 2 platform there 😵💫
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.
I've updated the python documentation of that function. You should be able to review it in an updated commit that I'm pushing in 2 minutes, but here's the whole new text.
def test_ecplatform_fails_without_crashing(autosubmit_config):
"""Test that ecaccess platform is ignored when it does not have a version.
Not sure if it should fail without crashing the execution, but... the
current code silently ignores the platform.
Note that the configuration contains the ecaccess platform. And a job is
using it.
However, there is no version in the ecaccess platform. It needs a version
like PBS or Slurm platform, which will be used with/in conjunction (my
understanding of the platform).
In the end, the test verifies that there are two platforms loaded, which
are always present, even though it's a single platform, the local, aliased
as LOCAL (i.e. a dictionary with two entries to the same object, the local
platform object).
This code is quite confusing and error-prone, but having this test should
be a good starting point.
"""
I think this should be clearer. Thanks for reviewing that! I would probably have forgotten and struggled a bit to remember what I meant with that comment 🤣
|
I think once you do the update of the branch you can merge it with no problems, thanks for the hard work 🙌 |
fc8e424 to
0911de6
Compare
Thanks for the thorough review, @VindeeR ! Updated the comments replying/marking as resolved the ones I think were OK, and leaving the other ones which I updated something without resolving, so that you can have another look at them 🙂 It should be ready to review again once GH Actions pass. Cheers. |
0911de6 to
205055d
Compare
|
Rebased. |
VindeeR
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.
Changes look great thanks for having a look at them 👍
As part of #2428 there were some changes that are not entirely pertinent to that issue/PR, so I've moved them to this one. It includes ignores for coverage, tests (and making submitter easier to test), and linter errors + types.
Check List
CONTRIBUTING.md.pyproject.toml.CHANGELOG.mdif this is a change that can affect users.Closes #1234).