-
Notifications
You must be signed in to change notification settings - Fork 0
fix: resolve CI test failures and external validation issues #4
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
- Accept client-provided session IDs instead of always creating new ones - Add Mcp-Session-Id header to responses as per MCP specification - Ensure compatibility with MCP Inspector session management - Bump version to 0.4.3
Updated protocol to ensure compatibility with MCP Inspector: - Changed protocol version to 2025-06-18 while maintaining backward compatibility with 2025-03-26 - Added skip_serializing_if annotations to all capability fields to prevent null values in JSON responses - Applied skip_serializing_if to instructions field in InitializeResult MCP Inspector expects clean JSON responses without null values, and this change ensures our server responses match the reference implementation's behavior. The protocol version update aligns with the latest MCP specification while maintaining support for older clients through the SUPPORTED_PROTOCOL_VERSIONS array.
Fixed failing test_path_operations test on Windows by using platform-specific paths: - Added cfg(unix) and cfg(windows) conditional compilation attributes - Unix systems use /tmp/test.txt and /tmp/ paths - Windows systems use C:\temp\test.txt and C:\ paths This ensures tests pass on both Unix-like systems and Windows without hardcoding platform-specific assumptions. The test logic remains the same, only the paths are adjusted based on the target platform.
Applied clippy recommendations to improve code quality: mcp-transport/src/http.rs: - Replaced manual Option::map pattern with more idiomatic or_else chain - Simplified session ID extraction from query parameters and headers mcp-server/src/handler.rs: - Fixed variable reuse by extracting server_info once before using its fields - Properly propagate instructions from backend instead of hardcoded empty string - This also improves MCP Inspector compatibility by using actual backend instructions These changes make the code more idiomatic and maintainable while fixing the clippy warning about manual implementation of Option::map.
Added two new examples demonstrating streamable HTTP transport usage: hello-world-streamable-http.rs: - Full-featured example using the MCP server framework - Demonstrates tool implementation with say_hello and count_greetings tools - Shows proper backend initialization and server configuration - Uses port 3002 for streamable HTTP transport minimal-streamable-http.rs: - Minimal implementation directly using transport layer - Matches the transport example pattern for testing - Implements basic MCP protocol handling without full server framework - Uses port 3003 to avoid conflicts These examples help developers understand how to implement MCP servers using the streamable HTTP transport, which is becoming the preferred transport for modern MCP implementations due to its simplicity compared to HTTP+SSE.
Updated version across all workspace members to 0.4.4. This release includes: - MCP Inspector compatibility improvements with proper null handling - Cross-platform test fixes for Windows support - Code quality improvements from clippy recommendations - New streamable HTTP transport examples - Protocol version updates to align with latest MCP specification The version bump prepares for publishing updated crates with all the recent fixes and improvements for better MCP ecosystem compatibility.
Add detailed documentation for all authentication backends including: - File-based authentication with secure filesystem storage - Environment variable authentication for containerized deployments - Memory-only authentication for temporary/development use - Disabled authentication for trusted environments This provides users with clear examples for each authentication mode, making it easier to choose the right approach for their deployment scenario and eliminating filesystem dependencies when needed.
Add new memory-only-auth example demonstrating: - Zero filesystem dependency authentication - Runtime API key management (add/remove keys while running) - Complete server implementation with authentication tools - Comprehensive documentation and usage instructions This example is ideal for development, testing, containerized deployments, or any scenario where persistent authentication storage is not desired. All API keys are stored in memory and lost on server restart.
- Fix clippy warnings in profiling demo examples - Apply consistent code formatting with cargo fmt - Improve code quality and maintain style consistency - Update example configurations to use direct initialization These changes ensure all examples follow Rust best practices and maintain consistent formatting across the codebase.
The test_find_cargo_toml_current_dir test was failing in CI environments because it assumed a Cargo.toml file would be present in the working directory or its parents. This assumption is not guaranteed in CI runners. Changes: - Create controlled test environment using temporary directories - Add explicit Cargo.toml creation within test scope - Properly restore original working directory after test - Maintain test coverage while eliminating environment dependencies This resolves CI test failures with exit code 101 in the external validation workflow, improving test reliability across different execution environments.
Fixed critical runtime issue where get_current_metrics() was calling blocking_read() from within an async runtime context, causing panics with "Cannot block the current thread from within a runtime" errors. Changes: - Convert get_current_metrics() from sync to async method - Replace blocking_read() with async read().await for system metrics - Update all callers to properly await the async method - Fix integration tests to handle the async API changes - Update metrics endpoint to use async pattern This resolves integration test failures and prevents runtime panics when accessing system metrics from async contexts. The change maintains the same functionality while ensuring proper async/await semantics throughout the monitoring system. Fixes: Integration test panics in monitoring_integration module
The scheduled validation workflow was passing server URLs as positional arguments instead of using the required --server-url flag, causing CLI parsing errors in external validation runs. Changes: - Update mcp-validate command to use --server-url flag syntax - Fix argument order to match expected CLI interface - Maintain all other validation parameters and timeout settings Error fixed: error: unexpected argument 'https://demo.mcp-server.dev' found Usage: mcp-validate [OPTIONS] --server-url <SERVER_URL> This ensures the scheduled external validation workflow can properly execute against test MCP servers without CLI argument parsing failures.
PR Validation ResultsQuick Validation: ✅
Validation Framework: ✅
Compatibility Check: ✅
Summary: ✅ All checks passed |
Convert remaining blocking operations in metrics collector: - Make start_collection() and stop_collection() async - Update all callers to use .await - Fixes remaining "Cannot block the current thread from within a runtime" errors
Replace global directory changes with controlled test environments: - Update test_find_cargo_toml_with_hierarchy to avoid changing cwd - Update test_find_cargo_toml_in_temp_dir to validate setup without directory changes - Prevents CI failures caused by environment-dependent directory operations
Apply cargo fmt to fix spacing and formatting inconsistencies
dd2d4c1 to
969a768
Compare
- Fix telemetry span test failure by initializing tracing subscriber in test environment - Fix persistence timestamp parsing with proper date/hour separation logic - Update prometheus dependency from 0.13 to 0.14 to resolve protobuf security vulnerability (RUSTSEC-2024-0437) - Optimize CI workflow matrix strategy to reduce resource contention: - Limit nightly builds to Ubuntu only - Add explicit timeouts to prevent infrastructure cancellations - Set fail-fast: false to continue other jobs if one fails Fixes macOS nightly test failures and security audit warnings in CI
969a768 to
69186b6
Compare
Welcome to Codecov 🎉Once you merge this PR into your default branch, you're all set! Codecov will compare coverage reports and display results in all future pull requests. ℹ️ You can also turn on project coverage checks and project coverage reporting on Pull Request comment Thanks for integrating Codecov - We've got you covered ☂️ |
- Fix Codecov badge URL and token to point to pulseengine/mcp - Fix CI badge URL to point to correct repository - Fix trailing whitespace in inspector tests
Remove which is flagged by clippy as a constant assertion that gets optimized out
- Include integration-tests in Dockerfile.validation copy commands - Resolves Docker build failure: 'failed to read /app/integration-tests/Cargo.toml'
- Add permissions section to code-coverage.yml workflow - Grant pull-requests: write permission for posting coverage comments - Resolves 'Resource not accessible by integration' error
Code Coverage Report ✅Coverage: 84.27% Coverage DetailsView full report on Codecov |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Summary
This PR fixes multiple CI failures that were causing the External Validation workflow to fail with exit code 101 and runtime panics in integration tests.
Issues Resolved
Changes Made
CLI Test Robustness (
test(cli))test_find_cargo_toml_current_dirto work reliably across different CI environmentsMonitoring API Async Compatibility (
fix(monitoring))get_current_metrics()from sync to async to prevent runtime blockingblocking_read()in async runtimeExternal Validation Workflow (
ci)--server-urlflag usageTest Results
Test Plan
The changes are focused and surgical, addressing specific CI failures without impacting core functionality. All tests pass locally and the fixes target the root causes of the CI issues.