-
-
Notifications
You must be signed in to change notification settings - Fork 1.2k
[tests] Improve unit test coverage for plugins #2866
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
Conversation
fd53ec0 to
d5b0ee1
Compare
d5b0ee1 to
51a614a
Compare
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## develop #2866 +/- ##
===========================================
+ Coverage 77.46% 78.04% +0.58%
===========================================
Files 48 48
Lines 6735 6809 +74
===========================================
+ Hits 5217 5314 +97
+ Misses 1518 1495 -23 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
51a614a to
35ac4f0
Compare
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 pull request enhances test coverage for the plugin system by adding comprehensive tests for plugin configuration loading and environment variable handling. It introduces a new test class to verify plugin configuration behavior and provides test utilities to simplify plugin testing.
- Added
TestPluginsConfigurationclass with tests covering configuration file loading and environment variable interactions - Introduced
registeredPluginscontext manager for streamlined plugin setup/teardown in tests - Created test configuration file to support plugin configuration testing scenarios
Reviewed Changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 5 comments.
| File | Description |
|---|---|
| tests/utils.py | Added registeredPlugins context manager and necessary imports for plugin testing utilities |
| tests/test_plugins.py | Added comprehensive plugin configuration tests and updated imports to use new utilities |
| tests/plugins/meshroom/config.json | Created test configuration file with sample plugin configuration data |
Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
Description
This pull request adds comprehensive tests for plugin configuration loading and environment variable handling in the plugin system. It introduces a new test class for verifying how plugin configuration files and environment variables interact, and adds a utility context manager to simplify plugin registration and cleanup during tests.
New plugin configuration tests:
TestPluginsConfigurationclass intests/test_plugins.pywith tests to verify that plugin configuration files are loaded correctly, and that environment variables override or coexist with config file values as expected. The tests cover scenarios with all, some, or none of the relevant environment variables set.Test utilities:
registeredPluginscontext manager intests/utils.pyto handle loading and cleanup of plugins from a test folder, streamlining the setup and teardown of plugin-related tests.tests/test_plugins.pyandtests/utils.pyto use the newregisteredPluginsutility and ensure necessary modules are available. [1] [2]