Multi-language integration tests for GreptimeDB, validating compatibility with different client drivers and protocols.
greptimedb-tests/
├── run_tests.sh # Master test runner
├── create_database.py # Database creation (mysql-connector-python)
├── java-tests/ # Java tests (MySQL JDBC + PostgreSQL JDBC + gRPC Ingester + OTLP)
├── python-tests/ # Python tests (mysql-connector + psycopg2 + OTLP)
├── go-tests/ # Go tests (MySQL + PostgreSQL + gRPC Ingester + OTLP)
├── otel-tests/ # OpenTelemetry OTLP protocol tests (Node.js)
└── .github/workflows/ # CI workflows
- GreptimeDB running on default ports (MySQL: 4002, PostgreSQL: 4003, gRPC: 4001)
- Python 3.8+ with
mysql-connector-python(for database creation) - Java 11+ and Maven 3.6+ (for Java tests)
- Go 1.24+ (for Go tests)
- Node.js 18+ (for OpenTelemetry tests)
pip install mysql-connector-pythonWithout authentication:
cargo run --bin greptime -- standalone startWith authentication (matches CI):
cargo run --bin greptime -- standalone start \
--user-provider=static_user_provider:cmd:greptime_user=greptime_pwd
export GREPTIME_USERNAME=greptime_user
export GREPTIME_PASSWORD=greptime_pwdAll test suites:
./run_tests.shIndividual suite:
cd java-tests && ./run_tests.sh
cd python-tests && ./run_tests.sh
cd go-tests && ./run_tests.sh
cd otel-tests && ./run_tests.sh- Protocols: MySQL JDBC, PostgreSQL JDBC, gRPC Ingester, OTLP
- Tests: CRUD operations, timezone handling, batch inserts, gRPC ingester operations, OpenTelemetry signals
- Coverage: All GreptimeDB data types
- Docs: java-tests/README.md
- Drivers: mysql-connector-python, psycopg2
- Protocols: MySQL, PostgreSQL, OTLP
- Tests: CRUD operations, timezone handling, batch inserts, OpenTelemetry signals
- Framework: pytest with parameterized tests
- Docs: python-tests/README.md
- Drivers: MySQL (go-sql-driver/mysql), PostgreSQL (lib/pq)
- Protocols: MySQL, PostgreSQL, gRPC Ingester, OTLP
- Tests: CRUD operations, timezone handling, batch inserts, gRPC ingester operations, OpenTelemetry signals
- Coverage: All GreptimeDB data types
- Docs: go-tests/README.md
- Language: Node.js
- Protocol: OTLP HTTP (protobuf)
- Signals: Metrics (Counter/Gauge/Histogram), Traces, Logs
- Verification: SQL queries via MySQL protocol
- Docs: otel-tests/README.md
Authentication:
GREPTIME_USERNAME/GREPTIME_PASSWORD- Credentials (default: empty)
Database:
DB_NAME- Database name (default: auto-derived)MYSQL_HOST/MYSQL_PORT- MySQL connection (default:127.0.0.1:4002)POSTGRES_HOST/POSTGRES_PORT- PostgreSQL connection (default:127.0.0.1:4003)
Optional:
MYSQL_URL/POSTGRES_URL- Complete connection URLs
Database Isolation: Each test suite uses a separate database named after its directory:
java-tests/→java_testspython-tests/→python_testsgo-tests/→go_testsotel-tests/→otel_tests_nodejs
Test Discovery:
Root run_tests.sh automatically discovers and executes all test suites (directories with run_tests.sh or run.sh).
Database Creation:
create_database.py creates databases before running each suite. Note: Must connect to public database first (GreptimeDB requirement).
- Format Check: Java (Spotless), Python (black + flake8), Go (gofmt)
- Integration Tests: Runs all suites with authentication in Docker
# In GreptimeDB main repo CI:
export GREPTIME_USERNAME=user
export GREPTIME_PASSWORD=pass
./run_tests.sh- Create directory:
mkdir new-tests && cd new-tests - Create
run_tests.shthat uses$DB_NAMEenv var - Make executable:
chmod +x run_tests.sh - Test:
./run_tests.sh(root runner auto-discovers)
See existing test suites for reference.
Apache License 2.0