This is an automated email from the ASF dual-hosted git repository. lukaszlenart pushed a commit to branch docs/cleanup-claude-configurations in repository https://gitbox.apache.org/repos/asf/struts.git
commit b5b9754fa6c1d1354d47b12585ce37b86ce32cca Author: Lukasz Lenart <[email protected]> AuthorDate: Mon Nov 24 17:58:29 2025 +0100 docs(testing): improve test execution guidance Update test-runner agent and CLAUDE.md with clearer test execution approach: - Simplify test-runner agent description to be more direct - Add tools field (bash_tool, view, str_replace) to agent metadata - Replace /run_tests command reference with priority-based approach - Document test execution priority: JetBrains MCP > test-runner agent > Maven - Clarify when to use each test execution method - Remove obsolete command from available commands list This provides clearer guidance on test execution while maintaining flexibility for different development environments. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <[email protected]> --- .claude/agents/test-runner.md | 3 ++- CLAUDE.md | 26 ++++++++++++++++---------- 2 files changed, 18 insertions(+), 11 deletions(-) diff --git a/.claude/agents/test-runner.md b/.claude/agents/test-runner.md index dfc1bdb48..889b7837d 100644 --- a/.claude/agents/test-runner.md +++ b/.claude/agents/test-runner.md @@ -1,6 +1,7 @@ --- name: test-runner -description: Use this agent to intelligently execute and analyze Apache Struts tests using Maven, with specialized knowledge of Struts testing patterns, coverage analysis, and security testing. Examples: <example>Context: Developer wants to run tests after implementing a new feature. user: 'Can you run the tests for my changes?' assistant: 'I'll use the test-runner agent to execute the relevant tests and analyze the results.' <commentary>The user needs test execution and analysis, which [...] +description: Execute and analyze Maven tests for Apache Struts. Use PROACTIVELY when code changes, user mentions testing, asks to run tests, check test coverage, or validate changes. MUST BE USED for all Maven test execution (mvn test), test result analysis, and coverage reports. +tools: bash_tool, view, str_replace model: sonnet color: green --- diff --git a/CLAUDE.md b/CLAUDE.md index 6f324f0d8..5f338f789 100644 --- a/CLAUDE.md +++ b/CLAUDE.md @@ -23,7 +23,7 @@ modular architecture with clear separation between core framework, plugins, and # Full build with tests mvn clean install -# Run tests (use /run_tests command for intelligent test execution) +# Run tests mvn test -DskipAssembly # Build without running tests @@ -94,7 +94,21 @@ protected File createTemporaryFile(String fileName, Path location) { ## Testing Implementation -**For intelligent test execution and analysis, use:** `/run_tests` +### Intelligent Test Execution Approach + +When running tests, use this priority order: + +1. **JetBrains MCP** (when available in IntelliJ IDEA): + - Use `mcp__jetbrains__execute_run_configuration` for specific test configurations + - First check if configuration exists with `get_run_configurations` + +2. **test-runner agent** (primary method): + - Use Task tool with `subagent_type="test-runner"` for comprehensive test execution + - Provides intelligent test analysis and coverage reports + +3. **Direct Maven** (fallback): + - Use only when explicitly requested or for simple verification + - Command: `mvn test -DskipAssembly` ### Test Structure & Coverage @@ -104,13 +118,6 @@ protected File createTemporaryFile(String fileName, Path location) { - **Error Handling Tests**: Test exception scenarios and error reporting - **Cleanup Tests**: Verify resource cleanup and tracking -### Basic Testing Command - -```bash -# Run all tests (use -DskipAssembly to avoid building docs/examples) -mvn test -DskipAssembly -``` - ## Documentation Standards **For comprehensive documentation quality analysis, use:** `/quality_check` @@ -148,7 +155,6 @@ mvn test -DskipAssembly ### Commands - `/security_scan` - Comprehensive security analysis -- `/run_tests` - Intelligent test execution and analysis - `/quality_check` - Code quality and documentation analysis - `/config_analyze` - Configuration validation and optimization - `/create_plan` - Implementation planning assistance
