Dagger
Search

tests

dagger function so it can be invoked individually during TDD; All wires them
up for parallel execution under `dagger call all`.

Installation

dagger install github.com/z5labs/devex/daggerverse/kafka/tests@9ebfb29b95cb654ed5d00d1e595bcf710c2a7318

Entrypoint

Return Type
Tests
Example
dagger -m github.com/z5labs/devex/daggerverse/kafka/tests@9ebfb29b95cb654ed5d00d1e595bcf710c2a7318 call \
func (m *MyModule) Example() *dagger.Tests  {
	return dag.
			Tests()
}
@function
def example() -> dagger.Tests:
	return (
		dag.tests()
	)
@func()
example(): Tests {
	return dag
		.tests()
}

Types

Tests 🔗

all() 🔗

All runs every kafka round-trip test, capped at two concurrent jobs so the engine doesn’t have dozens of cluster containers (controller + brokers per test) in flight at once on smaller CI runners.

Return Type
Void !
Example
dagger -m github.com/z5labs/devex/daggerverse/kafka/tests@9ebfb29b95cb654ed5d00d1e595bcf710c2a7318 call \
 all
func (m *MyModule) Example(ctx context.Context)   {
	return dag.
			Tests().
			All(ctx)
}
@function
async def example() -> None:
	return await (
		dag.tests()
		.all()
	)
@func()
async example(): Promise<void> {
	return dag
		.tests()
		.all()
}

bindBrokersExposesBrokersToCallerContainer() 🔗

BindBrokersExposesBrokersToCallerContainer binds the cluster’s brokers into a vanilla alpine container and asserts that the broker hostname resolves and its client-facing port is reachable from inside that container — the integration the BindBrokers contract promises.

Return Type
Void !
Example
dagger -m github.com/z5labs/devex/daggerverse/kafka/tests@9ebfb29b95cb654ed5d00d1e595bcf710c2a7318 call \
 bind-brokers-exposes-brokers-to-caller-container
func (m *MyModule) Example(ctx context.Context)   {
	return dag.
			Tests().
			Bindbrokersexposesbrokerstocallercontainer(ctx)
}
@function
async def example() -> None:
	return await (
		dag.tests()
		.bindbrokersexposesbrokerstocallercontainer()
	)
@func()
async example(): Promise<void> {
	return dag
		.tests()
		.bindBrokersExposesBrokersToCallerContainer()
}

clusterClientCanListTopicsOnFreshCluster() 🔗

ClusterClientCanListTopicsOnFreshCluster opens a franz-go-backed Client against a fresh cluster and asserts that ListTopics returns without error. A fresh KRaft cluster has no user topics, so the result may be empty — but the call itself must succeed, which proves module-runtime networking can reach the started broker service.

Return Type
Void !
Example
dagger -m github.com/z5labs/devex/daggerverse/kafka/tests@9ebfb29b95cb654ed5d00d1e595bcf710c2a7318 call \
 cluster-client-can-list-topics-on-fresh-cluster
func (m *MyModule) Example(ctx context.Context)   {
	return dag.
			Tests().
			Clusterclientcanlisttopicsonfreshcluster(ctx)
}
@function
async def example() -> None:
	return await (
		dag.tests()
		.clusterclientcanlisttopicsonfreshcluster()
	)
@func()
async example(): Promise<void> {
	return dag
		.tests()
		.clusterClientCanListTopicsOnFreshCluster()
}

createAndDeleteTopicRoundTrip() 🔗

CreateAndDeleteTopicRoundTrip exercises the create/list/delete cycle to confirm kadm wiring. The topic name is randomized so the test is repeatable against the same cluster and never collides with leftovers.

Return Type
Void !
Example
dagger -m github.com/z5labs/devex/daggerverse/kafka/tests@9ebfb29b95cb654ed5d00d1e595bcf710c2a7318 call \
 create-and-delete-topic-round-trip
func (m *MyModule) Example(ctx context.Context)   {
	return dag.
			Tests().
			Createanddeletetopicroundtrip(ctx)
}
@function
async def example() -> None:
	return await (
		dag.tests()
		.createanddeletetopicroundtrip()
	)
@func()
async example(): Promise<void> {
	return dag
		.tests()
		.createAndDeleteTopicRoundTrip()
}

dedicatedControllerAndBrokerProduceConsume() 🔗

