e2e

package
v2.1.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 26, 2026 License: Apache-2.0 Imports: 3 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

README

Kafscale E2E Harness

These tests spin up a full cluster (via kind), install the local Helm chart, and hit the console API over a port-forward. They are opt-in because they require Docker/kind/helm on the host and take several minutes.

Prerequisites

  1. Docker daemon (Colima, Docker Desktop, etc.)
  2. kind, kubectl, and helm binaries on your $PATH
  3. Internet access to pull the Bitnami etcd chart (the harness installs a single-node etcd for the operator)

Test Categories and Dependencies

Tests have different dependency requirements. Tests will skip gracefully if their dependencies aren't available.

Category MinIO Docker Kind Make Target
Console tests No No No go test -run Console
Consumer group tests No No No make test-consumer-group
librdkafka/kcat tests No No No KAFSCALE_E2E=1 go test -tags=e2e ./test/e2e -run TestLibrdkafkaCompatibilityE2E -v
Ops API tests No No No make test-ops-api
MCP tests No No No make test-mcp
LFS proxy tests No (fake S3) No No go test ./cmd/proxy -run 'Lfs|LFS'
Produce/consume tests Yes Yes No make test-produce-consume
Multi-segment durability Yes No No make test-multi-segment-durability
Kind cluster tests No Yes Yes Requires KAFSCALE_E2E_KIND=1
MinIO Dependency

Tests that require MinIO (produce/consume, durability) will automatically skip if MinIO isn't available:

=== RUN   TestFranzGoProduceConsume
    franz_test.go:42: MinIO not available at http://127.0.0.1:9000; run 'make ensure-minio' first or use 'make test-produce-consume'
--- SKIP: TestFranzGoProduceConsume (0.00s)

To run MinIO-dependent tests:

# Option 1: Use make targets (automatically starts MinIO)
make test-produce-consume

# Option 2: Start MinIO manually, then run tests
make ensure-minio
KAFSCALE_E2E=1 go test -tags=e2e ./test/e2e -run TestFranzGoProduceConsume -v

Running

KAFSCALE_E2E=1 go test -tags=e2e ./test/e2e -v

LFS Go SDK (Kind Cluster)

This test validates the Go SDK against a running Kind cluster (LFS proxy + Kafka + MinIO).

Required environment:

  • KAFSCALE_E2E=1
  • KAFSCALE_E2E_KIND=1
  • KAFSCALE_E2E_BROKER_ADDR (host:port for broker)
  • LFS_PROXY_HTTP_URL (base URL such as http://127.0.0.1:8080; the SDK appends /lfs/produce), or LFS_PROXY_SERVICE_HOST + LFS_PROXY_HTTP_PORT
  • KAFSCALE_LFS_PROXY_S3_BUCKET
  • KAFSCALE_LFS_PROXY_S3_REGION
  • KAFSCALE_LFS_PROXY_S3_ENDPOINT
  • KAFSCALE_LFS_PROXY_S3_ACCESS_KEY
  • KAFSCALE_LFS_PROXY_S3_SECRET_KEY
  • KAFSCALE_LFS_PROXY_S3_FORCE_PATH_STYLE (optional)

Run:

KAFSCALE_E2E=1 KAFSCALE_E2E_KIND=1 \
KAFSCALE_E2E_BROKER_ADDR=127.0.0.1:9092 \
LFS_PROXY_HTTP_URL=http://127.0.0.1:8080 \
KAFSCALE_LFS_PROXY_S3_BUCKET=kafscale \
KAFSCALE_LFS_PROXY_S3_REGION=us-east-1 \
KAFSCALE_LFS_PROXY_S3_ENDPOINT=http://127.0.0.1:9000 \
KAFSCALE_LFS_PROXY_S3_ACCESS_KEY=minioadmin \
KAFSCALE_LFS_PROXY_S3_SECRET_KEY=minioadmin \
go test -tags=e2e ./test/e2e -run TestLfsSDKKindE2E -v

Note: Running all tests with go test will skip tests whose dependencies aren't available. For complete test coverage, use make test-full.

For local developer workflows, prefer the Makefile targets:

make test-consumer-group          # embedded etcd + in-memory S3
make test-ops-api                 # embedded etcd + in-memory S3
make test-mcp                     # MCP server tests
make test-multi-segment-durability # embedded etcd + MinIO
make test-produce-consume         # MinIO-backed produce/consume suite
make test-full                    # unit tests + local e2e suites
go test ./cmd/proxy -run 'Lfs|LFS' # LFS proxy with fake S3
Kind LFS SDK Helper Makefile

The Kind-based SDK test uses lfs-client-sdk/Makefile to orchestrate:

  • lfs-demo-up: start the LFS demo stack on Kind with make lfs-demo (keeps it running)
  • pf-start: port-forward broker, LFS proxy HTTP, and MinIO
  • test-lfs-sdk-kind: run the Go SDK E2E test

Run all:

make -C lfs-client-sdk run-all

Stop port-forwards:

make -C lfs-client-sdk pf-stop

make lfs-demo runs one broker, MinIO and the operator managed LFS proxy (spec.lfsProxy, deployment and service kafscale-lfs-proxy) in the kafscale-demo namespace. The proxy serves the LFS HTTP API on port 8080, stores objects in the cluster bucket kafscale-snapshots and sends produce requests to kafscale-broker:9092 through spec.lfsProxy.backends, which also feeds the LFS tracker topic __lfs_ops_state. The brokers advertise kafscale-broker.kafscale-demo.svc.cluster.local:9092, so pods reach them. The proxy advertises 127.0.0.1:39092, and pf-start forwards that port to the proxy's Kafka port, so the host test consumes through the proxy. lfs-demo-run is an alias for lfs-demo-up. On hosts where kind cannot use iptables, create the cluster with the nftables kube-proxy mode:

KAFSCALE_KIND_KUBE_PROXY_MODE=nftables make -C lfs-client-sdk run-all

Delete the cluster afterwards with kind delete cluster --name kafscale-demo.

If you already ran make lfs-demo, ensure port-forwards are up before running the SDK test:

make -C lfs-client-sdk pf-start
make -C lfs-client-sdk test-lfs-sdk-kind

Optional Environment Variables

Variable Description
KAFSCALE_KIND_CLUSTER Reuse an existing kind cluster without creating/deleting one
KAFSCALE_S3_ENDPOINT MinIO endpoint (default: http://127.0.0.1:9000)
KAFSCALE_E2E_DEBUG Enable verbose logging
KAFSCALE_TRACE_KAFKA Enable Kafka protocol tracing
KAFSCALE_E2E_OPEN_UI Open console UI in browser after test

The harness installs everything into the kafscale-e2e namespace and removes it after the test (unless you reused a cluster).

librdkafka compatibility

Install kcat on the test host. TestLibrdkafkaCompatibilityE2E starts embedded etcd, an in-memory-S3 broker, and a plain proxy, then checks produce, partition consume, group consume, and committed offsets through both endpoints. Docker and MinIO are not required. The test prints the kcat and librdkafka versions.

To exercise a specific build, set KAFSCALE_KCAT_BIN to its absolute path:

KAFSCALE_E2E=1 KAFSCALE_KCAT_BIN=/absolute/path/to/kcat go test -race -tags=e2e ./test/e2e -run '^TestLibrdkafkaCompatibilityE2E$' -count=1 -v

Documentation

Overview

fixes lingering broker processes between test runs

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL