Run the conformance suite against LocalStack¶
The suite is go/messaging's conformance.RunDurable,
run against both Standard and FIFO in a LocalStack container. It lives in the adapter's repository,
under test/integration.
What you need¶
- a clone of gitlab.com/phpboyscout/go/messaging-sqs;
- a Docker daemon. The tests start
localstack/localstack:4.14.0themselves with testcontainers-go, and need no AWS account or credentials.
Run it¶
Without INT_TEST_INTEGRATION=1 the package prints that it was skipped and exits 0, so a plain
go test ./... needs no Docker. just test-integration runs the same command with -timeout 45m.
The full run takes about fifty minutes, so pass a longer timeout as above; CI gives the job ninety minutes.
Set INT_TEST_LOG=1 to send the adapter's log to stderr while it runs.
Run one suite¶
The suite runs once per format and per variety. Pick one with -run:
| Test | Variety | Writer |
|---|---|---|
TestFIFOConformance |
FIFO | CloudEvents binary |
TestStandardConformance |
Standard | CloudEvents binary |
TestFIFOStructured |
FIFO | CloudEvents structured |
TestStandardStructured |
Standard | CloudEvents structured |
TestMassTransitFIFO |
FIFO | MassTransit |
TestMassTransitStd |
Standard | MassTransit |
TestNServiceBusFIFO |
FIFO | NServiceBus |
TestNServiceBusStd |
Standard | NServiceBus |
$ INT_TEST_INTEGRATION=1 go test ./test/integration/... -run 'TestStandardConformance' -v -timeout 30m
They are separate tests, not subtests, because the suite derives durable names from the test's name and the longest are already at SQS's eighty characters. That is why the interop tests are named format first.
Beside the suites, refusals_test.go, format_test.go, foreign_test.go and shortened_test.go
hold the adapter's own checks: a missing topic and a missing queue are refused, at-most-once deletes
before hand-off, a retried publish is stored once on FIFO and twice on Standard, an eleven-attribute
event and a non-UTF-8 payload need structured, and a shortened delay reaches DelayShortened.
What the fixture is¶
The tests pass the suite a fixture that plays the operator. It is a Topology that creates each
topic, queue, dead-letter queue, redrive policy and subscription the first time the adapter asks for
it, with the redrive limit taken from the subscription's MaxDeliver, and never changes one it has made.
A changed MaxDeliver on reopen is then the adapter's to refuse, as in a deployment.
It implements the suite's optional interfaces:
| Interface | What the fixture says |
|---|---|
Durable |
Open builds a backend over the same container. Restart does nothing at the service: durability across a vendor's own restart is the vendor's claim, and the community image keeps nothing across a container restart. What the rows prove is that a consumer's restart loses no message and no attempt count |
Granular |
the smallest lease is two seconds: visibility is whole seconds and the emulator's sweep runs about a second late |
Immutable |
MaxDeliver is the only field the adapter refuses to see changed. AckWait is a per-receive parameter, a different pattern is a different topic, and StartAt does not exist here |
Killable |
the queue is deleted, because SQS has no link to take away. The next receive fails with QueueDoesNotExist, which ends the source |
Foreign |
SendUnreadable publishes straight to the subject's topic with raw attributes, past the adapter's writer, so the suite can prove an unreadable message never reaches a handler |
It also waits between rows for the emulator's delivery backlog on each FIFO topic to drain, by watching a queue of its own on the topic, because LocalStack delivers a FIFO topic's backlog far slower than it accepts publishes.
Each run uses a one-character prefix on its topics and queues to keep its names apart from another run's.
What it does not prove¶
It runs against LocalStack. LocalStack does not enforce an SQS queue policy or SNS's rule that a message is UTF-8 text, so the adapter refuses the second itself, and the first is untested here. Real AWS is not in the pipeline. See Tested versions.