e2e

package
v0.4.2 Latest Latest
Warning

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

Go to latest
Published: Oct 31, 2026 License: Apache-2.0 Imports: 9 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.

Documentation

Overview

Package e2e gates the tests that need a real broker.

It is imported only from _test.go files. It exists because the rule it carries was written four times, once per package, and the copies disagreed: two of them consulted the opt-in variable before probing anything, so the whole app-layer suite skipped every CI run from the day it was written (issue #48).

Index

Constants

View Source
const NoFamilies = "none"

NoFamilies is the value a run sets to claim nothing at all - the unit job, which starts no broker. It is a word rather than the empty string on purpose: an empty value is far more likely to be a variable somebody meant to fill in, and silently claiming nothing is the shape of #48.

View Source
const OptIn = "MQ_STUDIO_E2E"

OptIn is the variable a developer sets to run the live suites locally.

View Source
const ShardVar = "MQ_STUDIO_E2E_FAMILIES"

ShardVar names the families the current run is responsible for, so CI can split the live suites across jobs that each start one broker family. Unset means every family, which is what a local run and any unsharded run get.

View Source
const SkipMarker = "[e2e-gate]"

SkipMarker prefixes every skip this gate produces. The CI coverage check greps for it to tell a test no shard claimed - a sharding bug - from a test that skipped itself because the broker lacks the feature it covers, which is a deliberate omission and not a regression.

Variables

AllFamilies is the list every other place derives from - the CI shard matrix included, which a test in this package pins against it. Enumerating families twice is how the lists drift apart.

Functions

func DialTCP

func DialTCP(address string) func() error

DialTCP probes an environment by opening a connection to one of its ports.

func DockerContainer

func DockerContainer(name string) func() error

DockerContainer probes an environment the test drives with docker exec rather than over the wire, where a reachable port is not enough.

func HTTPGet

func HTTPGet(url string) func() error

HTTPGet probes an environment through its management API.

func Missing

func Missing(t *testing.T, format string, args ...any)

Missing reports a precondition the environment answered the probe but did not provide - an unseeded group, a broker that then refused the connection. Same rule as Require: a failure in CI, a skip with the remedy locally.

func Require

func Require(t *testing.T, env Env)

Require skips the test when env is absent, and fails instead when CI is set.

Types

type Env

type Env struct {
	// Name reads inside a sentence: "kafka is not running".
	Name string
	// Family is which broker family Name belongs to. Required: a test whose
	// environment declares none cannot be claimed by any shard, and would go
	// unrun rather than red.
	Family Family
	// Start is the npm script that brings it up.
	Start string
	// Probe reports whether the environment is answering.
	Probe func() error
}

Env is one broker environment a live test needs.

type Family added in v0.0.6

type Family string

Family is the broker family an environment belongs to. CI shards on it, so it is also the unit in which live coverage is accounted for.

const (
	RocketMQ Family = "rocketmq"
	RabbitMQ Family = "rabbitmq"
	Kafka    Family = "kafka"
	Pulsar   Family = "pulsar"
	Redis    Family = "redis"
	MQTT     Family = "mqtt"
	NATS     Family = "nats"
	ActiveMQ Family = "activemq"
	NSQ      Family = "nsq"
	SQS      Family = "sqs"
	// GooglePubSub is spelled with the vendor because "pubsub" alone names
	// the pattern rather than the product, and two other families here are
	// publish/subscribe too.
	GooglePubSub Family = "google-pubsub"
	// AzureServiceBus is spelled with the vendor for the same reason: a
	// service bus is a pattern, and this is one vendor's product.
	AzureServiceBus Family = "azure-servicebus"
	Kinesis         Family = "kinesis"
	// IBMMQ is spelled with the vendor because "mq" on its own names every
	// family in this app rather than this one.
	IBMMQ Family = "ibmmq"
	// Solace is the vendor rather than the product, which is PubSub+: the
	// product name carries a character no shard variable should have to
	// survive, and no other family here is Solace's.
	Solace Family = "solace"
)

Jump to

Keyboard shortcuts

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