DedicatedControllerAndBrokerProduceConsume verifies that the split controller+broker topology (introduced this increment) still supports a full produce/consume round-trip — i.e. the broker correctly joined the controller quorum over its WithServiceBinding alias.

Return Type
Void !
Example
dagger -m github.com/z5labs/devex/daggerverse/kafka/tests@9ebfb29b95cb654ed5d00d1e595bcf710c2a7318 call \
 dedicated-controller-and-broker-produce-consume
func (m *MyModule) Example(ctx context.Context)   {
	return dag.
			Tests().
			Dedicatedcontrollerandbrokerproduceconsume(ctx)
}
@function
async def example() -> None:
	return await (
		dag.tests()
		.dedicatedcontrollerandbrokerproduceconsume()
	)
@func()
async example(): Promise<void> {
	return dag
		.tests()
		.dedicatedControllerAndBrokerProduceConsume()
}

multiControllerIsRejected() 🔗

MultiControllerIsRejected pins the current contract: this story only supports a single-controller quorum (controllers=1), and the constructor must reject any larger value with a clear error rather than silently spinning up a broken topology. Multi-controller HA is gated behind a follow-up story; see daggerverse/kafka/README.md.

Return Type
Void !
Example
dagger -m github.com/z5labs/devex/daggerverse/kafka/tests@9ebfb29b95cb654ed5d00d1e595bcf710c2a7318 call \
 multi-controller-is-rejected
func (m *MyModule) Example(ctx context.Context)   {
	return dag.
			Tests().
			Multicontrollerisrejected(ctx)
}
@function
async def example() -> None:
	return await (
		dag.tests()
		.multicontrollerisrejected()
	)
@func()
async example(): Promise<void> {
	return dag
		.tests()
		.multiControllerIsRejected()
}

oneControllerTwoBrokersReplicationFactorTwo() 🔗

OneControllerTwoBrokersReplicationFactorTwo spins up a 1+2 cluster and creates a replication-factor-2 topic so the produce path forces inter- broker replication. A successful round-trip proves brokers can reach each other over the engine network without explicit peer bindings.

Return Type
Void !
Example
dagger -m github.com/z5labs/devex/daggerverse/kafka/tests@9ebfb29b95cb654ed5d00d1e595bcf710c2a7318 call \
 one-controller-two-brokers-replication-factor-two
func (m *MyModule) Example(ctx context.Context)   {
	return dag.
			Tests().
			Onecontrollertwobrokersreplicationfactortwo(ctx)
}
@function
async def example() -> None:
	return await (
		dag.tests()
		.onecontrollertwobrokersreplicationfactortwo()
	)
@func()
async example(): Promise<void> {
	return dag
		.tests()
		.oneControllerTwoBrokersReplicationFactorTwo()
}

plaintextSecurityProfilesAreNonNil() 🔗

Return Type
Void !
Example
dagger -m github.com/z5labs/devex/daggerverse/kafka/tests@9ebfb29b95cb654ed5d00d1e595bcf710c2a7318 call \
 plaintext-security-profiles-are-non-nil
func (m *MyModule) Example(ctx context.Context)   {
	return dag.
			Tests().
			Plaintextsecurityprofilesarenonnil(ctx)
}
@function
async def example() -> None:
	return await (
		dag.tests()
		.plaintextsecurityprofilesarenonnil()
	)
@func()
async example(): Promise<void> {
	return dag
		.tests()
		.plaintextSecurityProfilesAreNonNil()
}

produceConsumeRoundTripBase64() 🔗

ProduceConsumeRoundTripBase64 round-trips the same kind of binary payload through standard base64 (with padding).

Return Type
Void !
Example
dagger -m github.com/z5labs/devex/daggerverse/kafka/tests@9ebfb29b95cb654ed5d00d1e595bcf710c2a7318 call \
 produce-consume-round-trip-base-6-4
func (m *MyModule) Example(ctx context.Context)   {
	return dag.
			Tests().
			Produceconsumeroundtripbase64(ctx)
}
@function
async def example() -> None:
	return await (
		dag.tests()
		.produceconsumeroundtripbase64()
	)
@func()
async example(): Promise<void> {
	return dag
		.tests()
		.produceConsumeRoundTripBase64()
}

produceConsumeRoundTripHex() 🔗

