-
Notifications
You must be signed in to change notification settings - Fork 1.2k
refactoring a few smoke tests #11748
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
base: main
Are you sure you want to change the base?
Conversation
Codecov Report✅ All modified and coverable lines are covered by tests.
Additional details and impacted files@@ Coverage Diff @@
## main #11748 +/- ##
=============================================
- Coverage 17.50% 3.61% -13.90%
=============================================
Files 5894 442 -5452
Lines 526845 37259 -489586
Branches 64334 6838 -57496
=============================================
- Hits 92232 1347 -90885
+ Misses 424236 35748 -388488
+ Partials 10377 164 -10213
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:
|
@blueorangutan package |
@harikrishna-patnala 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 ✔️ el10 ✔️ debian ✔️ suse15. SL-JID 15229 |
Snapshot.delete(snapshot, self.userapiclient, self.zone.id) | ||
self.helper.verify_snapshot_copies(self.userapiclient, self.snapshot_id, [self.additional_zone.id]) | ||
self.cleanup.append(snapshot) | ||
self._cleanup.append(snapshot) |
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.
isn’t the snapshot to be removed from the cleanup list here?
time.sleep(420) | ||
Snapshot.delete(snapshot, self.userapiclient) | ||
self._cleanup.append(self.volume) | ||
self._cleanup.append(snapshot) |
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.
why is this added at this point?
self.snapshot_id = snapshot.id | ||
self.helper.verify_snapshot_copies(self.userapiclient, self.snapshot_id, [self.zone.id, self.additional_zone.id]) | ||
time.sleep(420) | ||
Snapshot.delete(snapshot, self.userapiclient) | ||
self._cleanup.append(snapshot) |
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.
self.snapshot_id = snapshot.id | |
self.helper.verify_snapshot_copies(self.userapiclient, self.snapshot_id, [self.zone.id, self.additional_zone.id]) | |
time.sleep(420) | |
Snapshot.delete(snapshot, self.userapiclient) | |
self._cleanup.append(snapshot) | |
self._cleanup.append(snapshot) | |
self.snapshot_id = snapshot.id | |
self.helper.verify_snapshot_copies(self.userapiclient, self.snapshot_id, [self.zone.id, self.additional_zone.id]) |
time.sleep(420) | ||
Snapshot.delete(snapshot, self.userapiclient) | ||
|
||
self._cleanup.append(snapshot) |
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.
this should move to just below the create
.
also, is the copy a separate entity and should it be in the cleanup list as well?
self.template = self.helper.create_snapshot_template(self.userapiclient, self.services, self.snapshot_id, self.additional_zone.id) | ||
if self.additional_zone.id != self.template.zoneid: | ||
self.fail("Template from snapshot not created in the additional zone") | ||
self._cleanup.append(snapshot) |
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.
this should move up a couple of lines to be just below the matching create
snapshotid=snapshot.id, | ||
mode="basic", | ||
) | ||
self._cleanup.append(virtual_machine) |
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.
self._cleanup.append(virtual_machine) | |
self.cleanup.append(virtual_machine) |
maybe?
volumeid=volume.id, | ||
mode="basic", | ||
) | ||
self._cleanup.append(virtual_machine) |
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.
self._cleanup.append(virtual_machine) | |
self.cleanup.append(virtual_machine) |
?
(as it is an operation on self and not on cls)
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.
Pull Request Overview
This PR refactors smoke tests by adding new test scenarios, improving cleanup management, and modifying storage pool configuration. The changes focus on improving test structure and adding coverage for virtual machine deployment scenarios with snapshots and volumes across multiple zones.
- Refactored storage pool tag handling to use existing tags instead of hardcoded values
- Added proper cleanup management by using
_cleanup
lists for resources - Added new test methods for VM deployment scenarios from snapshots and volumes
Reviewed Changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 4 comments.
File | Description |
---|---|
test/integration/smoke/test_vm_lifecycle_with_snapshot_or_volume.py | Refactored storage pool tag configuration and added VM cleanup management |
test/integration/plugins/storpool/test_snapshot_copy_on_primary_storage.py | Added new test methods, improved cleanup handling, and added utility methods for VM deployment |
test/integration/plugins/storpool/sp_util.py | Added new disk offering configuration and template definition with debug logging |
Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
cls.apiclient, | ||
cls.services["service_offerings"]["small"], | ||
tags="test-vm" | ||
tags=cls.zone_wide_storage.tags |
Copilot
AI
Oct 10, 2025
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.
Potential AttributeError if cls.zone_wide_storage.tags
is None or doesn't exist. The original hardcoded 'test-vm' string provided a safe fallback value.
Copilot uses AI. Check for mistakes.
"displaytext": "Disk offering with tags", | ||
"disksize":8, | ||
"tags": "test-vm" | ||
"tags": cls.zone_wide_storage.tags |
Copilot
AI
Oct 10, 2025
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.
Same potential AttributeError as above - cls.zone_wide_storage.tags
may not exist or could be None.
Copilot uses AI. Check for mistakes.
td = TestData() | ||
cls.testdata = td.testdata | ||
cls.helper = StorPoolHelper() |
Copilot
AI
Oct 10, 2025
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.
Duplicate instantiation of StorPoolHelper()
and TestData()
. Line 113 already creates cls.helper = StorPoolHelper()
, and these lines recreate the same objects unnecessarily.
td = TestData() | |
cls.testdata = td.testdata | |
cls.helper = StorPoolHelper() | |
cls.testdata = TestData().testdata |
Copilot uses AI. Check for mistakes.
Snapshot.delete(snapshot, self.userapiclient, self.zone.id) | ||
self.helper.verify_snapshot_copies(self.userapiclient, self.snapshot_id, [self.additional_zone.id]) | ||
self.cleanup.append(snapshot) | ||
self._cleanup.append(snapshot) |
Copilot
AI
Oct 10, 2025
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.
Incorrect cleanup attribute name. Should be self.cleanup
to match the pattern used elsewhere in the codebase (see line 235 where self._cleanup
is correctly used).
Copilot uses AI. Check for mistakes.
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.
Just reviewed the PR. Same comments as Daan.
Description
Added few more tests scenarios and refactoring
Types of changes
Feature/Enhancement Scale or Bug Severity
Feature/Enhancement Scale
How Has This Been Tested?
ran the smoke tests