Fix/plugins python package init#13137
Conversation
… packages The test/integration/plugins directory and its subdirectories were missing __init__.py files, preventing Python from treating them as packages. This caused local/relative imports to fail when running plugin tests in a deployed Marvin environment, making it impossible to modularize tests for plugins. Fixes #3679
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #13137 +/- ##
=========================================
Coverage 18.08% 18.09%
- Complexity 16718 16720 +2
=========================================
Files 6037 6037
Lines 542546 542546
Branches 66432 66432
=========================================
+ Hits 98146 98161 +15
+ Misses 433378 433364 -14
+ Partials 11022 11021 -1
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:
|
Completes fix for #3679 by adding Python package init files to all plugin test subdirectories: linstor, quota, scaleio, solidfire, storpool, tf
|
|
@blueorangutan package |
|
@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. |
|
Packaging result [SF]: ✔️ el8 ✔️ el9 ✔️ el10 ✔️ debian ✔️ suse15. SL-JID 17840 |
|
@weizhouapache @winterhazel , I don’t think this needs further testing. See any potential problems? |
@DaanHoogland do you have more details what the issue is ? |
it is an old issue with modularisation of integration tests: this makes it hard to use core functionality in test scripts for plugins |
There was a problem hiding this comment.
Pull request overview
This PR aims to make test/integration/plugins (and selected plugin subdirectories) proper Python packages by adding missing __init__.py files, aligning plugin test layout with existing smoke/component integration test packages.
Changes:
- Add
test/integration/plugins/__init__.pyto mark the plugins test directory as a package. - Add
__init__.pyfiles to multiple plugin subdirectories (e.g.,tf,ldap,storpool,solidfire, etc.) to enable package-style imports.
Reviewed changes
Copilot reviewed 9 out of 9 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
| test/integration/plugins/init.py | Marks plugins integration tests directory as a Python package. |
| test/integration/plugins/datera/init.py | Marks datera plugin tests folder as a package. |
| test/integration/plugins/ldap/init.py | Marks ldap plugin tests folder as a package (supports relative imports in tests). |
| test/integration/plugins/linstor/init.py | Marks linstor plugin tests folder as a package. |
| test/integration/plugins/quota/init.py | Marks quota plugin tests folder as a package. |
| test/integration/plugins/scaleio/init.py | Marks scaleio plugin tests folder as a package. |
| test/integration/plugins/solidfire/init.py | Marks solidfire plugin tests folder as a package. |
| test/integration/plugins/storpool/init.py | Marks storpool plugin tests folder as a package. |
| test/integration/plugins/tf/init.py | Marks tf plugin tests folder as a package (supports relative imports in tests). |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| # Licensed to the Apache Software Foundation (ASF) under one | ||
| # or more contributor license agreements. See the NOTICE file | ||
| # distributed with this work for additional information | ||
| # regarding copyright ownership. The ASF licenses this file | ||
| # to you under the Apache License, Version 2.0 (the | ||
| # "License"); you may not use this file except in compliance | ||
| # with the License. You may obtain a copy of the License at | ||
| # | ||
| # http://www.apache.org/licenses/LICENSE-2.0 | ||
| # | ||
| # Unless required by applicable law or agreed to in writing, | ||
| # software distributed under the License is distributed on an | ||
| # "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY | ||
| # KIND, either express or implied. See the License for the | ||
| # specific language governing permissions and limitations | ||
| # under the License. |
| # Licensed to the Apache Software Foundation (ASF) under one | ||
| # or more contributor license agreements. See the NOTICE file | ||
| # distributed with this work for additional information | ||
| # regarding copyright ownership. The ASF licenses this file | ||
| # to you under the Apache License, Version 2.0 (the |



Description
This PR...
Fixes: #3679
Types of changes
Feature/Enhancement Scale or Bug Severity
Feature/Enhancement Scale
Bug Severity
Screenshots (if appropriate):
How Has This Been Tested?
How did you try to break this feature and the system with this change?