Skip to main content
Glama
test-coverage.shโ€ข1.43 kB
#!/bin/bash # Run tests with coverage reporting set -e # Exit on error echo "๐Ÿงช OPNsense MCP Server - Test Coverage" echo "======================================" echo "" # Check if we're in the project root if [ ! -f "pytest.ini" ]; then echo "โŒ Error: Must be run from project root directory" exit 1 fi # Check if virtual environment is activated if [ -z "$VIRTUAL_ENV" ]; then echo "โš ๏ธ Warning: No virtual environment detected" echo " It's recommended to activate .venv first:" echo " source .venv/bin/activate" echo "" fi # Install dependencies echo "๐Ÿ“ฆ Installing dependencies..." python -m pip install -q pytest pytest-asyncio pytest-cov 2>/dev/null || { echo "โŒ Failed to install dependencies" exit 1 } echo "โœ… Dependencies ready" echo "" # Run tests with coverage echo "๐Ÿƒ Running tests with coverage..." echo "" python -m pytest tests/ \ --cov=src/opnsense_mcp \ --cov-report=term-missing \ --cov-report=html:htmlcov \ --cov-branch \ -v \ "$@" EXIT_CODE=$? echo "" if [ $EXIT_CODE -eq 0 ]; then echo "โœ… Tests completed successfully!" echo "" echo "๐Ÿ“Š Coverage report generated:" echo " - Terminal: See above" echo " - HTML: htmlcov/index.html" echo "" echo "To view HTML report:" echo " open htmlcov/index.html" else echo "โŒ Some tests failed (exit code: $EXIT_CODE)" fi exit $EXIT_CODE

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/floriangrousset/opnsense-mcp-server'

If you have feedback or need assistance with the MCP directory API, please join our Discord server