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 ¶
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.
const OptIn = "MQ_STUDIO_E2E"
OptIn is the variable a developer sets to run the live suites locally.
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.
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 ¶
var AllFamilies = []Family{ RocketMQ, RabbitMQ, Kafka, Pulsar, Redis, MQTT, NATS, ActiveMQ, NSQ, SQS, GooglePubSub, AzureServiceBus, Kinesis, IBMMQ, Solace, }
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 DockerContainer ¶
DockerContainer probes an environment the test drives with docker exec rather than over the wire, where a reachable port is not enough.
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" )