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

fix(rescue_instance): added tests #636

Merged
merged 11 commits into from
Dec 3, 2024
Merged

fix(rescue_instance): added tests #636

merged 11 commits into from
Dec 3, 2024

Conversation

qqmok
Copy link
Contributor

@qqmok qqmok commented Nov 13, 2024

@dweinholz

Try to fulfill the following points before the Pull Request is merged:

  • The PR is reviewed by one of the team members.
  • If a linting PR exists, it must be merged before this PR is allowed to be merged.
  • If the PR is merged in the master then a release should be be made.
  • If the new code is readable, if not it should be well commented

For releases only:

  • If the review of this PR is approved and the PR is followed by a release then the .env file
    in the cloud-portal repo should also be updated.
  • If you are making a release then please sum up the changes since the last release on the release page using the clog tool with clog -F

@qqmok qqmok requested review from dweinholz and vktrrdk November 13, 2024 06:58
Copy link
Contributor

github-actions bot commented Nov 13, 2024

Coverage

Coverage Report
FileStmtsMissCoverMissing
simple_vm_client
   VirtualMachineHandler.py1981515 92%
   __init__.py10100% 
   test_virtualmachinehandler.py3030100% 
simple_vm_client/benchmark
   __init__.py00100% 
   test_service.py523636 31%
simple_vm_client/bibigrid_connector
   __init__.py00100% 
   bibigrid_connector.py11855 96%
   test_bibigrid_connector.py1730100% 
simple_vm_client/forc_connector
   __init__.py00100% 
   forc_connector.py25244 98%
simple_vm_client/forc_connector/playbook
   __init__.py00100% 
   playbook.py1910100% 
   test_playbook.py3810100% 
simple_vm_client/forc_connector/template
   __init__.py00100% 
   template.py19511 99%
simple_vm_client/metadata_connector
   metadata_connector.py887171 19%
simple_vm_client/openstack_connector
   __init__.py00100% 
   openstack_connector.py932121121 87%
simple_vm_client/util
   __init__.py00100% 
   state_enums.py690100% 
   test_thrift_converter.py1700100% 
   thrift_converter.py801414 82%
TOTAL320326792% 

Tests Skipped Failures Errors Time
306 0 💤 0 ❌ 0 🔥 4.822s ⏱️

Copy link
Contributor

@dweinholz dweinholz left a comment

Choose a reason for hiding this comment

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

When running the tests via:
python3-coverage run -m unittest discover -s .

All rescue tests are failing

@vktrrdk
Copy link
Member

vktrrdk commented Nov 26, 2024

One coverage test is still failing:

2024-11-26 08:24:08,678 - Clearing traces of Playbook-VM for (openstack_id): c
....F..................2024-11-26 08:24:08 - [ERROR] - [/home/ubuntu/code/simplevm-client/simple_vm_client/util/thrift_converter.py:os_to_thrift_volume:74] - Exception on os_to_thrift_volume:
string indices must be integers
2024-11-26 08:24:08,855 - Exception on os_to_thrift_volume:
string indices must be integers
.......

FAIL: test_rescue_server (simple_vm_client.test_virtualmachinehandler.TestVirtualMachineHandler)

Traceback (most recent call last):
File "/home/ubuntu/code/simplevm-client/simple_vm_client/test_virtualmachinehandler.py", line 168, in test_rescue_server
self.handler.openstack_connector.rescue_server.assert_called_once_with(
File "/usr/lib/python3.10/unittest/mock.py", line 941, in assert_called_once_with
return self.assert_called_with(*args, **kwargs)
File "/usr/lib/python3.10/unittest/mock.py", line 929, in assert_called_with
raise AssertionError(_error_message()) from cause
AssertionError: expected call not found.
Expected: rescue_server(openstack_id='vm_id')
Actual: rescue_server(openstack_id='vm_id', admin_pass=None, image_ref=None)


Ran 306 tests in 3.103s

FAILED (failures=1)

@qqmok
Copy link
Contributor Author

qqmok commented Nov 26, 2024

One coverage test is still failing:

2024-11-26 08:24:08,678 - Clearing traces of Playbook-VM for (openstack_id): c

....F..................2024-11-26 08:24:08 - [ERROR] - [/home/ubuntu/code/simplevm-client/simple_vm_client/util/thrift_converter.py:os_to_thrift_volume:74] - Exception on os_to_thrift_volume:
string indices must be integers
2024-11-26 08:24:08,855 - Exception on os_to_thrift_volume:
string indices must be integers
.......

FAIL: test_rescue_server (simple_vm_client.test_virtualmachinehandler.TestVirtualMachineHandler)

Traceback (most recent call last): File "/home/ubuntu/code/simplevm-client/simple_vm_client/test_virtualmachinehandler.py", line 168, in test_rescue_server self.handler.openstack_connector.rescue_server.assert_called_once_with( File "/usr/lib/python3.10/unittest/mock.py", line 941, in assert_called_once_with return self.assert_called_with(*args, **kwargs) File "/usr/lib/python3.10/unittest/mock.py", line 929, in assert_called_with raise AssertionError(_error_message()) from cause AssertionError: expected call not found. Expected: rescue_server(openstack_id='vm_id') Actual: rescue_server(openstack_id='vm_id', admin_pass=None, image_ref=None)

Ran 306 tests in 3.103s

FAILED (failures=1)

The test is now updated and functioning

@qqmok qqmok requested a review from dweinholz November 26, 2024 09:04
@dweinholz dweinholz merged commit d49c742 into dev Dec 3, 2024
@dweinholz dweinholz deleted the fix/rescue_tests branch December 3, 2024 08:18
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