Skip to content

Latest commit

 

History

History
369 lines (288 loc) · 12.8 KB

File metadata and controls

369 lines (288 loc) · 12.8 KB

Release v1.6.1 - Comprehensive Test Coverage and CI Integration

Release Date: December 16, 2025 Type: Patch Release (Testing Infrastructure) Status: Completed

Overview

Version 1.6.1 delivers comprehensive test coverage improvements and enhanced CI integration with Codecov, establishing a robust foundation for quality assurance across the CyberChef MCP Server codebase. This release expands the test suite from 274 to 311 tests (+37 tests, +13.5% increase), achieves all coverage thresholds, and integrates complete Codecov analytics for coverage tracking, bundle analysis, and test performance monitoring.

What's New

Test Suite Expansion

Comprehensive test coverage across all MCP server components:

Test Growth

  • Previous: 274 tests
  • Current: 311 tests
  • Increase: +37 tests (+13.5%)
  • Test Files: 9 comprehensive test suites

New Test Files

  1. tests/mcp/errors.test.mjs (43 tests)

    • Complete CyberChefMCPError hierarchy testing
    • Error factory function validation
    • Error context and serialization testing
    • Edge case coverage for error handling
  2. tests/mcp/logger.test.mjs (36 tests)

    • Logger initialization and configuration
    • Structured logging format validation
    • Request lifecycle logging (start/complete/error)
    • Specialized logging (cache/memory/streaming)
    • Child logger creation and context propagation
  3. tests/mcp/streaming.test.mjs (32 tests)

    • Streaming strategy determination logic
    • Threshold-based streaming activation
    • StreamingProgressTracker functionality
    • Progress event emission and tracking
    • Chunk processing and error handling
  4. tests/mcp/retry.test.mjs (29 tests)

    • Retry logic with exponential backoff
    • Circuit breaker pattern implementation
    • Error categorization (retryable vs non-retryable)
    • Timeout handling and recovery
    • State transitions (CLOSED/OPEN/HALF_OPEN)
  5. tests/mcp/recipe-validator.test.mjs (48 tests)

    • Recipe structure validation
    • Operation name verification
    • Argument validation and type checking
    • Circular dependency detection
    • Complexity estimation algorithms
  6. tests/mcp/recipe-storage.test.mjs (42 tests)

    • CRUD operations (create/read/update/delete)
    • In-memory caching layer
    • Atomic file operations
    • Recipe filtering and search
    • Persistence and data integrity
  7. tests/mcp/recipe-manager.test.mjs (14 tests)

    • Recipe execution orchestration
    • Recipe import/export (JSON/YAML/URL/CyberChef)
    • Recipe composition and nesting
    • Test execution with sample inputs
    • Integration with storage and validation
  8. tests/mcp/mcp-server.test.mjs (67 tests)

    • Core utility function testing
    • Tool name sanitization
    • Argument mapping to Zod schemas
    • Input size validation
    • LRUCache implementation
    • MemoryMonitor functionality
    • Configuration constant verification

Coverage Improvements

All coverage thresholds exceeded with significant margins:

Overall Coverage Metrics

  • Lines: 78.93% (threshold: 70%, +8.93% margin)
  • Statements: 78.7% (threshold: 70%, +8.7% margin)
  • Functions: 89.33% (threshold: 70%, +19.33% margin)
  • Branches: 74.68% (threshold: 65%, +9.68% margin)

File-Level Coverage

File Statements Functions Notable
errors.mjs 100% 100% Complete coverage
logger.mjs 96.82% 95.45% Comprehensive logging tests
retry.mjs 98.43% 100% Full retry logic coverage
streaming.mjs 97.18% 84.61% Streaming infrastructure tested
recipe-validator.mjs 81.7% 91.66% Validation logic covered
recipe-storage.mjs 84.37% 95.83% Storage operations tested
recipe-manager.mjs 93.22% 91.66% Recipe management validated
mcp-server.mjs 48.98% 66.66% Core utilities tested

Coverage Report Formats

  • LCOV: coverage/lcov.info (CI integration)
  • JSON: coverage/coverage-final.json (programmatic access)
  • HTML: coverage/index.html (visual reports)
  • Cobertura XML: coverage/cobertura-coverage.xml (Jenkins/GitLab)

