Skip to content

Commit cb604e0

Browse files
authored
add component certification test for pubsub.rabbitmq (#1240)
1 parent 6e48068 commit cb604e0

File tree

8 files changed

+2350
-0
lines changed

8 files changed

+2350
-0
lines changed
Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
# RabbitMQ certifcation testing
2+
3+
This project aims to test the RabbitMQ Pub/Sub component under various conditions.
4+
5+
## Test plan
6+
7+
* Bring up a RabbitMQ cluster
8+
* Test single publisher / single subscriber
9+
* Start an app with one publisher and one subscriber
10+
* The publisher advertises to 3 topic
11+
* The subscriber is subscribed to 2 topics
12+
* Test: Sends 1000+ unique messages with keys set
13+
* App: Simulates periodic errors
14+
* Component: Retries on error
15+
* App: Observes successful messages
16+
* Test: Confirms that all expected messages were received
17+
* Test: Confirms that subscriber does not receive messages from the non-subscribed topic
18+
* Test single publisher / multiple subscribers with same consumer ID
19+
* Start one publisher and one subscriber with consumer ID "A"
20+
* Verify equality between sent and received messages
21+
* Start second subscriber with consumer ID "A"
22+
* Verify that *total number* of received messages by *both subscribers* equals to the number of successfully published messages
23+
* Test single publisher / multiple subscribers with distinct consumer IDs
24+
* Start one publisher, one subscriber with consumer ID "A", and two subscribers with consumer ID "B"
25+
* Verify that the number of published messages equals to the sum of:
26+
* the number of messages received by subscriber "A"
27+
* the total number of the messages received by subscribers "B"
28+
* App: Simulates periodic errors
29+
* Component: Retries on error
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
apiVersion: dapr.io/v1alpha1
2+
kind: Component
3+
metadata:
4+
name: mq-alpha
5+
spec:
6+
type: pubsub.rabbitmq
7+
version: v1
8+
metadata:
9+
- name: consumerID
10+
value: alpha
11+
- name: host
12+
value: "amqp://test:test@localhost:5672"
13+
- name: durable
14+
value: true
15+
- name: deletedWhenUnused
16+
value: true
17+
- name: requeueInFailure
18+
value: true
19+
- name: backOffMaxRetries
20+
value: -1
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
apiVersion: dapr.io/v1alpha1
2+
kind: Component
3+
metadata:
4+
name: mq-beta
5+
spec:
6+
type: pubsub.rabbitmq
7+
version: v1
8+
metadata:
9+
- name: consumerID
10+
value: beta
11+
- name: host
12+
value: "amqp://test:test@localhost:5672"
13+
- name: durable
14+
value: true
15+
- name: deletedWhenUnused
16+
value: true
17+
- name: requeueInFailure
18+
value: true
19+
- name: backOffMaxRetries
20+
value: -1
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
apiVersion: dapr.io/v1alpha1
2+
kind: Configuration
3+
metadata:
4+
name: pubsub
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
version: "3.7"
2+
services:
3+
rabbitmq:
4+
image: rabbitmq:3-management-alpine
5+
container_name: 'rabbitmq'
6+
ports:
7+
- 5672:5672
8+
- 15672:15672
9+
networks:
10+
- rabbitmq_go_net
11+
environment:
12+
RABBITMQ_DEFAULT_USER: test
13+
RABBITMQ_DEFAULT_PASS: test
14+
hostname: rmq
15+
16+
networks:
17+
rabbitmq_go_net:
18+
driver: bridge
Lines changed: 108 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,108 @@
1+
module github.com/dapr/components-contrib/tests/certification/pubsub/rabbitmq
2+
3+
go 1.17
4+
5+
require (
6+
github.com/dapr/components-contrib v1.4.0-rc2
7+
github.com/dapr/components-contrib/tests/certification v0.0.0-20211022173956-72754c603665
8+
github.com/dapr/dapr v1.4.4-0.20211026235832-5e8d7275a35e
9+
github.com/dapr/go-sdk v1.2.1-0.20211017032306-de68193d5cd9
10+
github.com/dapr/kit v0.0.2-0.20210614175626-b9074b64d233
11+
github.com/stretchr/testify v1.7.0
12+
go.uber.org/multierr v1.7.0
13+
)
14+
15+
require (
16+
contrib.go.opencensus.io/exporter/prometheus v0.2.0 // indirect
17+
contrib.go.opencensus.io/exporter/zipkin v0.1.1 // indirect
18+
github.com/AdhityaRamadhanus/fasthttpcors v0.0.0-20170121111917-d4c07198763a // indirect
19+
github.com/PuerkitoBio/purell v1.1.1 // indirect
20+
github.com/PuerkitoBio/urlesc v0.0.0-20170810143723-de5bf2ad4578 // indirect
21+
github.com/alecthomas/template v0.0.0-20190718012654-fb15b899a751 // indirect
22+
github.com/alecthomas/units v0.0.0-20190924025748-f65c72e2690d // indirect
23+
github.com/andybalholm/brotli v1.0.2 // indirect
24+
github.com/antlr/antlr4 v0.0.0-20200503195918-621b933c7a7f // indirect
25+
github.com/armon/go-metrics v0.0.0-20190430140413-ec5e00d3c878 // indirect
26+
github.com/beorn7/perks v1.0.1 // indirect
27+
github.com/cenkalti/backoff v2.2.1+incompatible // indirect
28+
github.com/cenkalti/backoff/v4 v4.1.1 // indirect
29+
github.com/cespare/xxhash/v2 v2.1.1 // indirect
30+
github.com/davecgh/go-spew v1.1.1 // indirect
31+
github.com/fasthttp/router v1.3.8 // indirect
32+
github.com/ghodss/yaml v1.0.0 // indirect
33+
github.com/go-logr/logr v0.3.0 // indirect
34+
github.com/gogo/protobuf v1.3.2 // indirect
35+
github.com/golang/groupcache v0.0.0-20200121045136-8c9f03a8e57e // indirect
36+
github.com/golang/protobuf v1.5.2 // indirect
37+
github.com/google/cel-go v0.7.3 // indirect
38+
github.com/google/go-cmp v0.5.6 // indirect
39+
github.com/google/gofuzz v1.1.0 // indirect
40+
github.com/google/uuid v1.2.0 // indirect
41+
github.com/googleapis/gnostic v0.5.1 // indirect
42+
github.com/grandcat/zeroconf v0.0.0-20190424104450-85eadb44205c // indirect
43+
github.com/grpc-ecosystem/go-grpc-middleware v1.2.2 // indirect
44+
github.com/hashicorp/consul/api v1.3.0 // indirect
45+
github.com/hashicorp/errwrap v1.0.0 // indirect
46+
github.com/hashicorp/go-cleanhttp v0.5.1 // indirect
47+
github.com/hashicorp/go-immutable-radix v1.0.0 // indirect
48+
github.com/hashicorp/go-multierror v1.1.1 // indirect
49+
github.com/hashicorp/go-rootcerts v1.0.0 // indirect
50+
github.com/hashicorp/golang-lru v0.5.4 // indirect
51+
github.com/hashicorp/serf v0.8.2 // indirect
52+
github.com/imdario/mergo v0.3.10 // indirect
53+
github.com/json-iterator/go v1.1.11 // indirect
54+
github.com/klauspost/compress v1.12.2 // indirect
55+
github.com/matttproud/golang_protobuf_extensions v1.0.2-0.20181231171920-c182affec369 // indirect
56+
github.com/miekg/dns v1.1.35 // indirect
57+
github.com/minio/blake2b-simd v0.0.0-20160723061019-3f5f724cb5b1 // indirect
58+
github.com/mitchellh/go-homedir v1.1.0 // indirect
59+
github.com/mitchellh/mapstructure v1.4.1 // indirect
60+
github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd // indirect
61+
github.com/modern-go/reflect2 v1.0.1 // indirect
62+
github.com/openzipkin/zipkin-go v0.2.2 // indirect
63+
github.com/pkg/errors v0.9.1 // indirect
64+
github.com/pmezard/go-difflib v1.0.0 // indirect
65+
github.com/prometheus/client_golang v1.9.0 // indirect
66+
github.com/prometheus/client_model v0.2.0 // indirect
67+
github.com/prometheus/common v0.15.0 // indirect
68+
github.com/prometheus/procfs v0.6.0 // indirect
69+
github.com/prometheus/statsd_exporter v0.15.0 // indirect
70+
github.com/savsgio/gotils v0.0.0-20210217112953-d4a072536008 // indirect
71+
github.com/sirupsen/logrus v1.8.1 // indirect
72+
github.com/spf13/pflag v1.0.5 // indirect
73+
github.com/stoewer/go-strcase v1.2.0 // indirect
74+
github.com/streadway/amqp v1.0.0 // indirect
75+
github.com/valyala/bytebufferpool v1.0.0 // indirect
76+
github.com/valyala/fasthttp v1.28.0 // indirect
77+
go.opencensus.io v0.22.5 // indirect
78+
go.opentelemetry.io/otel v0.19.0 // indirect
79+
go.uber.org/atomic v1.8.0 // indirect
80+
golang.org/x/crypto v0.0.0-20210616213533-5ff15b29337e // indirect
81+
golang.org/x/net v0.0.0-20210614182718-04defd469f4e // indirect
82+
golang.org/x/oauth2 v0.0.0-20210220000619-9bb904979d93 // indirect
83+
golang.org/x/sys v0.0.0-20210616094352-59db8d763f22 // indirect
84+
golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1 // indirect
85+
golang.org/x/text v0.3.6 // indirect
86+
golang.org/x/time v0.0.0-20210220033141-f8bda1e9f3ba // indirect
87+
google.golang.org/appengine v1.6.6 // indirect
88+
google.golang.org/genproto v0.0.0-20210524171403-669157292da3 // indirect
89+
google.golang.org/grpc v1.40.0 // indirect
90+
google.golang.org/protobuf v1.27.1 // indirect
91+
gopkg.in/alecthomas/kingpin.v2 v2.2.6 // indirect
92+
gopkg.in/inf.v0 v0.9.1 // indirect
93+
gopkg.in/yaml.v2 v2.4.0 // indirect
94+
gopkg.in/yaml.v3 v3.0.0-20210107192922-496545a6307b // indirect
95+
k8s.io/api v0.20.0 // indirect
96+
k8s.io/apiextensions-apiserver v0.20.0 // indirect
97+
k8s.io/apimachinery v0.20.0 // indirect
98+
k8s.io/client-go v0.20.0 // indirect
99+
k8s.io/klog/v2 v2.4.0 // indirect
100+
k8s.io/utils v0.0.0-20201110183641-67b214c5f920 // indirect
101+
sigs.k8s.io/controller-runtime v0.7.0 // indirect
102+
sigs.k8s.io/structured-merge-diff/v4 v4.0.2 // indirect
103+
sigs.k8s.io/yaml v1.2.0 // indirect
104+
)
105+
106+
replace github.com/dapr/components-contrib/tests/certification => ../../
107+
108+
replace github.com/dapr/components-contrib => ../../../../

0 commit comments

Comments
 (0)