Skip to content
/ tests Public

InferaDB E2E tests — Engine and Control in Kubernetes

License

Apache-2.0, MIT licenses found

Licenses found

Apache-2.0
LICENSE-APACHE
MIT
LICENSE-MIT
Notifications You must be signed in to change notification settings

inferadb/tests

InferaDB Logo

InferaDB Integration Tests

Discord License

E2E tests for Engine and Control with Ledger storage

Important

Under active development. Not production-ready.

Quick Start

There are two ways to run the E2E tests:

Option 1: Docker Compose (CI-friendly)

Use this for CI pipelines or when you don't have a K8s cluster:

# From the meta-repository root
docker compose -f docker-compose.e2e.yml up -d

# Run tests
cd tests
cargo test --test integration -- --test-threads=1

# Stop and cleanup
docker compose -f docker-compose.e2e.yml down -v

Or use the helper script:

./run-e2e.sh              # Run all tests
./run-e2e.sh --keep       # Keep containers running after tests
./run-e2e.sh cache        # Run only cache-related tests

Option 2: Kubernetes Development Cluster

Use this for development with the full Tailscale-based setup:

# Check prerequisites
inferadb dev doctor

# Start development cluster
inferadb dev start

# Run tests
cargo test --test integration -- --test-threads=1

# Stop cluster (preserves data)
inferadb dev stop

# Destroy cluster completely
inferadb dev stop --destroy

Run specific suites:

cargo test --test integration auth_jwt -- --test-threads=1
cargo test --test integration vault_isolation -- --test-threads=1
cargo test --test integration cache -- --test-threads=1
cargo test --test integration ledger_cache_invalidation -- --test-threads=1

Test Coverage

Category Tests Scope
Authentication 7 JWT validation, Ed25519, expiration, scopes
Vault Isolation 4 Multi-tenant separation, cross-vault prevention
Cache Behavior 4 Hit/miss patterns, expiration, concurrency
Ledger Cache Invalidation 4 Ledger watch, certificate revocation, writes
Concurrency 5 Parallel requests, race conditions
E2E Workflows 2 Registration → authorization flows
Management 5 Org suspension, client deactivation
Resilience 6 Recovery, degradation, error propagation

CLI Commands

The development cluster is managed via the InferaDB CLI:

Command Purpose
inferadb dev doctor Check development prerequisites
inferadb dev start Start local Talos cluster
inferadb dev stop Pause cluster (preserves data)
inferadb dev stop --destroy Destroy cluster and data
inferadb dev status Show cluster status
inferadb dev logs View cluster logs
inferadb dev reset Reset all cluster data

Environment

Tests use K8s service DNS. Override for local development:

Variable Default (in K8s) Purpose
CONTROL_URL http://inferadb-control:9090 Control HTTP endpoint
ENGINE_URL http://inferadb-engine:8080 Engine HTTP endpoint
ENGINE_GRPC_URL http://inferadb-engine:8081 Engine gRPC endpoint
ENGINE_MESH_URL http://inferadb-engine:8082 Engine mesh endpoint

Writing Tests

#[tokio::test]
async fn test_my_feature() {
    let fixture = TestFixture::create().await.expect("setup failed");
    let jwt = fixture.generate_jwt(None, &["inferadb.check"]).unwrap();

    let response = fixture
        .call_engine_evaluate(&jwt, "document:1", "viewer", "user:alice")
        .await
        .unwrap();

    assert_eq!(response.status(), StatusCode::OK);
}

Troubleshooting

Issue Solution
Services not starting inferadb dev status or inferadb dev logs
Port in use inferadb dev stop --destroy && inferadb dev start
Tests timing out Ensure Docker has 4GB+ RAM; check inferadb dev logs
Prerequisites missing Run inferadb dev doctor to check requirements

Community

Join us on Discord for questions, discussions, and contributions.

License

Dual-licensed under MIT or Apache 2.0.

Contributors 3

  •  
  •  
  •