Skip to content

Refactor environment setup and improve pytest coverage#9

Merged
francescobianco merged 2 commits intomainfrom
dev
Mar 24, 2026
Merged

Refactor environment setup and improve pytest coverage#9
francescobianco merged 2 commits intomainfrom
dev

Conversation

@francescobianco
Copy link
Copy Markdown
Member

This pull request includes several improvements and refactorings across documentation, environment variable handling, middleware, memory store logic, and testing infrastructure. The most significant changes are the removal of legacy K_SERVICE environment variable support in favor of explicit variables, refactoring of memory store logic for clarity and robustness, and the addition of a proper pytest configuration and new tests for the storage backend.

Environment Variable Handling and Documentation:

  • Removed all legacy support and documentation for the K_SERVICE environment variable, standardizing on explicit variables like MCP_OPENAPI_ENV, MCP_CACHE_HOST, etc. This affects documentation, server logic, and test scripts, making deployments more portable and the configuration clearer. [1] [2] [3] [4] [5] [6] [7] [8] [9] [10]

Memory Store Refactoring:

  • Refactored memory_store.py for improved readability, error handling, and documentation. Exceptions are now more specific, Memcached integration is clearer, and docstrings have been added for key functions. [1] [2] [3] [4]

Middleware and Logging Improvements:

  • Improved formatting and readability in logging and middleware, including better line breaks and more descriptive docstrings. Added pylint disables for clarity. [1] [2] [3] [4] [5] [6] [7] [8] [9]

Testing Infrastructure:

  • Added a pytest configuration in pyproject.toml and a conftest.py to ensure the src directory is on the Python path for tests. [1] [2]
  • Added a new test module test_storage_backend.py with unit tests for local and cloud storage backends, improving coverage and reliability.

These changes collectively improve maintainability, clarity, and testability of the codebase.

@francescobianco francescobianco merged commit 0c5fdad into main Mar 24, 2026
2 of 6 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant