diff --git a/.github/workflows/test-dashboard.yml b/.github/workflows/test-dashboard.yml new file mode 100644 index 0000000..6ac200d --- /dev/null +++ b/.github/workflows/test-dashboard.yml @@ -0,0 +1,124 @@ +name: Test Dashboard + +on: + push: + branches: [ main, develop ] + pull_request: + branches: [ main ] + workflow_dispatch: # Allow manual trigger + +jobs: + test-and-dashboard: + runs-on: ubuntu-latest + + steps: + - name: Checkout code + uses: actions/checkout@v4 + + - name: Set up Python + uses: actions/setup-python@v5 + with: + python-version: '3.11' + cache: 'pip' + + - name: Install UV + run: | + curl -LsSf https://astral.sh/uv/install.sh | sh + echo "$HOME/.cargo/bin" >> $GITHUB_PATH + + - name: Install dependencies + run: | + uv sync --dev + + - name: Run tests with dashboard generation + run: | + python run_dashboard_tests.py + continue-on-error: true # Generate dashboard even if tests fail + + - name: Extract test summary + id: test_summary + run: | + TOTAL=$(jq '.summary.total' reports/test_results.json) + PASSED=$(jq '.summary.passed' reports/test_results.json) + FAILED=$(jq '.summary.failed' reports/test_results.json) + SKIPPED=$(jq '.summary.skipped' reports/test_results.json) + PASS_RATE=$(jq '.summary.pass_rate' reports/test_results.json) + + echo "total=$TOTAL" >> $GITHUB_OUTPUT + echo "passed=$PASSED" >> $GITHUB_OUTPUT + echo "failed=$FAILED" >> $GITHUB_OUTPUT + echo "skipped=$SKIPPED" >> $GITHUB_OUTPUT + echo "pass_rate=$PASS_RATE" >> $GITHUB_OUTPUT + + - name: Upload test dashboard + uses: actions/upload-artifact@v4 + if: always() + with: + name: test-dashboard + path: reports/ + retention-days: 30 + + - name: Comment PR with results + if: github.event_name == 'pull_request' + uses: actions/github-script@v7 + with: + script: | + const total = ${{ steps.test_summary.outputs.total }}; + const passed = ${{ steps.test_summary.outputs.passed }}; + const failed = ${{ steps.test_summary.outputs.failed }}; + const skipped = ${{ steps.test_summary.outputs.skipped }}; + const passRate = ${{ steps.test_summary.outputs.pass_rate }}; + + const statusEmoji = failed > 0 ? 'โ' : 'โ '; + const passRateEmoji = passRate >= 90 ? '๐' : passRate >= 70 ? '๐' : 'โ ๏ธ'; + + const comment = `## ${statusEmoji} Test Results + + | Metric | Value | + |--------|-------| + | Total Tests | ${total} | + | โ Passed | ${passed} | + | โ Failed | ${failed} | + | โญ๏ธ Skipped | ${skipped} | + | ${passRateEmoji} Pass Rate | ${passRate.toFixed(1)}% | + + ### ๐ Interactive Dashboard + + [Download test dashboard artifact](https://github.com/${{ github.repository }}/actions/runs/${{ github.run_id }}) + + The dashboard includes: + - Detailed test results with inputs/outputs + - Error tracebacks for failed tests + - Category breakdown (Word, Excel, PowerPoint, etc.) + - Interactive filtering and search + + **To view**: Download the artifact, extract, and open \`test_dashboard.html\` in your browser. + `; + + github.rest.issues.createComment({ + issue_number: context.issue.number, + owner: context.repo.owner, + repo: context.repo.repo, + body: comment + }); + + - name: Create job summary + if: always() + run: | + echo "# ๐ Test Dashboard Summary" >> $GITHUB_STEP_SUMMARY + echo "" >> $GITHUB_STEP_SUMMARY + echo "## Results" >> $GITHUB_STEP_SUMMARY + echo "" >> $GITHUB_STEP_SUMMARY + echo "- **Total**: ${{ steps.test_summary.outputs.total }} tests" >> $GITHUB_STEP_SUMMARY + echo "- **โ Passed**: ${{ steps.test_summary.outputs.passed }}" >> $GITHUB_STEP_SUMMARY + echo "- **โ Failed**: ${{ steps.test_summary.outputs.failed }}" >> $GITHUB_STEP_SUMMARY + echo "- **โญ๏ธ Skipped**: ${{ steps.test_summary.outputs.skipped }}" >> $GITHUB_STEP_SUMMARY + echo "- **๐ Pass Rate**: ${{ steps.test_summary.outputs.pass_rate }}%" >> $GITHUB_STEP_SUMMARY + echo "" >> $GITHUB_STEP_SUMMARY + echo "## ๐ Dashboard" >> $GITHUB_STEP_SUMMARY + echo "" >> $GITHUB_STEP_SUMMARY + echo "Download the \`test-dashboard\` artifact to view the interactive HTML dashboard." >> $GITHUB_STEP_SUMMARY + + - name: Fail job if tests failed + if: steps.test_summary.outputs.failed > 0 + run: exit 1 diff --git a/ADVANCED_TOOLS_PLAN.md b/ADVANCED_TOOLS_PLAN.md new file mode 100644 index 0000000..43af168 --- /dev/null +++ b/ADVANCED_TOOLS_PLAN.md @@ -0,0 +1,190 @@ +# Advanced MCP Office Tools Enhancement Plan + +## Current Status +- โ Basic text extraction +- โ Image extraction +- โ Metadata extraction +- โ Format detection +- โ Document health analysis +- โ Word-to-Markdown conversion + +## Missing Advanced Features by Library + +### ๐ Excel Tools (openpyxl + pandas + xlsxwriter) + +#### Data Analysis & Manipulation +- `analyze_excel_data` - Statistical analysis, data types, missing values +- `create_pivot_table` - Generate pivot tables with aggregations +- `excel_data_validation` - Set dropdown lists, number ranges, date constraints +- `excel_conditional_formatting` - Apply color scales, data bars, icon sets +- `excel_formula_analysis` - Extract, validate, and analyze formulas +- `excel_chart_creation` - Create charts (bar, line, pie, scatter, etc.) +- `excel_worksheet_operations` - Add/delete/rename sheets, copy data +- `excel_merge_spreadsheets` - Combine multiple Excel files intelligently + +#### Advanced Excel Features +- `excel_named_ranges` - Create and manage named ranges +- `excel_data_filtering` - Apply AutoFilter and advanced filters +- `excel_cell_styling` - Font, borders, alignment, number formats +- `excel_protection` - Password protect sheets/workbooks +- `excel_hyperlinks` - Add/extract hyperlinks from cells +- `excel_comments_notes` - Add/extract cell comments and notes + +### ๐ Word Tools (python-docx + mammoth) + +#### Document Structure & Layout +- `word_extract_tables` - Extract tables with styling and structure +- `word_extract_headers_footers` - Get headers/footers from all sections +- `word_extract_toc` - Extract table of contents with page numbers +- `word_document_structure` - Analyze heading hierarchy and outline +- `word_page_layout_analysis` - Margins, orientation, columns, page breaks +- `word_section_analysis` - Different sections with different formatting + +#### Content Management +- `word_find_replace_advanced` - Pattern-based find/replace with formatting +- `word_extract_comments` - Get all comments with author and timestamps +- `word_extract_tracked_changes` - Get revision history and changes +- `word_extract_hyperlinks` - Extract all hyperlinks with context +- `word_extract_footnotes_endnotes` - Get footnotes and endnotes +- `word_style_analysis` - Analyze and extract custom styles + +#### Document Generation +- `word_create_document` - Create new Word documents from templates +- `word_merge_documents` - Combine multiple Word documents +- `word_insert_content` - Add text, tables, images at specific locations +- `word_apply_formatting` - Apply consistent formatting across content + +### ๐ฏ PowerPoint Tools (python-pptx) + +#### Presentation Analysis +- `ppt_extract_slide_content` - Get text, images, shapes from each slide +- `ppt_extract_speaker_notes` - Get presenter notes for all slides +- `ppt_slide_layout_analysis` - Analyze slide layouts and master slides +- `ppt_extract_animations` - Get animation sequences and timing +- `ppt_presentation_structure` - Outline view with slide hierarchy + +#### Content Management +- `ppt_slide_operations` - Add/delete/reorder slides +- `ppt_master_slide_analysis` - Extract master slide templates +- `ppt_shape_analysis` - Analyze text boxes, shapes, SmartArt +- `ppt_media_extraction` - Extract embedded videos and audio +- `ppt_hyperlink_analysis` - Extract slide transitions and hyperlinks + +#### Presentation Generation +- `ppt_create_presentation` - Create new presentations from data +- `ppt_slide_generation` - Generate slides from templates and content +- `ppt_chart_integration` - Add charts and graphs to slides + +### ๐ Cross-Format Tools + +#### Document Conversion +- `convert_excel_to_word_table` - Convert spreadsheet data to Word tables +- `convert_word_table_to_excel` - Extract Word tables to Excel format +- `extract_presentation_data_to_excel` - Convert slide content to spreadsheet +- `create_report_from_data` - Generate Word reports from Excel data + +#### Advanced Analysis +- `cross_document_comparison` - Compare content across different formats +- `document_summarization` - AI-powered document summaries +- `extract_key_metrics` - Find numbers, dates, important data across docs +- `document_relationship_analysis` - Find references between documents + +### ๐จ Advanced Image & Media Tools + +#### Image Processing (Pillow integration) +- `advanced_image_extraction` - Extract with OCR, face detection, object recognition +- `image_format_conversion` - Convert between formats with optimization +- `image_metadata_analysis` - EXIF data, creation dates, camera info +- `image_quality_analysis` - Resolution, compression, clarity metrics + +#### Media Analysis +- `extract_embedded_objects` - Get all embedded files (PDFs, other Office docs) +- `analyze_document_media` - Comprehensive media inventory +- `optimize_document_media` - Reduce file sizes by optimizing images + +### ๐ Data Science Integration + +#### Analytics Tools (pandas + numpy integration) +- `statistical_analysis` - Mean, median, correlations, distributions +- `time_series_analysis` - Trend analysis on date-based data +- `data_cleaning_suggestions` - Identify data quality issues +- `export_for_analysis` - Export to JSON, CSV, Parquet for data science + +#### Visualization Preparation +- `prepare_chart_data` - Format data for visualization libraries +- `generate_chart_configs` - Create chart.js, plotly, matplotlib configs +- `data_validation_rules` - Suggest data validation based on content analysis + +### ๐ Security & Compliance Tools + +#### Document Security +- `analyze_document_security` - Check for sensitive information +- `redact_sensitive_content` - Remove/mask PII, financial data +- `document_audit_trail` - Track document creation, modification history +- `compliance_checking` - Check against various compliance standards + +#### Access Control +- `extract_permissions` - Get document protection and sharing settings +- `password_analysis` - Check password protection strength +- `digital_signature_verification` - Verify document signatures + +### ๐ง Automation & Workflow Tools + +#### Batch Operations +- `batch_document_processing` - Process multiple documents with same operations +- `template_application` - Apply templates to multiple documents +- `bulk_format_conversion` - Convert multiple files between formats +- `automated_report_generation` - Generate reports from data templates + +#### Integration Tools +- `export_to_cms` - Export content to various CMS formats +- `api_integration_prep` - Prepare data for API consumption +- `database_export` - Export structured data to database formats +- `email_template_generation` - Create email templates from documents + +## Implementation Priority + +### Phase 1: High-Impact Excel Tools ๐ฅ +1. `analyze_excel_data` - Immediate value for data analysis +2. `create_pivot_table` - High-demand business feature +3. `excel_chart_creation` - Visual data representation +4. `excel_conditional_formatting` - Professional spreadsheet styling + +### Phase 2: Advanced Word Processing ๐ +1. `word_extract_tables` - Critical for data extraction +2. `word_document_structure` - Essential for navigation +3. `word_find_replace_advanced` - Powerful content management +4. `word_create_document` - Document generation capability + +### Phase 3: PowerPoint & Cross-Format ๐ฏ +1. `ppt_extract_slide_content` - Complete presentation analysis +2. `convert_excel_to_word_table` - Cross-format workflows +3. `ppt_create_presentation` - Automated presentation generation + +### Phase 4: Advanced Analytics & Security ๐ +1. `statistical_analysis` - Data science integration +2. `analyze_document_security` - Compliance and security +3. `batch_document_processing` - Automation workflows + +## Technical Implementation Notes + +### Library Extensions Needed +- **openpyxl**: Chart creation, conditional formatting, data validation +- **python-docx**: Advanced styling, document manipulation +- **python-pptx**: Slide generation, animation analysis +- **pandas**: Statistical functions, data analysis tools +- **Pillow**: Advanced image processing features + +### New Dependencies to Consider +- **matplotlib/plotly**: Chart generation +- **numpy**: Statistical calculations +- **python-dateutil**: Advanced date parsing +- **regex**: Advanced pattern matching +- **cryptography**: Document security analysis + +### Architecture Considerations +- Maintain mixin pattern for clean organization +- Add result caching for expensive operations +- Implement progress tracking for batch operations +- Add streaming support for large data processing +- Maintain backward compatibility with existing tools \ No newline at end of file diff --git a/Makefile b/Makefile new file mode 100644 index 0000000..99cbabd --- /dev/null +++ b/Makefile @@ -0,0 +1,127 @@ +# Makefile for MCP Office Tools +# Provides convenient commands for testing, development, and dashboard generation + +.PHONY: help test test-dashboard test-pytest test-torture view-dashboard clean install format lint type-check + +# Default target - show help +help: + @echo "MCP Office Tools - Available Commands" + @echo "======================================" + @echo "" + @echo "Testing & Dashboard:" + @echo " make test - Run all tests with dashboard generation" + @echo " make test-dashboard - Alias for 'make test'" + @echo " make test-pytest - Run only pytest tests" + @echo " make test-torture - Run only torture tests" + @echo " make view-dashboard - Open test dashboard in browser" + @echo "" + @echo "Development:" + @echo " make install - Install project with dev dependencies" + @echo " make format - Format code with black" + @echo " make lint - Lint code with ruff" + @echo " make type-check - Run type checking with mypy" + @echo " make clean - Clean temporary files and caches" + @echo "" + @echo "Examples:" + @echo " make test # Run everything and open dashboard" + @echo " make test-pytest # Quick pytest-only run" + @echo " make view-dashboard # View existing results" + +# Run all tests and generate unified dashboard +test: test-dashboard + +test-dashboard: + @echo "๐งช Running comprehensive test suite with dashboard generation..." + @python run_dashboard_tests.py + +# Run only pytest tests +test-pytest: + @echo "๐งช Running pytest test suite..." + @uv run pytest --dashboard-output=reports/test_results.json -v + +# Run only torture tests +test-torture: + @echo "๐ฅ Running torture tests..." + @uv run python torture_test.py + +# View test dashboard in browser +view-dashboard: + @echo "๐ Opening test dashboard..." + @./view_dashboard.sh + +# Install project with dev dependencies +install: + @echo "๐ฆ Installing MCP Office Tools with dev dependencies..." + @uv sync --dev + @echo "โ Installation complete!" + +# Format code with black +format: + @echo "๐จ Formatting code with black..." + @uv run black src/ tests/ examples/ + @echo "โ Formatting complete!" + +# Lint code with ruff +lint: + @echo "๐ Linting code with ruff..." + @uv run ruff check src/ tests/ examples/ + @echo "โ Linting complete!" + +# Type checking with mypy +type-check: + @echo "๐ Running type checks with mypy..." + @uv run mypy src/ + @echo "โ Type checking complete!" + +# Clean temporary files and caches +clean: + @echo "๐งน Cleaning temporary files and caches..." + @find . -type d -name "__pycache__" -exec rm -rf {} + 2>/dev/null || true + @find . -type d -name "*.egg-info" -exec rm -rf {} + 2>/dev/null || true + @find . -type d -name ".pytest_cache" -exec rm -rf {} + 2>/dev/null || true + @find . -type d -name ".mypy_cache" -exec rm -rf {} + 2>/dev/null || true + @find . -type d -name ".ruff_cache" -exec rm -rf {} + 2>/dev/null || true + @find . -type f -name "*.pyc" -delete 2>/dev/null || true + @rm -rf dist/ build/ 2>/dev/null || true + @echo "โ Cleanup complete!" + +# Run full quality checks (format, lint, type-check, test) +check: format lint type-check test + @echo "โ All quality checks passed!" + +# Quick development test cycle (no dashboard) +quick-test: + @echo "โก Quick test run (no dashboard)..." + @uv run pytest -v --tb=short + +# Coverage report +coverage: + @echo "๐ Generating coverage report..." + @uv run pytest --cov=mcp_office_tools --cov-report=html --cov-report=term + @echo "โ Coverage report generated at htmlcov/index.html" + +# Run server in development mode +dev: + @echo "๐ Starting MCP Office Tools server..." + @uv run mcp-office-tools + +# Build distribution packages +build: + @echo "๐ฆ Building distribution packages..." + @uv build + @echo "โ Build complete! Packages in dist/" + +# Show project info +info: + @echo "MCP Office Tools - Project Information" + @echo "=======================================" + @echo "" + @echo "Project: mcp-office-tools" + @echo "Version: $(shell grep '^version' pyproject.toml | cut -d'"' -f2)" + @echo "Python: $(shell python --version)" + @echo "UV: $(shell uv --version 2>/dev/null || echo 'not installed')" + @echo "" + @echo "Directory: $(shell pwd)" + @echo "Tests: $(shell find tests -name 'test_*.py' | wc -l) test files" + @echo "Source files: $(shell find src -name '*.py' | wc -l) Python files" + @echo "" diff --git a/QUICKSTART_DASHBOARD.md b/QUICKSTART_DASHBOARD.md new file mode 100644 index 0000000..5da6509 --- /dev/null +++ b/QUICKSTART_DASHBOARD.md @@ -0,0 +1,114 @@ +# Test Dashboard - Quick Start + +## TL;DR - 3 Commands to Get Started + +```bash +# 1. Run all tests and generate dashboard +python run_dashboard_tests.py + +# 2. View dashboard (alternative) +make test + +# 3. Open existing dashboard +./view_dashboard.sh +``` + +## What You Get + +A beautiful, interactive HTML test dashboard that looks like Microsoft Office 365: + +- **Summary Cards** - Pass/fail stats at a glance +- **Interactive Filters** - Search and filter by category/status +- **Detailed Views** - Expand any test to see inputs, outputs, errors +- **MS Office Theme** - Professional, familiar design + +## File Locations + +``` +reports/ +โโโ test_dashboard.html โ Open this in browser +โโโ test_results.json โ Test data (auto-generated) +``` + +## Common Tasks + +### Run Tests +```bash +make test # Run everything +make test-pytest # Pytest only +python torture_test.py # Torture tests only +``` + +### View Results +```bash +./view_dashboard.sh # Auto-open in browser +make view-dashboard # Same thing +open reports/test_dashboard.html # Manual +``` + +### Customize +```bash +# Edit colors +vim reports/test_dashboard.html # Edit CSS variables + +# Change categorization +vim tests/pytest_dashboard_plugin.py # Edit _categorize_test() +``` + +## Color Reference + +- Word: Blue `#2B579A` +- Excel: Green `#217346` +- PowerPoint: Orange `#D24726` +- Pass: Green `#107C10` +- Fail: Red `#D83B01` + +## Example Output + +``` +$ python run_dashboard_tests.py + +====================================================================== +๐งช Running pytest test suite... +====================================================================== +... pytest output ... + +====================================================================== +๐ฅ Running torture tests... +====================================================================== +... torture test output ... + +====================================================================== +๐ TEST DASHBOARD SUMMARY +====================================================================== + +โ Passed: 12 +โ Failed: 2 +โญ๏ธ Skipped: 1 + +๐ Pass Rate: 80.0% +โฑ๏ธ Duration: 45.12s + +๐ Results saved to: reports/test_results.json +๐ Dashboard: reports/test_dashboard.html +====================================================================== + +๐ Opening dashboard in browser... +``` + +## Troubleshooting + +**Dashboard shows no results?** +โ Run tests first: `python run_dashboard_tests.py` + +**Can't open in browser?** +โ Manually open: `file:///path/to/reports/test_dashboard.html` + +**Tests not categorized correctly?** +โ Edit `tests/pytest_dashboard_plugin.py`, function `_categorize_test()` + +## More Info + +- Full docs: `TEST_DASHBOARD.md` +- Implementation details: `DASHBOARD_SUMMARY.md` +- Dashboard features: `reports/README.md` diff --git a/reports/README.md b/reports/README.md new file mode 100644 index 0000000..a9a3903 --- /dev/null +++ b/reports/README.md @@ -0,0 +1,209 @@ +# MCP Office Tools - Test Dashboard + +Beautiful, interactive HTML dashboard for viewing test results with Microsoft Office-inspired design. + +## Features + +- **MS Office Theme**: Modern Microsoft Office 365-inspired design with Fluent Design elements +- **Category-based Organization**: Separate results by Word, Excel, PowerPoint, Universal, and Server categories +- **Interactive Filtering**: Search and filter tests by name, category, or status +- **Detailed Test Views**: Expand any test to see inputs, outputs, errors, and tracebacks +- **Real-time Statistics**: Pass/fail rates, duration metrics, and category breakdowns +- **Self-contained**: Works offline with no external dependencies + +## Quick Start + +### Run All Tests with Dashboard + +```bash +# Run both pytest and torture tests, generate dashboard, and open in browser +python run_dashboard_tests.py +``` + +### Run Only Pytest Tests + +```bash +# Run pytest with dashboard plugin +pytest -p tests.pytest_dashboard_plugin --dashboard-output=reports/test_results.json + +# Open dashboard +open reports/test_dashboard.html # macOS +xdg-open reports/test_dashboard.html # Linux +start reports/test_dashboard.html # Windows +``` + +### View Existing Results + +Simply open `reports/test_dashboard.html` in your browser. The dashboard will automatically load `test_results.json` from the same directory. + +## Dashboard Components + +### Summary Cards + +Four main summary cards show: +- **Total Tests**: Number of test cases executed +- **Passed**: Successful tests with pass rate and progress bar +- **Failed**: Tests with errors +- **Duration**: Total execution time + +### Filter Controls + +- **Search Box**: Filter tests by name, module, or category +- **Category Filters**: Filter by Word, Excel, PowerPoint, Universal, or Server +- **Status Filters**: Show only passed, failed, or skipped tests + +### Test Results + +Each test displays: +- **Status Icon**: Visual indicator (โ pass, โ fail, โ skip) +- **Test Name**: Descriptive test name +- **Category Badge**: Color-coded category (Word=blue, Excel=green, PowerPoint=orange) +- **Duration**: Execution time in milliseconds +- **Expandable Details**: Click to view inputs, outputs, errors, and full traceback + +## File Structure + +``` +reports/ +โโโ test_dashboard.html # Main dashboard (open this in browser) +โโโ test_results.json # Generated test data (auto-loaded by dashboard) +โโโ pytest_results.json # Intermediate pytest results +โโโ README.md # This file +``` + +## Design Philosophy + +### Microsoft Office Color Palette + +- **Word Blue**: `#2B579A` - Used for Word-related tests +- **Excel Green**: `#217346` - Used for Excel-related tests +- **PowerPoint Orange**: `#D24726` - Used for PowerPoint-related tests +- **Primary Blue**: `#0078D4` - Accent color (Fluent Design) + +### Fluent Design Principles + +- **Subtle Shadows**: Cards have soft shadows for depth +- **Rounded Corners**: 8px border radius for modern look +- **Hover Effects**: Interactive elements respond to mouse hover +- **Typography**: Segoe UI font family (Office standard) +- **Clean Layout**: Generous whitespace and clear hierarchy + +## Integration with CI/CD + +### GitHub Actions Example + +```yaml +- name: Run Tests with Dashboard + run: | + python run_dashboard_tests.py + +- name: Upload Test Dashboard + uses: actions/upload-artifact@v3 + with: + name: test-dashboard + path: reports/ +``` + +### GitLab CI Example + +```yaml +test_dashboard: + script: + - python run_dashboard_tests.py + artifacts: + paths: + - reports/ + expire_in: 1 week +``` + +## Customization + +### Change Dashboard Output Location + +```bash +# Custom output path for pytest +pytest -p tests.pytest_dashboard_plugin --dashboard-output=custom/path/results.json +``` + +### Modify Colors + +Edit the CSS variables in `test_dashboard.html`: + +```css +:root { + --word-blue: #2B579A; + --excel-green: #217346; + --powerpoint-orange: #D24726; + /* ... more colors ... */ +} +``` + +## Troubleshooting + +### Dashboard shows "No Test Results Found" + +- Ensure `test_results.json` exists in the `reports/` directory +- Run tests first: `python run_dashboard_tests.py` +- Check browser console for JSON loading errors + +### Tests not categorized correctly + +- Categories are determined by test path/name +- Ensure test files follow naming convention (e.g., `test_word_*.py`) +- Edit `_categorize_test()` in `pytest_dashboard_plugin.py` to customize + +### Dashboard doesn't open automatically + +- May require manual browser opening +- Use the file path printed in terminal +- Check that `webbrowser` module is available + +## Advanced Usage + +### Extend the Plugin + +The pytest plugin can be customized by editing `tests/pytest_dashboard_plugin.py`: + +```python +def _extract_inputs(self, item): + """Customize how test inputs are extracted""" + # Your custom logic here + pass + +def _categorize_test(self, item): + """Customize test categorization""" + # Your custom logic here + pass +``` + +### Add Custom Test Data + +The JSON format supports additional fields: + +```json +{ + "metadata": { /* your custom metadata */ }, + "summary": { /* summary stats */ }, + "categories": { /* category breakdown */ }, + "tests": [ + { + "name": "test_name", + "custom_field": "your_value", + /* ... standard fields ... */ + } + ] +} +``` + +## Contributing + +When adding new test categories or features: + +1. Update `_categorize_test()` in the pytest plugin +2. Add corresponding color scheme in HTML dashboard CSS +3. Add filter button in dashboard controls +4. Update this README with new features + +## License + +Part of the MCP Office Tools project. See main project LICENSE file. diff --git a/reports/pytest_results.json b/reports/pytest_results.json new file mode 100644 index 0000000..4d17593 --- /dev/null +++ b/reports/pytest_results.json @@ -0,0 +1,18 @@ +{ + "metadata": { + "start_time": "2026-01-11T00:23:10.209539", + "pytest_version": "9.0.2", + "end_time": "2026-01-11T00:23:10.999816", + "duration": 0.7902717590332031, + "exit_status": 0 + }, + "summary": { + "total": 0, + "passed": 0, + "failed": 0, + "skipped": 0, + "pass_rate": 0 + }, + "categories": {}, + "tests": [] +} \ No newline at end of file diff --git a/reports/test_dashboard.html b/reports/test_dashboard.html new file mode 100644 index 0000000..8ec838e --- /dev/null +++ b/reports/test_dashboard.html @@ -0,0 +1,963 @@ + + +
+ + +