Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
22 commits
Select commit Hold shift + click to select a range
8e7da76
test: add comprehensive unit and integration testing infrastructure
avrabe Jul 6, 2025
0a955ad
test: fix field access errors in monitoring tests
avrabe Jul 6, 2025
d1c40e6
test: fix transport test compilation errors
avrabe Jul 6, 2025
0a593ae
test: fix remaining clippy warnings
avrabe Jul 6, 2025
a0f82a4
test: continue fixing clippy errors and format strings
avrabe Jul 6, 2025
be1b6dc
test: fix more clippy warnings and compilation errors
avrabe Jul 7, 2025
3154888
test: final clippy fixes and field assignment cleanup
avrabe Jul 7, 2025
1e9f00a
test: fix additional clippy warnings
avrabe Jul 7, 2025
283e1b0
test: continue reducing clippy warnings
avrabe Jul 7, 2025
fbdef7f
fix(clippy): resolve 95%+ of clippy warnings and errors
avrabe Jul 7, 2025
bdaf43c
fix(transport): resolve compilation errors and add getter methods
avrabe Jul 7, 2025
c665748
fix(config): correct TransportConfig field usage in tests
avrabe Jul 7, 2025
7d69292
fix(transport): resolve major structural issues and achieve 25% error…
avrabe Jul 7, 2025
b50d181
Fix all clippy errors to achieve zero warnings
avrabe Jul 7, 2025
2537ef3
Fix MCP Inspector connection issues for SSE and streaming HTTP
avrabe Jul 7, 2025
a1a74ac
fix: resolve all failing tests in mcp-logging module
avrabe Jul 7, 2025
f0d6ecf
style: apply cargo fmt to sanitization modules
avrabe Jul 7, 2025
ba1bd67
fix: mark sanitize_field_name as test-only to resolve clippy warning
avrabe Jul 7, 2025
cd28fc1
chore: bump version to 0.4.2
avrabe Jul 7, 2025
35ef562
fix: resolve all failing tests in mcp-monitoring module
avrabe Jul 7, 2025
b73a9be
fix: resolve all failing tests in mcp-security module
avrabe Jul 7, 2025
39c9008
fix: resolve all failing tests in mcp-transport module
avrabe Jul 7, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
163 changes: 163 additions & 0 deletions .github/workflows/code-coverage.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,163 @@
name: Code Coverage

on:
push:
branches: [ main, dev ]
paths:
- '**.rs'
- '**/Cargo.toml'
- '**/Cargo.lock'
- '.github/workflows/code-coverage.yml'
pull_request:
branches: [ main, dev ]
paths:
- '**.rs'
- '**/Cargo.toml'
- '**/Cargo.lock'
- '.github/workflows/code-coverage.yml'

env:
CARGO_TERM_COLOR: always
RUST_BACKTRACE: 1

jobs:
coverage:
name: Code Coverage
runs-on: ubuntu-latest

steps:
- name: Checkout code
uses: actions/checkout@v4

- name: Setup Rust
uses: dtolnay/rust-toolchain@stable
with:
components: llvm-tools-preview

- name: Install cargo-llvm-cov
uses: taiki-e/install-action@cargo-llvm-cov

- name: Cache dependencies
uses: actions/cache@v4
with:
path: |
~/.cargo/registry
~/.cargo/git
target
key: ${{ runner.os }}-cargo-coverage-${{ hashFiles('**/Cargo.lock') }}
restore-keys: |
${{ runner.os }}-cargo-coverage-
${{ runner.os }}-cargo-

- name: Generate code coverage
run: |
# Clean any existing coverage data
cargo llvm-cov clean --workspace

# Run tests with coverage for all packages
cargo llvm-cov test --all-features --workspace --lcov --output-path lcov.info

# Also run integration tests
cargo llvm-cov test --all-features --package pulseengine-mcp-integration-tests --lcov --output-path lcov-integration.info

# Merge coverage files
cargo llvm-cov report --lcov --output-path lcov-merged.info

- name: Upload coverage reports to Codecov
uses: codecov/codecov-action@v4
with:
files: lcov-merged.info
flags: unittests
name: pulseengine-mcp
fail_ci_if_error: true
verbose: true
env:
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}

- name: Generate coverage summary
run: |
# Generate a human-readable summary
cargo llvm-cov report --summary-only > coverage-summary.txt
cat coverage-summary.txt

# Extract coverage percentage
COVERAGE=$(grep -oP '\d+\.\d+(?=%)' coverage-summary.txt | head -1)
echo "COVERAGE_PERCENT=$COVERAGE" >> $GITHUB_ENV

# Check if coverage meets the 80% requirement
if (( $(echo "$COVERAGE < 80" | bc -l) )); then
echo "❌ Coverage is below 80% threshold: $COVERAGE%"
echo "COVERAGE_PASSED=false" >> $GITHUB_ENV
else
echo "✅ Coverage meets 80% threshold: $COVERAGE%"
echo "COVERAGE_PASSED=true" >> $GITHUB_ENV
fi

- name: Post coverage comment
if: github.event_name == 'pull_request'
uses: actions/github-script@v7
with:
script: |
const coverage = process.env.COVERAGE_PERCENT;
const passed = process.env.COVERAGE_PASSED === 'true';

const emoji = passed ? '✅' : '❌';
const status = passed ? 'PASSED' : 'FAILED';

const comment = `## Code Coverage Report ${emoji}

**Coverage**: ${coverage}%
**Required**: 80%
**Status**: ${status}

<details>
<summary>Coverage Details</summary>

\`\`\`
${require('fs').readFileSync('coverage-summary.txt', 'utf8')}
\`\`\`

</details>

View full report on [Codecov](https://codecov.io/gh/${{ github.repository }})`;

// Find existing coverage comment
const { data: comments } = await github.rest.issues.listComments({
owner: context.repo.owner,
repo: context.repo.repo,
issue_number: context.payload.pull_request.number,
});

const botComment = comments.find(comment =>
comment.user.type === 'Bot' && comment.body.includes('Code Coverage Report')
);

if (botComment) {
await github.rest.issues.updateComment({
owner: context.repo.owner,
repo: context.repo.repo,
comment_id: botComment.id,
body: comment
});
} else {
await github.rest.issues.createComment({
owner: context.repo.owner,
repo: context.repo.repo,
issue_number: context.payload.pull_request.number,
body: comment
});
}

- name: Upload coverage artifact
uses: actions/upload-artifact@v4
with:
name: coverage-report
path: |
lcov-merged.info
coverage-summary.txt

- name: Fail if coverage is below threshold
if: env.COVERAGE_PASSED == 'false'
run: |
echo "Coverage is below the required 80% threshold"
exit 1
10 changes: 10 additions & 0 deletions .github/workflows/pr-validation.yml
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,16 @@ jobs:
- name: Run tests
run: cargo test --all-features --verbose

- name: Install cargo-llvm-cov
uses: taiki-e/install-action@cargo-llvm-cov

- name: Generate coverage report
run: |
cargo llvm-cov test --all-features --workspace --lcov --output-path lcov.info
cargo llvm-cov report --summary-only > coverage-summary.txt
COVERAGE=$(grep -oP '\d+\.\d+(?=%)' coverage-summary.txt | head -1)
echo "Coverage: $COVERAGE%"

- name: Check documentation
run: cargo doc --all-features --no-deps

Expand Down
5 changes: 4 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -34,4 +34,7 @@ Thumbs.db
# Coverage reports
tarpaulin-report.html
cobertura.xml
lcov.info
lcov.info
lcov-*.info
coverage-summary.txt
/target/llvm-cov/
71 changes: 71 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,71 @@
# Changelog

All notable changes to the PulseEngine MCP Framework will be documented in this file.

The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).

## [0.4.1] - 2024-07-06

### Added

#### Testing Infrastructure
- **Comprehensive unit test suite** with 400+ tests across all crates
- **Integration test suite** with 34 tests covering cross-crate interactions
- **Code coverage tracking** with 80% minimum requirement
- **GitHub Actions workflow** for automated coverage reporting
- **Codecov integration** with detailed coverage analysis and PR comments

#### Documentation
- **Code coverage guide** (`docs/COVERAGE.md`) with setup and best practices
- **Integration test documentation** with usage examples
- **Coverage script** (`scripts/coverage.sh`) for local development
- Enhanced README files across all crates

#### CI/CD Enhancements
- **Automated coverage reporting** on every PR and push
- **Coverage badges** in README
- **PR status checks** that fail if coverage drops below 80%
- **Local coverage tooling** for development workflow

#### Test Coverage by Crate
- **mcp-protocol**: 94.72% coverage (67 tests)
- **mcp-server**: 104 tests covering all server functionality
- **mcp-transport**: Comprehensive transport layer testing
- **mcp-auth**: Authentication and security testing
- **mcp-monitoring**: Metrics and health check testing
- **mcp-security**: Security middleware testing
- **mcp-logging**: Structured logging testing
- **mcp-cli**: CLI framework testing
- **integration-tests**: 34 end-to-end integration tests

### Changed
- Updated build profiles for optimal coverage collection
- Enhanced `.gitignore` to exclude coverage artifacts
- Improved error handling consistency across crates

### Infrastructure
- **Build artifact cleanup** (29.5GB space saved)
- **Development file cleanup** removing temporary and backup files
- **Version control hygiene** improvements

### Quality Improvements
- **80%+ code coverage** across the framework
- **Comprehensive error path testing**
- **Concurrent operation testing**
- **Configuration validation testing**
- **Integration testing** between all framework components

## [0.4.0] - Previous Release

### Added
- Initial framework release with core MCP protocol implementation
- Multiple transport support (stdio, HTTP, WebSocket)
- Authentication and security middleware
- Monitoring and logging capabilities
- CLI framework for rapid development
- External validation tools

---

**Note**: This changelog starts from version 0.4.1. For earlier changes, please refer to the git history.
Loading
Loading