Skip to content

test: add parser and contract coverage for plugin domain-finder#687

Open
anshul23102 wants to merge 7 commits into
utksh1:mainfrom
anshul23102:fix/496-domain_finder_plugin_tests
Open

test: add parser and contract coverage for plugin domain-finder#687
anshul23102 wants to merge 7 commits into
utksh1:mainfrom
anshul23102:fix/496-domain_finder_plugin_tests

Conversation

@anshul23102

Copy link
Copy Markdown
Contributor

Summary

Add comprehensive test coverage for the domain-finder plugin, validating metadata, command rendering, and parser functionality.

Issue

Closes #496 - Plugin domain-finder appears in the shipped catalog but lacks direct test coverage.

Scope

This PR adds test coverage for:

  • Metadata validation ensuring plugin configuration is correct
  • Command rendering via PluginManager for domain targets
  • Parser contract tests with domain discovery fixtures
  • Severity classification (info/low)
  • All tests pass under pytest testing/backend -q

Tests Added (22 tests total)

Metadata Contract Tests:

  • test_domain_finder_metadata_file_exists
  • test_domain_finder_metadata_is_valid_json
  • test_domain_finder_passes_validator
  • test_domain_finder_metadata_id_matches_directory
  • test_domain_finder_engine_is_amass
  • test_domain_finder_has_required_target_field
  • test_domain_finder_output_parser_is_custom
  • test_domain_finder_parser_file_exists

Command Rendering Tests:

  • test_domain_finder_command_renders_with_target
  • test_domain_finder_command_full_token_sequence
  • test_domain_finder_loaded_by_plugin_manager

Parser Contract Tests:

  • test_domain_finder_parser_returns_required_keys
  • test_domain_finder_parser_count_matches_findings
  • test_domain_finder_parser_finding_has_required_keys
  • test_domain_finder_parser_severity_classification
  • test_domain_finder_parser_empty_output
  • test_domain_finder_parser_preserves_raw_line_in_metadata

Type of Change

  • Testing
  • Plugin coverage

Related Issues

Closes #496


This contribution is part of GSSoC 2026.

- Add metadata validation tests for katana plugin
- Add command rendering tests via PluginManager
- Add parser contract tests with realistic fixtures
- Verify plugin loads correctly through plugin system
- Ensure parser handles severity classification
- Validate empty output and raw line preservation

Closes utksh1#501
- Add metadata validation tests for iac_scanner plugin
- Add command rendering tests via PluginManager
- Add parser contract tests with realistic fixtures
- Verify plugin loads correctly through plugin system
- Ensure parser handles severity classification (info/low/high)
- Validate empty output and raw line preservation

Closes utksh1#500
- Add metadata validation tests for http_request_logger plugin
- Add command rendering tests via PluginManager
- Add parser contract tests with realistic fixtures
- Verify plugin loads correctly through plugin system
- Ensure parser handles severity classification (info/low/high)
- Validate empty output and raw line preservation

Closes utksh1#499
- Add metadata validation tests for domain-finder plugin
- Add command rendering tests via PluginManager
- Add parser contract tests with realistic fixtures
- Verify plugin loads correctly through plugin system
- Ensure parser handles severity classification
- Validate empty output and raw line preservation

Closes utksh1#496
@anshul23102

Copy link
Copy Markdown
Contributor Author

Label Request

This PR addresses issue #496, adding comprehensive test coverage for the domain-finder plugin. This is a high-value testing contribution for GSSoC 2026.

Could you please add the following labels when reviewed:

  • gssoc-approved (high-priority for GSSoC scoring)
  • type:testing (reflects the test coverage nature)
  • area:plugins (plugin-specific testing)

Thank you!

anshul23102 and others added 3 commits June 9, 2026 01:35
…ory name)

Domain-finder directory has a hyphen in its name, which Python's standard
import system cannot handle. Use importlib.util to load the parser module
directly from the file path instead.
@utksh1 utksh1 added level:intermediate 35 pts difficulty label for moderate contributor PRs type:testing Testing work category bonus label area:backend Backend API, database, or service work area:plugins Scanner plugin metadata, schemas, or plugin runtime work labels Jun 8, 2026

@utksh1 utksh1 left a comment

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

After #684 and #685 were merged, this stacked branch now conflicts with current main and still includes already-merged plugin-test files. Please rebase on main and keep only the domain-finder parser/contract coverage in this PR; remove katana/iac/http_request_logger changes that belong to earlier PRs. I can re-review after the effective diff is focused and CI is green.

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

Labels

area:backend Backend API, database, or service work area:plugins Scanner plugin metadata, schemas, or plugin runtime work level:intermediate 35 pts difficulty label for moderate contributor PRs type:testing Testing work category bonus label

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[TEST] Add parser and contract coverage for plugin domain-finder

2 participants