-
Notifications
You must be signed in to change notification settings - Fork 104
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
Add unit tests for cookbook EBS related scripts #2445
Conversation
cookbooks/aws-parallelcluster-environment/files/default/ec2_udev_rules/ec2_dev_2_volid.py
Outdated
Show resolved
Hide resolved
cookbooks/aws-parallelcluster-environment/files/default/ec2_udev_rules/ec2_dev_2_volid.py
Outdated
Show resolved
Hide resolved
cookbooks/aws-parallelcluster-environment/files/default/ec2_udev_rules/manageVolume.py
Outdated
Show resolved
Hide resolved
return dev | ||
|
||
|
||
def parse_proxy_config(): |
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.
Are we not testing this function?
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 decided not to test this function because it seemed to just be calling lots of other functions without much logic in that function itself. Let me know if you think I should test this too though!
Codecov ReportPatch coverage:
Additional details and impacted files@@ Coverage Diff @@
## develop #2445 +/- ##
===========================================
+ Coverage 70.49% 76.01% +5.51%
===========================================
Files 13 13
Lines 1864 1876 +12
===========================================
+ Hits 1314 1426 +112
+ Misses 550 450 -100
Flags with carried forward coverage won't be shown. Click here to find out more.
☔ View full report in Codecov by Sentry. |
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.
In general it's useful to split this kind of changes in multiple small commits, e.g.:
- create parse_proxy_config function
- create get_device_volume_id
- fix typo in manageVolume function
- add unit tests for xxx function
This simplifies the review.
Instead you should fixup the second commit you created, this doesn't have any meaning by itself, it's a fix of the previous commit so they should be merged together. See https://www.jetbrains.com/idea/guide/tips/interactive-rebase/
Anyway you did a great job, you can see here how your patch is increasing the coverage of about 6%.
cookbooks/aws-parallelcluster-environment/files/default/ec2_udev_rules/ec2_dev_2_volid.py
Outdated
Show resolved
Hide resolved
cookbooks/aws-parallelcluster-environment/files/default/ec2_udev_rules/ec2_dev_2_volid.py
Outdated
Show resolved
Hide resolved
cookbooks/aws-parallelcluster-environment/files/default/ec2_udev_rules/ec2_dev_2_volid.py
Outdated
Show resolved
Hide resolved
cookbooks/aws-parallelcluster-environment/files/default/ec2_udev_rules/ec2_dev_2_volid.py
Outdated
Show resolved
Hide resolved
cookbooks/aws-parallelcluster-environment/files/default/ec2_udev_rules/ec2_dev_2_volid.py
Outdated
Show resolved
Hide resolved
cookbooks/aws-parallelcluster-environment/files/default/ec2_udev_rules/ec2_volume.py
Outdated
Show resolved
Hide resolved
3ee0387
to
7afcf86
Compare
607f7d6
to
c29cf84
Compare
…eparated ec2_dev_2_volid main function into multiple functions, fixed typo in manageVolume Signed-off-by: Judy Ng <[email protected]>
…eparated ec2_dev_2_volid main function into multiple functions, fixed typo in manageVolume (aws#2445) Signed-off-by: Judy Ng <[email protected]>
Description of changes
Tests
Checklist
develop
add the branch name as prefix in the PR title (e.g.[release-3.6]
).By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.