Add comprehensive tests for all geo GraphQL endpoints
All checks were successful
Build Docker Image / build (push) Successful in 1m22s
All checks were successful
Build Docker Image / build (push) Successful in 1m22s
Created test suite covering all 8 main geo service endpoints: - Basic: products, nodes (with filters/bounds), clusteredNodes - Nearest: nearestHubs, nearestOffers, nearestSuppliers (with product filters) - Routing: routeToCoordinate, autoRoute, railRoute - Edge cases: invalid coordinates, zero radius, nonexistent UUIDs Test suite uses real API calls to production GraphQL endpoint. 16 tests total across 4 test classes. Files: - tests/test_graphql_endpoints.py: Main test suite (600+ lines) - tests/README.md: Documentation and usage guide - pytest.ini: Pytest configuration - run_tests.sh: Convenience script to run tests - pyproject.toml: Added pytest and requests as dev dependencies
This commit is contained in:
36
run_tests.sh
Executable file
36
run_tests.sh
Executable file
@@ -0,0 +1,36 @@
|
||||
#!/bin/bash
|
||||
# Run geo service GraphQL endpoint tests
|
||||
|
||||
set -e
|
||||
|
||||
cd "$(dirname "$0")"
|
||||
|
||||
echo "🧪 Running Geo Service GraphQL Tests"
|
||||
echo "===================================="
|
||||
echo ""
|
||||
|
||||
# Check if TEST_GEO_URL is set, otherwise use production
|
||||
if [ -z "$TEST_GEO_URL" ]; then
|
||||
export TEST_GEO_URL="https://geo.optovia.ru/graphql/public/"
|
||||
echo "📍 Testing against: $TEST_GEO_URL (production)"
|
||||
else
|
||||
echo "📍 Testing against: $TEST_GEO_URL"
|
||||
fi
|
||||
|
||||
echo ""
|
||||
|
||||
# Install dependencies if needed
|
||||
if ! poetry run python -c "import pytest" 2>/dev/null; then
|
||||
echo "📦 Installing dependencies..."
|
||||
poetry install --with dev
|
||||
echo ""
|
||||
fi
|
||||
|
||||
# Run tests
|
||||
echo "🚀 Running tests..."
|
||||
echo ""
|
||||
|
||||
poetry run pytest tests/test_graphql_endpoints.py -v -s "$@"
|
||||
|
||||
echo ""
|
||||
echo "✅ Test run complete"
|
||||
Reference in New Issue
Block a user