Codecov Integration

Complete CI/CD integration with Codecov analytics platform:

Coverage Analytics

  • Automated Tracking: Coverage uploaded on all pull requests
  • Status Checks: Require 70% minimum project coverage
  • Patch Coverage: Require 75% coverage for new code
  • Flags: Separate tracking for mcp-tests, core-tests, node-api
  • Components: Coverage by component (MCP Server, Core Ops, Node API)

Bundle Analysis (Future)

  • Plugin: @codecov/webpack-plugin integration ready
  • Change Detection: Bundle size changes in pull requests
  • Trends: Historical bundle size tracking
  • Optimization: Insights for size reduction

Test Analytics

  • JUnit XML: Test result reporting enabled
  • Performance: Test execution time tracking
  • Flaky Tests: Automatic detection and identification
  • Regression: Test execution time monitoring

Configuration Files

  • codecov.yml: Coverage thresholds, status checks, PR commenting
  • vitest.config.mjs: V8 provider, JUnit reporter, coverage thresholds
  • .github/workflows/core-ci.yml: Codecov action integration

GitHub Actions

  • Coverage Upload: codecov/codecov-action@v5
  • Test Results: codecov/test-results-action@v1
  • Flags: Appropriate flags for all uploads (mcp-tests, core-tests)
  • Metadata: Complete repository and commit information

Documentation

  • Integration Guide: docs/guides/codecov-integration.md (400+ lines)
  • Summary: docs/internal/CODECOV_INTEGRATION_SUMMARY.md
  • Verification: docs/internal/CODECOV_VERIFICATION.md

Testability Improvements

Enhanced code testability through strategic exports in mcp-server.mjs:

Exported Classes

  • LRUCache: Cache implementation testing
  • MemoryMonitor: Memory monitoring validation

Exported Utility Functions

  • sanitizeToolName: Tool name sanitization logic
  • mapArgsToZod: Argument schema mapping
  • resolveArgValue: Default value resolution
  • validateInputSize: Input size validation

Exported Configuration

  • VERSION: Release version tracking
  • MAX_INPUT_SIZE: Input size limits
  • OPERATION_TIMEOUT: Timeout configuration
  • CACHE_MAX_SIZE: Cache size limits
  • CACHE_MAX_ITEMS: Cache item limits

Benefits

  • Direct unit testing of internal functions
  • Isolated testing without server initialization
  • Improved code coverage for core utilities
  • Better test maintainability and clarity
  • Faster test execution (no server overhead)

Bug Fixes

1. Codecov Configuration Validation Error (Critical)

  • Issue: Deprecated 'ui' field in codecov.yml
  • Impact: Codecov API validation failures
  • Fix: Removed deprecated field from configuration
  • File: codecov.yml
  • Severity: Critical (blocking CI integration)

2. mcp-server.mjs 0% Coverage (Blocker)

  • Issue: No test coverage for core server module
  • Root Cause: Internal functions not exported for testing
  • Fix: Added comprehensive exports for testability
  • Result: Achieved 48.98% coverage (up from 0%)
  • File: src/node/mcp-server.mjs
  • Severity: Blocker (quality metrics)

3. recipe-storage.mjs Test Isolation (Quality)

  • Issue: Flaky tests due to timestamp variations
  • Root Cause: Direct creation of storage instances with Date.now()
  • Fix: Introduced createEmptyStorage() factory function
  • Result: Consistent timestamp generation, no more flaky tests
  • File: src/node/recipe-storage.mjs
  • Severity: Medium (test reliability)

Modified Files

Version Updates

  1. package.json

    • Updated mcpVersion: "1.6.0" → "1.6.1"
  2. src/node/mcp-server.mjs

    • Updated VERSION constant: "1.6.0" → "1.6.1"
    • Added comprehensive exports for unit testing
  3. README.md

    • Updated "Latest Release" badge to v1.6.1
    • Updated download URLs for v1.6.1 tarball
    • Updated docker tag commands for v1.6.1
    • Updated release notes link
  4. CHANGELOG.md

    • Moved [Unreleased] → [1.6.1] - 2025-12-16
    • Documented all test suite expansions
    • Added coverage improvement metrics
    • Listed all bug fixes with technical details

