This document describes BenchBox's live integration test suite that executes real benchmarks against cloud database platforms using actual credentials.
For platforms that run locally in Docker (ClickHouse, Trino, Presto, PostgreSQL, StarRocks, Doris, Databend, InfluxDB), see [Docker Integration Tests](docker-integration-tests.md) instead (no cloud credentials needed).
Live integration tests verify that BenchBox works correctly with real cloud databases by:
- Connecting to actual Databricks, Snowflake, BigQuery, Redshift, and Athena instances
- Creating test schemas and loading data
- Executing queries and verifying results
- Cleaning up test resources
Important: These tests are skipped by default and only run when credentials are available.
- BenchBox installed with cloud platform extras:
pip install "benchbox[cloud]" - Active cloud platform accounts with appropriate permissions
- Environment variables configured with credentials
All tests use scale_factor=0.01 (~10MB of data) to minimize costs:
- Databricks: <$0.05 per test run (SQL Warehouse usage)
- Snowflake: <$0.05 per test run (Warehouse credit usage)
- BigQuery: <$0.10 per test run (Storage + query processing)
Total estimated cost: <$0.20 per full test run across all platforms
Copy the template and fill in your credentials:
cp .env.example .envEdit .env and add credentials for the platforms you want to test:
DATABRICKS_HOST=your-workspace.cloud.databricks.com
DATABRICKS_HTTP_PATH=/sql/1.0/warehouses/your-warehouse-id
DATABRICKS_TOKEN=your-access-tokenHow to get Databricks credentials:
- Log into your Databricks workspace
- Go to SQL Warehouses and select a warehouse
- Click "Connection Details"
- Copy the Server hostname and HTTP path
- Generate a Personal Access Token from User Settings → Access Tokens
SNOWFLAKE_ACCOUNT=your-account.snowflakecomputing.com
SNOWFLAKE_USERNAME=your-username
SNOWFLAKE_PASSWORD=your-password
SNOWFLAKE_WAREHOUSE=COMPUTE_WH
SNOWFLAKE_DATABASE=BENCHBOX
SNOWFLAKE_SCHEMA=PUBLICHow to get Snowflake credentials:
- Your account identifier (e.g.,
xy12345.us-east-1) - Username and password for authentication
- Warehouse name (create one if needed:
CREATE WAREHOUSE COMPUTE_WH) - Database and schema for testing (will be created if missing)
BIGQUERY_PROJECT=your-project-id
BIGQUERY_DATASET=benchbox_test
BIGQUERY_LOCATION=US
GOOGLE_APPLICATION_CREDENTIALS=/path/to/service-account.jsonHow to get BigQuery credentials:
- Create a Google Cloud project
- Enable the BigQuery API
- Create a service account with BigQuery Admin role
- Download the service account JSON key file
- Set
GOOGLE_APPLICATION_CREDENTIALSto the key file path
Test that credentials are configured correctly. The first command checks what would run (dry run). The second runs a single platform test:
make test-live-databricks --dry-run
make test-live-databricksThis runs all platforms and requires all credentials:
make test-live-allThe commands below run Databricks only, Snowflake only, and BigQuery only:
make test-live-databricks
make test-live-snowflake
make test-live-bigqueryThe commands below run all live tests, one platform's tests, and one test file:
uv run -- python -m pytest -m live_integration -v
uv run -- python -m pytest -m live_databricks -v
uv run -- python -m pytest tests/integration/platforms/test_databricks_live.py -v- Connection - Verify SQL Warehouse connectivity
- Version Info - Get platform metadata
- Catalog Access - Verify Unity Catalog permissions
- Schema Creation - Create isolated test schemas
- Data Loading - Load TPC-H SF=0.01 data
- Simple Query - Execute basic SELECT queries
- TPC-H Query - Run TPC-H Query 1 on loaded data
- COPY INTO - Test COPY INTO functionality
- Cleanup - Verify schema deletion works
- Connection - Verify Snowflake connectivity
- Version Info - Get platform metadata
- Warehouse Access - Verify warehouse and database access
- Schema Creation - Create isolated test schemas
- Data Loading - Load TPC-H SF=0.01 data
- Simple Query - Execute basic SELECT queries
- TPC-H Query - Run TPC-H Query 1 on loaded data
- PUT + COPY - Test PUT + COPY INTO workflow
- Cleanup - Verify schema deletion works
- Connection - Verify BigQuery connectivity
- Version Info - Get platform metadata
- Project Access - Verify project and dataset access
- Dataset Creation - Create isolated test datasets
- Data Loading - Load TPC-H SF=0.01 data
- Simple Query - Execute basic SELECT queries
- TPC-H Query - Run TPC-H Query 1 on loaded data
- GCS Load - Test GCS staging workflow
- Query Cost - Verify query cost estimation
- Cleanup - Verify dataset deletion works
Total: 28 live integration tests across 3 cloud platforms
.envfiles are in.gitignore- never commit them- Use
.env.exampleas a template with placeholder values - Rotate tokens/passwords regularly
Create dedicated service accounts with minimal permissions:
Databricks:
- SQL Warehouse usage permission
- Schema create/drop permission
- No admin/cluster create permissions needed
Snowflake:
CREATE SCHEMAprivilegeUSAGEon warehouse and database- No
ACCOUNTADMINrole needed
BigQuery:
- BigQuery Data Editor role
- BigQuery Job User role
- Storage Object Admin (for GCS staging)
- Tests use unique schema names with timestamps
- Cleanup fixtures automatically remove test data
- No production data is touched
Problem: All tests show SKIPPED
Solution: Check that required environment variables are set. The commands below check Databricks, Snowflake, and BigQuery in that order:
echo $DATABRICKS_TOKEN
echo $SNOWFLAKE_PASSWORD
echo $GOOGLE_APPLICATION_CREDENTIALSDatabricks: "Invalid access token"
- Verify token hasn't expired
- Check workspace URL is correct
- Ensure SQL Warehouse is running
Snowflake: "Incorrect username or password"
- Verify credentials in Snowflake UI
- Check account identifier format
- Try connecting with
snowsqlCLI first
BigQuery: "Could not load credentials"
- Verify JSON key file path exists
- Check service account has required roles
- Try
gcloud auth application-default login
Problem: Tests fail during data loading
Solutions:
- Verify sufficient warehouse/compute resources
- Check network connectivity
- Ensure sufficient storage quota
- Review platform-specific logs
Problem: Warning messages about failed schema deletion
Impact: Usually benign - schemas with timestamps avoid conflicts
Solution: Manually drop test schemas if needed. The statements below apply to Databricks, Snowflake, and BigQuery in that order, and are identical across the three:
DROP SCHEMA IF EXISTS benchbox_test_1234567890 CASCADE;
DROP SCHEMA IF EXISTS benchbox_test_1234567890 CASCADE;
DROP SCHEMA IF EXISTS benchbox_test_1234567890 CASCADE;Tests can run in CI with secrets. In this workflow, workflow_dispatch is a manual trigger and the cron schedule runs weekly on Sunday:
name: Live Integration Tests
on:
workflow_dispatch:
schedule:
- cron: '0 0 * * 0'
jobs:
test-databricks:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: '3.11'
- name: Install dependencies
run: pip install ".[cloud]"
- name: Run Databricks live tests
env:
DATABRICKS_HOST: ${{ secrets.DATABRICKS_HOST }}
DATABRICKS_HTTP_PATH: ${{ secrets.DATABRICKS_HTTP_PATH }}
DATABRICKS_TOKEN: ${{ secrets.DATABRICKS_TOKEN }}
run: make test-live-databricksNote: Store credentials as GitHub Secrets, never in workflow files.
- Run on manual trigger or schedule (not on every commit)
- Use smallest possible scale factors
- Set test timeouts to prevent runaway costs
- Monitor cloud spend regularly
- Follow the existing test pattern in
test_databricks_live.py - Use fixtures from
conftest.py - Always include cleanup logic
- Record expected cost in the Cost Considerations section above
Regular smoke tests don't require credentials and use stubs. Either command runs them:
make test-smoke
uv run -- python -m pytest -m platform_smoke -vEnable verbose pytest output, and capture logs with the second command:
uv run -- python -m pytest -m live_databricks -vv -s
uv run -- python -m pytest -m live_databricks -v --log-cli-level=DEBUG- BenchBox Documentation
- Platform Setup Guide
- Databricks SQL Warehouse Docs
- Snowflake Connection Docs
- BigQuery Authentication Docs
For issues or questions:
- GitHub Issues
- Review test output for specific error messages
- Check platform-specific documentation
Remember: Always protect your credentials and be mindful of cloud costs when running live integration tests.