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
37 lines
793 B
Bash
Executable File
37 lines
793 B
Bash
Executable File
#!/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"
|