ProduceConsumeRoundTripHex round-trips a binary payload through hex encoding. The non-UTF-8 bytes (including 0x00) verify that hex transports arbitrary binary safely.

Return Type
Void !
Example
dagger -m github.com/z5labs/devex/daggerverse/kafka/tests@9ebfb29b95cb654ed5d00d1e595bcf710c2a7318 call \
 produce-consume-round-trip-hex
func (m *MyModule) Example(ctx context.Context)   {
	return dag.
			Tests().
			Produceconsumeroundtriphex(ctx)
}
@function
async def example() -> None:
	return await (
		dag.tests()
		.produceconsumeroundtriphex()
	)
@func()
async example(): Promise<void> {
	return dag
		.tests()
		.produceConsumeRoundTripHex()
}

produceConsumeRoundTripRaw() 🔗

ProduceConsumeRoundTripRaw produces a single record with raw-encoded key and value, then consumes it back and asserts byte equality. The raw encoding round-trips Go strings verbatim, so the assertion is direct string equality.

Return Type
Void !
Example
dagger -m github.com/z5labs/devex/daggerverse/kafka/tests@9ebfb29b95cb654ed5d00d1e595bcf710c2a7318 call \
 produce-consume-round-trip-raw
func (m *MyModule) Example(ctx context.Context)   {
	return dag.
			Tests().
			Produceconsumeroundtripraw(ctx)
}
@function
async def example() -> None:
	return await (
		dag.tests()
		.produceconsumeroundtripraw()
	)
@func()
async example(): Promise<void> {
	return dag
		.tests()
		.produceConsumeRoundTripRaw()
}

produceRejectsUnknownEncoding() 🔗

ProduceRejectsUnknownEncoding verifies that a Produce call with a bogus encoding name fails fast rather than silently misbehaving.

Return Type
Void !
Example
dagger -m github.com/z5labs/devex/daggerverse/kafka/tests@9ebfb29b95cb654ed5d00d1e595bcf710c2a7318 call \
 produce-rejects-unknown-encoding
func (m *MyModule) Example(ctx context.Context)   {
	return dag.
			Tests().
			Producerejectsunknownencoding(ctx)
}
@function
async def example() -> None:
	return await (
		dag.tests()
		.producerejectsunknownencoding()
	)
@func()
async example(): Promise<void> {
	return dag
		.tests()
		.produceRejectsUnknownEncoding()
}

propertiesFileContainsBootstrapAndSecurityProtocol() 🔗

PropertiesFileContainsBootstrapAndSecurityProtocol verifies that the rendered Java client.properties file carries the bootstrap.servers list and a plaintext security.protocol entry — enough for the Apache Kafka CLI tools to pick up the connection settings.

Return Type
Void !
Example
dagger -m github.com/z5labs/devex/daggerverse/kafka/tests@9ebfb29b95cb654ed5d00d1e595bcf710c2a7318 call \
 properties-file-contains-bootstrap-and-security-protocol
func (m *MyModule) Example(ctx context.Context)   {
	return dag.
			Tests().
			Propertiesfilecontainsbootstrapandsecurityprotocol(ctx)
}
@function
async def example() -> None:
	return await (
		dag.tests()
		.propertiesfilecontainsbootstrapandsecurityprotocol()
	)
@func()
async example(): Promise<void> {
	return dag
		.tests()
		.propertiesFileContainsBootstrapAndSecurityProtocol()
}

singleNodeClusterStarts() 🔗

SingleNodeClusterStarts spins up the smallest split-role cluster (one controller + one broker) and forces the server-side Cluster constructor to run by resolving BootstrapServers, asserting only that the broker hostname is non-empty. End-to-end reachability is covered by sibling tests that exercise ListTopics / produce / consume.

Return Type
Void !
Example
dagger -m github.com/z5labs/devex/daggerverse/kafka/tests@9ebfb29b95cb654ed5d00d1e595bcf710c2a7318 call \
 single-node-cluster-starts
func (m *MyModule) Example(ctx context.Context)   {
	return dag.
			Tests().
			Singlenodeclusterstarts(ctx)
}
@function
async def example() -> None:
	return await (
		dag.tests()
		.singlenodeclusterstarts()
	)
@func()
async example(): Promise<void> {
	return dag
		.tests()
		.singleNodeClusterStarts()
}