Commit a028dae
docs: update testing strategy and plugin development workflows (#53)
* feat: add plugin scaffold generator
Implements an interactive plugin scaffold generator that creates complete
plugin structures from Jinja2 templates.
Features:
- Interactive CLI with prompts for plugin metadata
- Non-interactive mode for automation
- Generates all required files (Cargo.toml, pyproject.toml, Makefile, etc.)
- Creates Python package with type stubs
- Creates Rust source with PyO3 bindings
- Includes test scaffolding and optional benchmarks
- Automatically updates workspace Cargo.toml
- Validates plugin name and configuration
Usage:
make plugin-scaffold # Interactive mode
python3 tools/scaffold_plugin.py --help # See all options
Components:
- tools/scaffold_plugin.py: Main generator script
- tools/templates/plugin/: Jinja2 templates for all plugin files
- Makefile: Added plugin-scaffold and plugin-scaffold-help targets
The generator follows patterns from existing plugins (url_reputation,
pii_filter, etc.) and ensures consistency across the codebase.
Tested with make plugins-validate - all checks pass.
Signed-off-by: Suresh Kumar Moharajan <suresh.kumar.m@ibm.com>
* feat: add all 12 hooks from mcp-context-forge to scaffold tool
- Add agent hooks (agent_pre_invoke, agent_post_invoke)
- Add HTTP hooks (http_pre_request, http_post_request, http_auth_resolve_user, http_auth_check_permission)
- Organize hooks by category with comments
- Total of 12 hooks across 5 categories now available for plugin scaffolding
Signed-off-by: Suresh <suresh@example.com>
Signed-off-by: Suresh Kumar Moharajan <suresh.kumar.m@ibm.com>
* feat: enhance test template with comprehensive unit tests
- Remove TODO placeholders for integration and performance tests
- Add unit tests for config deserialization and immutability
- Add unit tests for None value handling
- Add edge case tests for empty strings and special characters
- Add config roundtrip serialization test
- Focus on unit-level testing within plugin directory scope
Signed-off-by: Suresh <suresh@example.com>
Signed-off-by: Suresh Kumar Moharajan <suresh.kumar.m@ibm.com>
* feat: add basic Rust unit tests to engine template
- Add test_engine_creation_with_defaults test
- Add test_engine_creation_with_custom_config test
- Remove TODO placeholder and provide concrete test implementations
- Tests verify engine initialization and configuration handling
Signed-off-by: Suresh <suresh@example.com>
Signed-off-by: Suresh Kumar Moharajan <suresh.kumar.m@ibm.com>
* docs: add plugin scaffold generator documentation to README
- Add 'Creating a New Plugin' section with scaffold usage
- Document all 12 available hooks across 5 categories
- Include interactive and non-interactive mode examples
- Update helper commands section with plugin-scaffold target
- Provide clear guidance for new plugin development
Signed-off-by: Suresh <suresh@example.com>
Signed-off-by: Suresh Kumar Moharajan <suresh.kumar.m@ibm.com>
* docs: add plugin scaffold generator to DEVELOPING guide
- Add 'Using the Plugin Scaffold Generator' section
- Document recommended workflow for creating new plugins
- Include interactive and non-interactive mode examples
- Clarify manual creation as alternative approach
- Update plugin creation workflow with scaffold-first approach
Signed-off-by: Suresh <suresh@example.com>
Signed-off-by: Suresh Kumar Moharajan <suresh.kumar.m@ibm.com>
* docs: update testing strategy and plugin development workflows
- Add comprehensive testing strategy section to AGENTS.md
- Document unit tests in cpex-plugins
- Document integration/E2E tests in mcp-context-forge
- Add cross-repository coordination guidelines
- Expand DEVELOPING.md with detailed workflows
- Current workflow: Rust + Python hybrid
- Future workflow: Pure Rust (post-framework migration)
- Add integration testing coordination
- Document migration path
- Rewrite TESTING.md with testing architecture
- Add cross-repository testing workflow
- Add testing coordination guidelines
- Add future pure Rust testing approach
- Add debugging and best practices sections
- Update README.md with testing strategy summary
- Add current/future architecture overview
- Add proper cross-references to detailed docs
Closes #20
Signed-off-by: Suresh Kumar Moharajan <suresh.kumar.m@ibm.com>
* docs: clarify plugins are pure Python or pure Rust with no dual-path fallback
Python entry points in Rust plugins are a packaging and distribution layer
only, not a parallel implementation or Rust fallback. Each plugin uses one
language for its core logic.
Signed-off-by: Suresh Kumar Moharajan <suresh.kumar.m@ibm.com>
* docs: add plugin-framework integration tests tier to testing strategy
cpex-plugins/tests/ holds both unit tests and plugin-framework
integration tests (make test-integration). Gateway integration and
E2E tests live in mcp-context-forge. Update AGENTS.md, TESTING.md,
and README.md to reflect this distinction.
Signed-off-by: Suresh Kumar Moharajan <suresh.kumar.m@ibm.com>
* docs: explicitly document plugin-framework integration tests as distinct layer
Add a dedicated "Plugin-Framework Integration Tests" layer (layer 3) in
the Testing Layers section. cpex-plugins/tests/ holds both unit tests
(make test-all) and integration tests between plugin and framework
(make test-integration). Gateway integration/E2E tests remain in
mcp-context-forge. Update Running Tests and Debugging sections to match.
Signed-off-by: Suresh Kumar Moharajan <suresh.kumar.m@ibm.com>
* docs: move unit test location from cpex-plugins/tests to plugin directory
Unit tests belong in the plugin folder, not the repo-level tests dir:
- Python: plugins/rust/python-package/<slug>/tests/
- Rust: inline mod tests in source files
Plugin-framework integration tests similarly live in the plugin's
own tests/ directory alongside unit tests.
Signed-off-by: Suresh Kumar Moharajan <suresh.kumar.m@ibm.com>
---------
Signed-off-by: Suresh Kumar Moharajan <suresh.kumar.m@ibm.com>
Signed-off-by: Suresh <suresh@example.com>
Co-authored-by: Suresh Kumar Moharajan <suresh.kumar.m@ibm.com>1 parent deffa93 commit a028dae
3 files changed
Lines changed: 587 additions & 9 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | | - | |
| 1 | + | |
2 | 2 | | |
3 | 3 | | |
4 | 4 | | |
| |||
8 | 8 | | |
9 | 9 | | |
10 | 10 | | |
11 | | - | |
| 11 | + | |
12 | 12 | | |
13 | 13 | | |
14 | 14 | | |
15 | 15 | | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
| 74 | + | |
| 75 | + | |
| 76 | + | |
| 77 | + | |
| 78 | + | |
| 79 | + | |
| 80 | + | |
| 81 | + | |
| 82 | + | |
| 83 | + | |
| 84 | + | |
| 85 | + | |
| 86 | + | |
| 87 | + | |
| 88 | + | |
| 89 | + | |
| 90 | + | |
| 91 | + | |
| 92 | + | |
| 93 | + | |
| 94 | + | |
| 95 | + | |
| 96 | + | |
| 97 | + | |
| 98 | + | |
| 99 | + | |
| 100 | + | |
| 101 | + | |
| 102 | + | |
| 103 | + | |
| 104 | + | |
| 105 | + | |
| 106 | + | |
| 107 | + | |
| 108 | + | |
| 109 | + | |
| 110 | + | |
| 111 | + | |
| 112 | + | |
| 113 | + | |
| 114 | + | |
| 115 | + | |
| 116 | + | |
| 117 | + | |
| 118 | + | |
| 119 | + | |
| 120 | + | |
| 121 | + | |
| 122 | + | |
| 123 | + | |
| 124 | + | |
| 125 | + | |
| 126 | + | |
| 127 | + | |
| 128 | + | |
| 129 | + | |
| 130 | + | |
| 131 | + | |
| 132 | + | |
| 133 | + | |
| 134 | + | |
| 135 | + | |
| 136 | + | |
| 137 | + | |
| 138 | + | |
| 139 | + | |
| 140 | + | |
| 141 | + | |
| 142 | + | |
| 143 | + | |
| 144 | + | |
| 145 | + | |
| 146 | + | |
| 147 | + | |
| 148 | + | |
| 149 | + | |
| 150 | + | |
| 151 | + | |
| 152 | + | |
| 153 | + | |
| 154 | + | |
| 155 | + | |
| 156 | + | |
| 157 | + | |
| 158 | + | |
| 159 | + | |
| 160 | + | |
| 161 | + | |
| 162 | + | |
| 163 | + | |
| 164 | + | |
| 165 | + | |
| 166 | + | |
| 167 | + | |
| 168 | + | |
| 169 | + | |
| 170 | + | |
| 171 | + | |
| 172 | + | |
| 173 | + | |
| 174 | + | |
| 175 | + | |
16 | 176 | | |
17 | 177 | | |
18 | 178 | | |
| |||
41 | 201 | | |
42 | 202 | | |
43 | 203 | | |
44 | | - | |
| 204 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
24 | 24 | | |
25 | 25 | | |
26 | 26 | | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
27 | 63 | | |
28 | 64 | | |
29 | 65 | | |
| |||
68 | 104 | | |
69 | 105 | | |
70 | 106 | | |
| 107 | + | |
| 108 | + | |
| 109 | + | |
| 110 | + | |
| 111 | + | |
| 112 | + | |
| 113 | + | |
| 114 | + | |
| 115 | + | |
| 116 | + | |
| 117 | + | |
| 118 | + | |
| 119 | + | |
| 120 | + | |
| 121 | + | |
| 122 | + | |
| 123 | + | |
| 124 | + | |
| 125 | + | |
| 126 | + | |
| 127 | + | |
| 128 | + | |
| 129 | + | |
| 130 | + | |
| 131 | + | |
| 132 | + | |
| 133 | + | |
| 134 | + | |
| 135 | + | |
| 136 | + | |
| 137 | + | |
| 138 | + | |
| 139 | + | |
| 140 | + | |
| 141 | + | |
| 142 | + | |
| 143 | + | |
| 144 | + | |
| 145 | + | |
| 146 | + | |
| 147 | + | |
| 148 | + | |
0 commit comments