CHANGE: Added auto-tests with Docker.

This commit is contained in:
2025-12-16 14:11:46 +01:00
parent cecd55cd3d
commit b1595ee9af
6 changed files with 132 additions and 1 deletions

View File

@@ -0,0 +1,36 @@
# Zabbix Partitioning Tests
This directory contains a Docker-based test environment for the Zabbix Partitioning script.
## Prerequisites
- Docker & Docker Compose
- Python 3
## Setup & Run
1. Start the database container:
```bash
docker compose up -d
```
This will start a MySQL 8.0 container and import the Zabbix schema.
2. Create valid config (done automatically):
The `test_config.yaml` references the running container.
3. Run the partitioning script:
```bash
# Create virtual environment if needed
python3 -m venv venv
./venv/bin/pip install pymysql pyyaml
# Dry Run
./venv/bin/python3 ../../partitioning/zabbix_partitioning.py -c test_config.yaml --dry-run --init
# Live Run
./venv/bin/python3 ../../partitioning/zabbix_partitioning.py -c test_config.yaml --init
```
## Cleanup
```bash
docker compose down
rm -rf venv
```