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

codecov bot commented Sep 29, 2025

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 3.61%. Comparing base (9cc88b8) to head (c90c4b8).

❗ There is a different number of reports uploaded between BASE (9cc88b8) and HEAD (c90c4b8). Click for more details.

HEAD has 1 upload less than BASE
Flag BASE (9cc88b8) HEAD (c90c4b8)
unittests 1 0
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     
Flag Coverage Δ
uitests 3.61% <ø> (ø)
unittests ?

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?

time.sleep(420)
Snapshot.delete(snapshot, self.userapiclient)
self._cleanup.append(self.volume)
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.

why is this added at this point?

Comment on lines 167 to +169
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)
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.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)
Copy link
Contributor

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

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)
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)

maybe?

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)

?
(as it is an operation on self and not on cls)

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

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

cls.apiclient,
cls.services["service_offerings"]["small"],
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.

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

Comment on lines +116 to +118
td = TestData()
cls.testdata = td.testdata
cls.helper = StorPoolHelper()
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.

Duplicate instantiation of StorPoolHelper() and TestData(). Line 113 already creates cls.helper = StorPoolHelper(), and these lines recreate the same objects unnecessarily.

Suggested change
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)
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.

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.

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.

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

None yet

Development

Successfully merging this pull request may close these issues.

5 participants