cloudstack
cloudstack copied to clipboard
Refactor of Allocator classes
Description
This PR refactors some *Allocator classes, improving modularity and code legibility. This PR also made some changes to logs across these classes.
Types of changes
- [ ] Breaking change (fix or feature that would cause existing functionality to change)
- [ ] New feature (non-breaking change which adds functionality)
- [ ] Bug fix (non-breaking change which fixes an issue)
- [ ] Enhancement (improves an existing feature and functionality)
- [x] Cleanup (Code refactoring and cleanup, that may add test cases)
- [ ] build/CI
Feature/Enhancement Scale or Bug Severity
Feature/Enhancement Scale
- [ ] Major
- [x] Minor
How Has This Been Tested?
I tested the allocation process in my personal lab, using both the RandomAllocator and FirstFitAllocator allocators. I tried some variation of tags and offerings, and everything looks good. Furthermore, I also added a lot of unit tests for the methods that I refactored.
How did you try to break this feature and the system with this change?
Codecov Report
Attention: Patch coverage is 68.89764% with 79 lines in your changes missing coverage. Please review.
Project coverage is 15.85%. Comparing base (
1d4700a) to head (b93e998).
Additional details and impacted files
@@ Coverage Diff @@
## main #9074 +/- ##
============================================
+ Coverage 15.81% 15.85% +0.04%
- Complexity 12554 12601 +47
============================================
Files 5629 5630 +1
Lines 492029 491963 -66
Branches 62293 63884 +1591
============================================
+ Hits 77811 77999 +188
+ Misses 405894 405642 -252
+ Partials 8324 8322 -2
| Flag | Coverage Δ | |
|---|---|---|
| uitests | 4.48% <ø> (ø) |
|
| unittests | 16.64% <68.89%> (+0.04%) |
:arrow_up: |
Flags with carried forward coverage won't be shown. Click here to find out more.
:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.
This pull request has merge conflicts. Dear author, please fix the conflicts and sync your branch with the base branch.
This pull request has merge conflicts. Dear author, please fix the conflicts and sync your branch with the base branch.
@blueorangutan package
@DaanHoogland a [SL] Jenkins job has been kicked to build packages. It will be bundled with KVM, XenServer and VMware SystemVM templates. I'll keep you posted as I make progress.
Packaging result [SF]: ✔️ el8 ✔️ el9 ✔️ debian ✔️ suse15. SL-JID 10801
@blueorangutan LLtest
@DaanHoogland a [LL] Trillian-Jenkins test job (centos7 mgmt + kvm-centos7) has been kicked to run smoke tests
@DaanHoogland a [LL] Trillian-Jenkins test job (centos7 mgmt + kvm-centos7) has been kicked to run smoke tests
@DaanHoogland, could you trigger the smoke tests again? They never reported the results back for this one.
@blueorangutan package
@DaanHoogland a [SL] Jenkins job has been kicked to build packages. It will be bundled with KVM, XenServer and VMware SystemVM templates. I'll keep you posted as I make progress.
Packaging result [SF]: ✔️ el8 ✔️ el9 ✔️ debian ✔️ suse15. SL-JID 11039
@blueorangutan test
@DaanHoogland a [SL] Trillian-Jenkins test job (ol8 mgmt + kvm-ol8) has been kicked to run smoke tests
[SF] Trillian test result (tid-11424) Environment: kvm-ol8 (x2), Advanced Networking with Mgmt server ol8 Total time taken: 56478 seconds Marvin logs: https://github.com/blueorangutan/acs-prs/releases/download/trillian/pr9074-t11424-kvm-ol8.zip Smoke tests completed. 138 look OK, 3 have errors, 0 did not run Only failed and skipped tests results shown below:
| Test | Result | Time (s) | Test File |
|---|---|---|---|
| test_01_isolate_network_FW_PF_default_routes_egress_true | Failure |
110.59 | test_routers_network_ops.py |
| test_02_restore_vm_strict_tags_failure | Failure |
58.19 | test_vm_strict_host_tags.py |
| test_02_scale_vm_strict_tags_failure | Failure |
60.31 | test_vm_strict_host_tags.py |
| test_06_deploy_vm_on_any_host_with_strict_tags_failure | Failure |
5.54 | test_vm_strict_host_tags.py |
| test_hostha_enable_ha_when_host_disabled | Error |
3.93 | test_hostha_kvm.py |
| test_hostha_enable_ha_when_host_in_maintenance | Error |
302.07 | test_hostha_kvm.py |
@blueorangutan package
@BryanMLima a [SL] Jenkins job has been kicked to build packages. It will be bundled with KVM, XenServer and VMware SystemVM templates. I'll keep you posted as I make progress.
@DaanHoogland, could you trigger the smoke tests again? The failed tests in test_vm_strict_host_tags.py were related to the exception message, it should be fixed now. The others do not seem to be related to this PR.
Packaging result [SF]: ✔️ el8 ✔️ el9 ✔️ debian ✔️ suse15. SL-JID 11082
@blueorangutan test
@DaanHoogland a [SL] Trillian-Jenkins test job (ol8 mgmt + kvm-ol8) has been kicked to run smoke tests
[SF] Trillian test result (tid-11448) Environment: kvm-ol8 (x2), Advanced Networking with Mgmt server ol8 Total time taken: 51366 seconds Marvin logs: https://github.com/blueorangutan/acs-prs/releases/download/trillian/pr9074-t11448-kvm-ol8.zip Smoke tests completed. 140 look OK, 1 have errors, 0 did not run Only failed and skipped tests results shown below:
| Test | Result | Time (s) | Test File |
|---|---|---|---|
| test_02_restore_vm_strict_tags_failure | Failure |
52.04 | test_vm_strict_host_tags.py |
| test_02_scale_vm_strict_tags_failure | Failure |
55.24 | test_vm_strict_host_tags.py |
@blueorangutan package
@BryanMLima a [SL] Jenkins job has been kicked to build packages. It will be bundled with KVM, XenServer and VMware SystemVM templates. I'll keep you posted as I make progress.
Packaging result [SF]: ✔️ el8 ✔️ el9 ✔️ debian ✔️ suse15. SL-JID 11121