Merge lp:~esteve/txamqp/400760-update-testsuite-to-rabbitmq-1.6.0 into lp:txamqp

Proposed by Esteve Fernandez
Status: Merged
Merge reported by: Esteve Fernandez
Merged at revision: not available
Proposed branch: lp:~esteve/txamqp/400760-update-testsuite-to-rabbitmq-1.6.0
Merge into: lp:txamqp
Diff against target: None lines
To merge this branch: bzr merge lp:~esteve/txamqp/400760-update-testsuite-to-rabbitmq-1.6.0
Reviewer Review Type Date Requested Status
Thomas Herve Needs Fixing
Review via email: mp+8950@code.launchpad.net
To post a comment you must log in.
Revision history for this message
Esteve Fernandez (esteve) wrote :
Revision history for this message
Thomas Herve (therve) wrote :

So, it's a nice thing to do, but it will break with every other RabbitMQ installations.

I saw that the production and the version of RabbitMQ is present in the connection message: we can easily create a custom TwistedDelegate class for the tests, which would overwrite connection_start and get those values? What do you think?

review: Needs Fixing
Revision history for this message
Esteve Fernandez (esteve) wrote :

> So, it's a nice thing to do, but it will break with every other RabbitMQ
> installations.

Yes, but we cannot support all old versions of every broker out there. For example, RabbitMQ added support for queue.unbind in 1.5.0, and so the testsuite is broken with 1.4.0, and I don't think that's a problem.

> I saw that the production and the version of RabbitMQ is present in the
> connection message: we can easily create a custom TwistedDelegate class for
> the tests, which would overwrite connection_start and get those values? What
> do you think?

I think that's a bit too complicated, why not just define another broker in testlib.py (e.g. RABBITMQ_1.6) and make it the default one? I still prefer supporting the latest version of RabbitMQ, rather than adding hacks for older installations, though.

Revision history for this message
Thomas Herve (therve) wrote :

> I think that's a bit too complicated, why not just define another broker in
> testlib.py (e.g. RABBITMQ_1.6) and make it the default one? I still prefer
> supporting the latest version of RabbitMQ, rather than adding hacks for older
> installations, though.

OK, so let's do the other way around: add a RABBITMQ_15 broker, and keep the supportedBrokers directive on the headers test and add RABBITMQ to it (RABBITMQ being implicitly the latest version).

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'src/txamqp/spec.py'
2--- src/txamqp/spec.py 2009-07-09 21:28:09 +0000
3+++ src/txamqp/spec.py 2009-07-17 16:04:44 +0000
4@@ -244,10 +244,14 @@
5 l.add(Field(f_nd["@name"], f_nd.index(), type, get_docs(f_nd)))
6
7 def load(specfile):
8- return loadString(open(specfile).read(), specfilename=specfile.name)
9+ doc = xmlutil.parse(specfile)
10+ return loadFromDoc(doc, specfilename=specfile)
11
12 def loadString(specfilestr, specfilename=None):
13 doc = xmlutil.parseString(specfilestr)
14+ return loadFromDoc(doc, specfilename=specfilename)
15+
16+def loadFromDoc(doc, specfilename=None):
17 root = doc["amqp"][0]
18 spec = Spec(int(root["@major"]), int(root["@minor"]), specfilename)
19
20
21=== modified file 'src/txamqp/test/test_basic.py'
22--- src/txamqp/test/test_basic.py 2009-06-17 16:00:54 +0000
23+++ src/txamqp/test/test_basic.py 2009-07-17 16:22:36 +0000
24@@ -249,7 +249,6 @@
25 self.fail("Got unexpected message in original queue: " + extra.content.body)
26 except Empty: None
27
28- @supportedBrokers(QPID, OPENAMQ)
29 @inlineCallbacks
30 def test_qos_prefetch_count(self):
31 """
32
33=== modified file 'src/txamqp/test/test_exchange.py'
34--- src/txamqp/test/test_exchange.py 2009-06-17 16:00:54 +0000
35+++ src/txamqp/test/test_exchange.py 2009-07-17 16:22:36 +0000
36@@ -109,7 +109,6 @@
37 yield self.exchange_declare(0, exchange="t", type="topic")
38 yield self.verifyTopicExchange("t")
39
40- @supportedBrokers(QPID, OPENAMQ)
41 @inlineCallbacks
42 def testHeaders(self):
43 """Declare and test a headers exchange"""
44@@ -139,7 +138,6 @@
45 def testAmqTopic(self):
46 yield self.verifyTopicExchange("amq.topic")
47
48- @supportedBrokers(QPID, OPENAMQ)
49 @inlineCallbacks
50 def testAmqMatch(self):
51 yield self.verifyHeadersExchange("amq.match")
52@@ -301,7 +299,6 @@
53 def myBasicPublish(self, headers):
54 self.channel.basic_publish(exchange="amq.match", content=Content("foobar", properties={'headers':headers}))
55
56- @supportedBrokers(QPID, OPENAMQ)
57 @inlineCallbacks
58 def testMatchAll(self):
59 yield self.channel.queue_bind(queue="q", exchange="amq.match", arguments={ 'x-match':'all', "name":"fred", "age":3})
60@@ -315,7 +312,6 @@
61 self.myBasicPublish({"name":"fred", "age":2})
62 yield self.assertEmpty(self.q)
63
64- @supportedBrokers(QPID, OPENAMQ)
65 @inlineCallbacks
66 def testMatchAny(self):
67 yield self.channel.queue_bind(queue="q", exchange="amq.match", arguments={ 'x-match':'any', "name":"fred", "age":3})

Subscribers

People subscribed via source and target branches

to status/vote changes: