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

Add unit tests for osmorphing module #298

Merged
merged 13 commits into from
Apr 25, 2024

Conversation

mihaelabalutoiu
Copy link
Contributor

@mihaelabalutoiu mihaelabalutoiu commented Mar 13, 2024

This PR adds unit testing for the following modules:

  • osmorphing/amazon.py
  • osmorphing/base.py
  • osmorphing/centos.py
  • osmorphing/coreos.py
  • osmorphing/debian.py
  • osmorphing/manager.py
  • osmorphing/openwrt.py
  • osmorphing/oracle.py
  • osmorphing/redhat.py
  • osmorphing/rocky.py
  • osmorphing/suse.py
  • osmorphing/ubuntu.py
  • osmorphing/windows.py

@mihaelabalutoiu mihaelabalutoiu force-pushed the add-osmorphing-unit-tests branch 2 times, most recently from 7e92245 to a6d7dec Compare March 29, 2024 15:05
Copy link
Contributor

@ionutbalutoiu ionutbalutoiu left a comment

Choose a reason for hiding this comment

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

Overall the test are great!

I have some small comments with unnecessary mocking.

coriolis/tests/osmorphing/test_amazon.py Outdated Show resolved Hide resolved
coriolis/tests/osmorphing/test_base.py Outdated Show resolved Hide resolved
coriolis/tests/osmorphing/test_base.py Outdated Show resolved Hide resolved
coriolis/tests/osmorphing/test_base.py Outdated Show resolved Hide resolved
coriolis/tests/osmorphing/test_base.py Outdated Show resolved Hide resolved
coriolis/tests/osmorphing/test_ubuntu.py Outdated Show resolved Hide resolved
coriolis/tests/osmorphing/test_ubuntu.py Outdated Show resolved Hide resolved
coriolis/tests/osmorphing/test_ubuntu.py Outdated Show resolved Hide resolved
coriolis/tests/osmorphing/test_ubuntu.py Outdated Show resolved Hide resolved
coriolis/tests/osmorphing/test_ubuntu.py Outdated Show resolved Hide resolved
@ionutbalutoiu
Copy link
Contributor

Finished reviewing this. Besides the tendency for unnecessary mocking in some few places, the unit tests are in great shape.

Good job!

@mihaelabalutoiu mihaelabalutoiu force-pushed the add-osmorphing-unit-tests branch 2 times, most recently from 5f12b2b to 2e840e7 Compare April 23, 2024 18:21
Copy link
Contributor Author

@mihaelabalutoiu mihaelabalutoiu left a comment

Choose a reason for hiding this comment

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

I updated the code, please take a look now. Thank you!

coriolis/tests/osmorphing/test_amazon.py Outdated Show resolved Hide resolved
coriolis/tests/osmorphing/test_base.py Outdated Show resolved Hide resolved
coriolis/tests/osmorphing/test_base.py Outdated Show resolved Hide resolved
coriolis/tests/osmorphing/test_manager.py Outdated Show resolved Hide resolved
coriolis/tests/osmorphing/test_manager.py Outdated Show resolved Hide resolved
coriolis/tests/osmorphing/test_redhat.py Outdated Show resolved Hide resolved
coriolis/tests/osmorphing/test_windows.py Show resolved Hide resolved
coriolis/tests/osmorphing/test_windows.py Outdated Show resolved Hide resolved
Copy link
Contributor

@ionutbalutoiu ionutbalutoiu left a comment

Choose a reason for hiding this comment

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

Some more comments about mocking.

coriolis/tests/osmorphing/test_base.py Outdated Show resolved Hide resolved
coriolis/tests/osmorphing/test_base.py Outdated Show resolved Hide resolved
coriolis/tests/osmorphing/test_windows.py Outdated Show resolved Hide resolved
coriolis/tests/osmorphing/test_windows.py Outdated Show resolved Hide resolved
Signed-off-by: Mihaela Balutoiu <mbalutoiu@cloudbasesolutions.com>
Signed-off-by: Mihaela Balutoiu <mbalutoiu@cloudbasesolutions.com>
Signed-off-by: Mihaela Balutoiu <mbalutoiu@cloudbasesolutions.com>
Signed-off-by: Mihaela Balutoiu <mbalutoiu@cloudbasesolutions.com>
Signed-off-by: Mihaela Balutoiu <mbalutoiu@cloudbasesolutions.com>
Signed-off-by: Mihaela Balutoiu <mbalutoiu@cloudbasesolutions.com>
Signed-off-by: Mihaela Balutoiu <mbalutoiu@cloudbasesolutions.com>
Signed-off-by: Mihaela Balutoiu <mbalutoiu@cloudbasesolutions.com>
Signed-off-by: Mihaela Balutoiu <mbalutoiu@cloudbasesolutions.com>
Signed-off-by: Mihaela Balutoiu <mbalutoiu@cloudbasesolutions.com>
Signed-off-by: Mihaela Balutoiu <mbalutoiu@cloudbasesolutions.com>
Signed-off-by: Mihaela Balutoiu <mbalutoiu@cloudbasesolutions.com>
Signed-off-by: Mihaela Balutoiu <mbalutoiu@cloudbasesolutions.com>
Copy link
Contributor Author

@mihaelabalutoiu mihaelabalutoiu left a comment

Choose a reason for hiding this comment

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

Done, I made the changes. Thank you!

coriolis/tests/osmorphing/test_base.py Outdated Show resolved Hide resolved
coriolis/tests/osmorphing/test_base.py Outdated Show resolved Hide resolved
coriolis/tests/osmorphing/test_windows.py Outdated Show resolved Hide resolved
Copy link
Contributor

@ionutbalutoiu ionutbalutoiu left a comment

Choose a reason for hiding this comment

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

LGTM

@Dany9966 Dany9966 merged commit b2041c5 into cloudbase:master Apr 25, 2024
4 checks passed
@mihaelabalutoiu mihaelabalutoiu deleted the add-osmorphing-unit-tests branch April 25, 2024 08:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants