Skip to content

Conversation

@slavkap
Copy link
Contributor

@slavkap slavkap commented Sep 29, 2025

Description

Added few more tests scenarios and refactoring

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)
  • Cleanup (Code refactoring and cleanup, that may add test cases)
  • Build/CI
  • Test (unit or integration test code)

Feature/Enhancement Scale or Bug Severity

Feature/Enhancement Scale

  • Major
  • Minor

How Has This Been Tested?

ran the smoke tests

@boring-cyborg boring-cyborg bot added component:integration-test Python Warning... Python code Ahead! labels Sep 29, 2025
@codecov
Copy link

codecov bot commented Sep 29, 2025

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 17.60%. Comparing base (9dee137) to head (4028c0b).
⚠️ Report is 25 commits behind head on 4.22.

Additional details and impacted files
@@             Coverage Diff              @@
##              4.22   #11748       +/-   ##
============================================
+ Coverage     3.60%   17.60%   +13.99%     
- Complexity       0    15615    +15615     
============================================
  Files          445     5911     +5466     
  Lines        37628   530126   +492498     
  Branches      6947    64781    +57834     
============================================
+ Hits          1356    93304    +91948     
- Misses       36106   426319   +390213     
- Partials       166    10503    +10337     
Flag Coverage Δ
uitests 3.60% <ø> (+<0.01%) ⬆️
unittests 18.66% <ø> (?)

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@harikrishna-patnala harikrishna-patnala added this to the 4.22.0 milestone Sep 30, 2025
@harikrishna-patnala
Copy link
Contributor

@blueorangutan package

@blueorangutan
Copy link

@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.

@blueorangutan
Copy link

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)
Copy link
Contributor

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?

Copy link
Contributor

Choose a reason for hiding this comment

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

@slavkap per test items should go in the cleanup list not in the _cleanup list.

Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
self._cleanup.append(snapshot)
self.cleanup.append(snapshot)

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@DaanHoogland, the cleanup is left on purpose for the class because there is a required time.sleep() and I don't want to delay the tests execution with invoking it in each test case

@vishesh92 vishesh92 requested a review from Copilot October 10, 2025 07:42
@vishesh92 vishesh92 self-assigned this Oct 10, 2025
Copy link
Contributor

Copilot AI left a 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.

"displaytext": "Disk offering with tags",
"disksize":8,
"tags": "test-vm"
"tags": cls.zone_wide_storage.tags
Copy link

Copilot AI Oct 10, 2025

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.
Copy link
Member

@vishesh92 vishesh92 left a 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.

@rajujith
Copy link

@slavkap Since this is for the 4.22.1 release, could you retarget the PR to the 4.22 branch?

@DaanHoogland DaanHoogland changed the base branch from main to 4.22 January 12, 2026 09:35
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 3 out of 3 changed files in this pull request and generated 9 comments.


💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment on lines 327 to 330
)
self._cleanup.append(virtual_machine)
try:
ssh_client = virtual_machine.get_ssh_client()
Copy link

Copilot AI Jan 28, 2026

Choose a reason for hiding this comment

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

This helper adds the created VM to self._cleanup (class-level), which defers deletion until tearDownClass. Given this class already uses self.cleanup in tearDown() for test-scoped resources, consider using self.cleanup here too so each test cleans up its own VM and doesn't leave extra VMs around for subsequent tests in the same class.

Copilot uses AI. Check for mistakes.

@skipTestIf("testsNotSupported")
@attr(tags=["devcloud", "advanced", "advancedns", "smoke", "basic", "sg"], required_hardware="false")
def test_07_take_snapshot_multi_zone_deply_vm_additional_zone(self):
Copy link

Copilot AI Jan 28, 2026

Choose a reason for hiding this comment

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

test_07_take_snapshot_multi_zone_deply_vm_additional_zone has a typo in the test name ("deply" -> "deploy"). This makes the test name harder to search/understand and is inconsistent with the other test names in this file.

Suggested change
def test_07_take_snapshot_multi_zone_deply_vm_additional_zone(self):
def test_07_take_snapshot_multi_zone_deploy_vm_additional_zone(self):

Copilot uses AI. Check for mistakes.
Comment on lines +984 to +988
logging.debug("new list %s" % new_list)
logging.debug("zone IDs %s" % zone_ids)
logging.debug("snapshot entries %s" % snapshot_entries)
if len(new_list) != len(zone_ids):
cls.fail("Undesired list snapshot size for multiple zones")
raise Exception("Undesired list snapshot size for multiple zones")
Copy link

Copilot AI Jan 28, 2026

Choose a reason for hiding this comment

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

StorPoolHelper.verify_snapshot_copies now raises exceptions for some failure cases, but it still calls cls.fail(...) earlier in the method when Snapshot.list doesn't return a list. Since StorPoolHelper is not a unittest.TestCase, cls.fail is not defined and that path will raise AttributeError instead of a clear test failure. Replace that remaining cls.fail usage with an exception/AssertionError for consistency and correct error reporting.

Copilot uses AI. Check for mistakes.
Comment on lines 309 to 312
)
self._cleanup.append(virtual_machine)
try:
ssh_client = virtual_machine.get_ssh_client()
Copy link

Copilot AI Jan 28, 2026

Choose a reason for hiding this comment

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

This helper appends the created VM to self._cleanup (class-level), so it won't be deleted until tearDownClass. Since this test class already uses self.cleanup + tearDown() for per-test cleanup, consider adding the VM to self.cleanup instead to avoid accumulating running VMs across tests (unless you intentionally need the VM to persist across multiple test cases).

Copilot uses AI. Check for mistakes.
)
self._cleanup.append(virtual_machine)
try:
ssh_client = virtual_machine.get_ssh_client()
Copy link

Copilot AI Jan 28, 2026

Choose a reason for hiding this comment

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

Variable ssh_client is not used.

Copilot uses AI. Check for mistakes.
self.cleanup.append(self.virtual_machine)
try:
ssh_client = virtual_machine.get_ssh_client()
ssh_client = self.virtual_machine.get_ssh_client()
Copy link

Copilot AI Jan 28, 2026

Choose a reason for hiding this comment

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

Variable ssh_client is not used.

Copilot uses AI. Check for mistakes.
self.cleanup.append(self.virtual_machine)
try:
ssh_client = virtual_machine.get_ssh_client()
ssh_client = self.virtual_machine.get_ssh_client()
Copy link

Copilot AI Jan 28, 2026

Choose a reason for hiding this comment

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

Variable ssh_client is not used.

Copilot uses AI. Check for mistakes.
"""

snapshot = Snapshot.create(self.userapiclient,volume_id=self.volume.id, zoneids=[str(self.additional_zone.id)], usestoragereplication=True)
self._cleanup.append(snapshot)
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
self._cleanup.append(snapshot)
self.cleanup.append(snapshot)

"""

snapshot = Snapshot.create(self.userapiclient, volume_id=self.volume.id, zoneids=[str(self.additional_zone.id)], usestoragereplication=True)
self._cleanup.append(snapshot)
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
self._cleanup.append(snapshot)
self.cleanup.append(snapshot)

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@DaanHoogland, the cleanup is left on purpose for the class because there is a required time.sleep() and I don't want to delay the tests execution with invoking it in each test case

Copy link
Contributor

Choose a reason for hiding this comment

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

but the creation does need to happen in the test?
seems strangely asymmetrical and I would have to think if my mind can handle this… ;)

Copy link
Contributor

Choose a reason for hiding this comment

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

btw, if it is really needed please leave a don’t-do-this-at-home warning with it?

"""

snapshot = Snapshot.create(self.userapiclient, volume_id=self.volume.id)
self._cleanup.append(snapshot)
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
self._cleanup.append(snapshot)
self.cleanup.append(snapshot)

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)
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
self._cleanup.append(snapshot)
self.cleanup.append(snapshot)

service
)
self.cleanup.append(self.disk_offering)
self._cleanup.append(self.disk_offering)
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
self._cleanup.append(self.disk_offering)
self.cleanup.append(self.disk_offering)

"""Test to take volume snapshot in multiple StorPool primary storages in diff zones and create a volume in one of the additional zones
"""
snapshot = Snapshot.create(self.userapiclient, volume_id=self.volume.id, zoneids=[str(self.additional_zone.id)], usestoragereplication=True)
self._cleanup.append(snapshot)
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
self._cleanup.append(snapshot)
self.cleanup.append(snapshot)

volumeid=volume.id,
mode="basic",
)
self._cleanup.append(virtual_machine)
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
self._cleanup.append(virtual_machine)
self.cleanup.append(virtual_machine)

snapshotid=snapshot.id,
mode="basic",
)
self._cleanup.append(virtual_machine)
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
self._cleanup.append(virtual_machine)
self.cleanup.append(virtual_machine)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

component:integration-test Python Warning... Python code Ahead!

Projects

Status: In Progress

Development

Successfully merging this pull request may close these issues.

6 participants