Test Infrastructure

  1. vitest.config.mjs

    • Enhanced coverage configuration
    • Added JUnit XML reporter for test analytics
    • Configured coverage thresholds (70%/70%/70%/65%)
    • Set up multiple report formats (lcov/json/html/cobertura)
    • Added coverage exclusions for build artifacts
  2. src/node/recipe-storage.mjs

    • Added createEmptyStorage() factory for test isolation
    • Fixed timestamp generation in test environments
    • Improved test reliability and consistency

Quality Metrics

Test Execution

  • Total Tests: 311
  • Pass Rate: 100%
  • Duration: ~8-10 seconds (optimized)
  • Flaky Tests: 0 (fixed with factory functions)

Coverage

  • All Thresholds: Exceeded
  • Critical Files: 90%+ coverage (errors, logger, retry, streaming)
  • Recipe System: 80%+ coverage (validator, storage, manager)
  • Server Core: 48.98% coverage (improved from 0%)

CI Integration

  • Codecov: Full analytics pipeline operational
  • Test Results: JUnit XML reporting enabled
  • Coverage Reports: Multiple formats generated
  • Status Checks: Automated PR validation

Code Quality

  • Test Isolation: Factory functions for consistent state
  • Error Handling: Comprehensive error scenario coverage
  • Documentation: Inline comments and test descriptions
  • Maintainability: Clear test organization and naming

Configuration

No new environment variables. All existing configuration remains unchanged.

Breaking Changes

None. This is a non-breaking patch release focused on testing infrastructure and quality improvements. All existing APIs remain unchanged.

Upgrade Instructions

For Users

No action required. This is a patch release with no functional changes:

# Update to latest version
docker pull doublegate/cyberchef-mcp:latest

# Or pull specific version
docker pull doublegate/cyberchef-mcp:v1.6.1

For Developers

  1. Update dependencies:

    npm install
  2. Verify local coverage:

    npm run test:coverage
  3. Review new test files for testing patterns:

    • See tests/mcp/*.test.mjs for comprehensive examples
    • Note factory function usage for test isolation
    • Review Codecov integration in .github/workflows/core-ci.yml

Technical Debt Addressed

Test Infrastructure

  • Improved test isolation with factory functions
  • Enhanced code testability through strategic exports
  • Established comprehensive coverage baseline
  • Resolved flaky test issues with timing dependencies

CI/CD Integration

  • Resolved Codecov configuration validation issues
  • Established automated coverage tracking
  • Set up test analytics and performance monitoring
  • Implemented comprehensive quality gates

Code Quality

  • Eliminated 0% coverage for core server module
  • Achieved consistent test execution with no flaky tests
  • Improved test maintainability and clarity
  • Enhanced documentation for testing patterns

Next Steps

Short-Term (v1.6.2 - v1.7.0)

  • Continue expanding test coverage for uncovered areas
  • Target 85%+ coverage for all critical modules
  • Implement bundle analysis for production builds
  • Enhance test analytics with performance baselines

Medium-Term (v1.7.0 - v2.0.0)

  • Integration tests for end-to-end workflows
  • Performance benchmarking and regression tests
  • Load testing for concurrent operations
  • Security testing and vulnerability scanning

Long-Term (v2.0.0+)

  • Automated dependency updates with test validation
  • Continuous performance monitoring
  • A/B testing infrastructure for optimizations
  • Comprehensive chaos engineering tests

Documentation

New Documentation

  • docs/guides/codecov-integration.md: Comprehensive 400+ line guide
  • docs/internal/CODECOV_INTEGRATION_SUMMARY.md: Implementation summary
  • docs/internal/CODECOV_VERIFICATION.md: Verification guide

Updated Documentation

  • README.md: Testing section, coverage badges, version updates
  • CHANGELOG.md: Complete v1.6.1 changelog
  • docs/releases/v1.6.1.md: This release notes document

Credits

This release was made possible by comprehensive testing infrastructure improvements and CI/CD integration enhancements. Special focus on quality metrics, test coverage, and automated validation ensures a robust foundation for future development.

Support

For issues, questions, or feedback:

License

This project is licensed under the Apache License 2.0. See LICENSE for details.


Full Changelog: https://github.com/doublegate/CyberChef-MCP/compare/v1.6.0...v1.6.1