Skip to content

Commit d544e8a

Browse files
authored
test(plugins): comprehensive plugin system tests and improvements (#19)
* test(cortex-cli): add comprehensive tests for plugin_cmd.rs CLI commands * test(cortex-plugins): add comprehensive edge case tests Add tests covering: - Malformed manifests (empty ID, invalid semver, bad TOML syntax) - Invalid characters in plugin ID - Permission and hook execution edge cases - Hook priority ordering and abort/skip/continue behavior - Registry SSRF protection (private IPs, metadata endpoints) - Directory traversal protection - Plugin registration/unregistration lifecycle - Configuration edge cases (enable/disable, whitelist mode) - Error handling and display messages - Plugin state transitions - Remote registry management - Signing and checksum verification 59 tests pass covering error handling and boundary conditions. * test(cortex-plugins): add lifecycle tests and fix clippy warning - Add comprehensive lifecycle tests covering plugin discover → load → init → hook → shutdown flow - Add tests for PluginManager creation, discovery, loading, and lifecycle management - Add tests for WasmRuntime and WasmPlugin - Add tests for PluginConfig settings - Add tests for HookRegistry and HookDispatcher - Add tests for EventBus and event subscription - Add tests for PluginCommand and command registry - Fix clippy warning: replace vec![] with array for constant case list * test(cortex-plugins): add comprehensive integration tests for plugin system - Add integration tests for SDK code generation (manifest, Rust, Cargo.toml, TypeScript) - Add hook system integration tests (priority ordering, abort behavior, session hooks) - Add command registry tests (categories, aliases, execution with args) - Add plugin signing/checksum verification tests - Add plugin context builder tests - Add manifest parsing tests with all capabilities, WASM settings, dependencies, and hooks - Add error handling tests for all error variants - Add registry integration tests for plugin lifecycle Total test count: 274 tests (108 unit + 59 edge case + 78 lifecycle + 29 integration)
1 parent 5ca128d commit d544e8a

File tree

4 files changed

+5917
-0
lines changed

4 files changed

+5917
-0
lines changed

0 commit comments

Comments
 (0)