Skip to content

test: cleanup resources in test_deploy_vm_iso, use base class tearDown#13136

Open
DaanHoogland wants to merge 2 commits intomainfrom
cleanup-test-deploy-vm-iso-resources
Open

test: cleanup resources in test_deploy_vm_iso, use base class tearDown#13136
DaanHoogland wants to merge 2 commits intomainfrom
cleanup-test-deploy-vm-iso-resources

Conversation

@DaanHoogland
Copy link
Copy Markdown
Contributor

The test was creating an ISO and a VirtualMachine without adding them to self.cleanup, so they were never deleted after each test run.

  • Add iso and virtual_machine to self.cleanup (using append) so the base-class tearDown deletes them after each test.
  • Remove the explicit tearDown override — the base class cloudstackTestCase.tearDown already calls cleanup_resources(self.apiclient, reversed(self.cleanup)).
  • Remove the explicit tearDownClass override — the base class cloudstackTestCase.tearDownClass already handles cls._cleanup for both the apiclient and api_client attribute names.
  • Rename cls.api_client → cls.apiclient in setUpClass so the base-class tearDownClass can find the client.
  • Remove the now-unused cleanup_resources import from marvin.lib.utils.

Relates to #3693

Description

This PR...

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

Bug Severity

  • BLOCKER
  • Critical
  • Major
  • Minor
  • Trivial

Screenshots (if appropriate):

How Has This Been Tested?

How did you try to break this feature and the system with this change?

@boring-cyborg boring-cyborg Bot added component:integration-test Python Warning... Python code Ahead! labels May 8, 2026
@codecov
Copy link
Copy Markdown

codecov Bot commented May 8, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 18.09%. Comparing base (72b99a3) to head (10a0404).
⚠️ Report is 9 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff            @@
##               main   #13136   +/-   ##
=========================================
  Coverage     18.08%   18.09%           
- Complexity    16718    16721    +3     
=========================================
  Files          6037     6037           
  Lines        542546   542546           
  Branches      66432    66432           
=========================================
+ Hits          98146    98157   +11     
+ Misses       433378   433368   -10     
+ Partials      11022    11021    -1     
Flag Coverage Δ
uitests 3.51% <ø> (ø)
unittests 19.25% <ø> (+<0.01%) ⬆️

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.

Copy link
Copy Markdown
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 aims to ensure test_deploy_vm_iso properly cleans up created resources by relying on the base cloudstackTestCase tearDown/tearDownClass cleanup mechanisms, so test runs don’t leak ISOs/VMs/accounts into the environment.

Changes:

  • Remove the test-specific tearDown/tearDownClass and rely on cloudstackTestCase cleanup handling.
  • Standardize the class client attribute name to cls.apiclient so base-class cleanup can find it.
  • Add newly created resources (ISO, VM) to self.cleanup so they’re deleted after each test.

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

Comment thread test/integration/smoke/test_deploy_vm_iso.py Outdated
Comment thread test/integration/smoke/test_deploy_vm_iso.py
Comment thread test/integration/smoke/test_deploy_vm_iso.py Outdated
Comment thread test/integration/smoke/test_deploy_vm_iso.py
@DaanHoogland DaanHoogland force-pushed the cleanup-test-deploy-vm-iso-resources branch from 3a234d8 to acf78ab Compare May 8, 2026 13:52
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
@apache apache deleted a comment from blueorangutan May 8, 2026
@apache apache deleted a comment from blueorangutan May 8, 2026
@DaanHoogland
Copy link
Copy Markdown
Contributor Author

@blueorangutan package

@blueorangutan
Copy link
Copy Markdown

@DaanHoogland a [SL] Jenkins job has been kicked to build packages. It will be bundled with no SystemVM templates. I'll keep you posted as I make progress.

@blueorangutan
Copy link
Copy Markdown

Packaging result [SF]: ✔️ el8 ✔️ el9 ✔️ el10 ✔️ debian ✔️ suse15. SL-JID 17789

@sonarqubecloud
Copy link
Copy Markdown

sonarqubecloud Bot commented May 8, 2026

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.

3 participants