Run the conformance suite¶
The suite is go/messaging's conformance.RunDurable, the same one every durable backend runs
(the backend contract). The adapter runs
it against RabbitMQ in a container, from ./test/integration.
Run it¶
You need a Docker daemon and a checkout of the adapter.
just test-integration is the same command. Without INT_TEST_INTEGRATION=1 the package prints a
skip line and exits 0, so a plain go test ./... needs no Docker. The unit tests under ./... need
nothing.
TestMain starts one container from rabbitmq:4.3.5-management with testcontainers-go and shares it
across every test. Set INT_TEST_LOG=1 to give the backend a text logger on stderr. CI runs this
package in the go-test component's Docker-in-Docker job with a 25 minute timeout, because the suite
includes a container restart.
What it runs¶
TestConformance:RunDurableonce per wire format,binary,structured,masstransitandnservicebus, each on its own exchange and queue prefix so one run's queues do not fill under the next. The interop formats read behind the default chain, so their runs also prove the formats tell each other apart. The run passesWithKillableandWithForeign, so the link-death row and the unreadable-message row run too.TestTopologyTheOperatorGotWrongIsRefused: builds each wrong queue the suite's fixture never would (absent, classic, no dead-letter exchange, wrong strategy, wrong overflow, low limit, unbound pattern) and checks the refusal names what was found. The suite cannot reach those branches because its fixture builds correct topology.TestAMissingQueueIsRefusedWithTheSentinel,TestAnUnroutablePublishIsRefused,TestAPublishIsWrittenWithTheFormat,TestAnInteropFormatIsWhatGoesOutandTestAHeaderNoFormatTakesIsForeign: the adapter's own checks of what the suite does not.
How the fixture stands in for an operator¶
The fixture implements conformance.Durable, Binder, Immutable, Foreign and the killer:
Opendeclares the topic exchange and returns a backend whoseTopologyis the fixture.Queue, on first resolve of a durable name, declares a quorum queue with a dead-letter fanout exchange and quorum queue of its own,at-least-oncestrategy,reject-publishoverflow and a delivery limit ofMaxDeliver - 1, and binds the subscription's pattern. It never changes a queue it already made, so a changedMaxDeliveror pattern on reopen is the module's to refuse.Restartstops and starts the same container, which keeps its node name and data.ImmutableFieldsreturnsPatternandMaxDeliver: the pattern is the binding's, andMaxDeliveris held to the delivery limit.AckWaitis the adapter's own andStartAtdoes not exist here.Killdeletes the queue, which cancels its consumers withbasic.cancel, the same message the broker sends for a delivery acknowledgement timeout.SendUnreadablepublishes straight to the exchange past the bus's writer: bytes that are no event, a message both CloudEvents formats claim, and one that is claimed but malformed.
Run it against your own broker¶
The container and its URLs are fixed in test/integration/main_test.go; there is no setting for an
external broker. To test another RabbitMQ version, change the image constant there. The suite then
proves the adapter against that version, which Tested versions
does not claim for any other.