Skip to content

test(plugins): cover duplicate plugin identifier diagnostics #2168 - #2481

Open
Rakshak05 wants to merge 3 commits into
utksh1:mainfrom
Rakshak05:issue-#2168
Open

test(plugins): cover duplicate plugin identifier diagnostics #2168#2481
Rakshak05 wants to merge 3 commits into
utksh1:mainfrom
Rakshak05:issue-#2168

Conversation

@Rakshak05

Copy link
Copy Markdown
Contributor

Description

Added loader diagnostics and automated test coverage for handling duplicate plugin identifiers during plugin loading:

  • Updated PluginManager in backend/secuscan/plugins.py to maintain a plugin_locations mapping of loaded plugin IDs to directory paths.
  • Added duplicate ID detection in load_plugins() that emits an error log identifying both conflicting plugin directory locations when a duplicate ID is encountered.
  • Preserved existing safe behavior by skipping the duplicate plugin rather than silently overwriting the already-registered plugin.
  • Added unit test test_plugin_loader_duplicate_identifier_diagnostics in testing/backend/unit/test_plugins.py to verify that both conflicting locations are captured in error diagnostics.

Related Issues

Fixes #2168

Type of Change

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • Documentation update

How Has This Been Tested?

Executed the affected backend unit test suite using pytest:

python -m pytest testing/backend/unit/test_plugins.py testing/backend/unit/test_plugins_validation.py testing/backend/unit/test_plugin_integrity.py

Result: 46 passed in 2.05s (all tests passed cleanly).

Checklist

  • My code follows the code style of this project.
  • I have performed a self-review of my own code.
  • I have commented my code, particularly in hard-to-understand areas.
  • I have made corresponding changes to the documentation.
  • My changes generate no new warnings.

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

test(plugins): cover duplicate plugin identifier diagnostics

1 participant