Tests for the Antalya docker compose examples. They run against the setups in the docker and kubernetes directories.
Install dependencies:
pip install -r ../requirements.txt
pip install -r test-requirements.txtIf you are testing against Kubernetes, forward ClickHouse and Ice Rest Catalog ports to localhost.
kubectl port-forward pod/chi-vector-example-0-0-0 9000 8123 &
kubectl port-forward pod/ice-rest-catalog-0 5000 &
Run the test suite from the python/tests directory:
Standard mode (uses existing setup):
./run.shWith a specific profile:
./run.sh --profile=kubernetesManage Docker Compose (starts/stops services):
./run.sh --manage-dockerDirect Python execution:
# Run all tests
python test.py
# Run with a specific profile
TEST_PROFILE=kubernetes python test.py
# Run a single test
python -m unittest test.AntalyaTestFramework.test_load_ice_and_select -vTest configuration is managed via test_profiles.yaml. Available profiles:
docker(default): Local Docker Compose setupkubernetes: Kubernetes cluster setup
Profiles define connection settings for:
- Database host, port, user, password
- REST server host and port
setUpClass(): Verifies Docker services are running (or starts them if--manage-dockeris used)tearDownClass(): Captures container logs and runsdocker compose down(only if services were started by the framework)- Container logs are automatically saved to
test_logs/directory with timestamps for debugging - The framework includes sample HTTP tests and Python script execution tests
- Tests will pass if the HTTP response matches the expected status code
- The helper function allows specifying a single expected status code for precise validation
Container logs are automatically captured in the test_logs/ directory:
- Individual service logs:
{service_name}_{timestamp}.log - Combined logs:
combined_{timestamp}.log - Logs include timestamps and are captured whether tests pass or fail
Format code, sort imports, and check style with flake8
black . && isort . && flake8 .
Create additional test classes that inherit from AntalyaTestFramework
to add more test cases. The Docker Compose services will be managed
automatically.