Merge lp:~fginther/core-image-tester/snappy-queue-updates into lp:~canonical-ci-engineering/core-image-tester/snappy-proposed-migration

Proposed by Francis Ginther
Status: Merged
Approved by: Francis Ginther
Approved revision: 37
Merged at revision: 36
Proposed branch: lp:~fginther/core-image-tester/snappy-queue-updates
Merge into: lp:~canonical-ci-engineering/core-image-tester/snappy-proposed-migration
Diff against target: 66 lines (+17/-17)
2 files modified
core_image_tester/constants.py (+15/-16)
core_image_tester/tests/test_queue_integration.py (+2/-1)
To merge this branch: bzr merge lp:~fginther/core-image-tester/snappy-queue-updates
Reviewer Review Type Date Requested Status
Paul Larson Approve
Joe Talbott (community) Approve
Review via email: mp+259992@code.launchpad.net

Commit message

Rename queues for snappy-proposed-migration version of core-image-tester.

Description of the change

Rename queues for snappy-proposed-migration version of core-image-tester.

To post a comment you must log in.
37. By Francis Ginther

Use constants for the queue names in the tests too.

Revision history for this message
Joe Talbott (joetalbott) wrote :

LGTM

review: Approve
Revision history for this message
Paul Larson (pwlars) wrote :

One suggestion, but it's not a blocker for me, so +1

review: Approve
Revision history for this message
Francis Ginther (fginther) wrote :

Paul, thanks for the review. My reasoning for using .format(SOLUTION_NAME) is to make it painfully obvious how the queues are named and hopefully make it easier for anyone copying this code in the future to use it for a new solution.

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'core_image_tester/constants.py'
2--- core_image_tester/constants.py 2015-05-21 21:41:49 +0000
3+++ core_image_tester/constants.py 2015-05-22 21:15:17 +0000
4@@ -19,24 +19,9 @@
5
6
7 """Constants for this service."""
8-# Queue names are constant, rather than being defined in the config.
9-
10-# The queue we listen to for new payloads to check:
11-INPUT_QUEUE = "core.tests.v1"
12-
13-# The queue we put fatally error'd payloads into:
14-DEAD_LETTER_QUEUE = "core.deadletters.v1"
15-
16-# The queue we put payloads on to re-run the test:
17-TEST_RETRY_QUEUE = "core.tests.v1"
18-
19-# The queue we put results on:
20-DONE_QUEUE = "core.result.v1"
21-
22-
23 RETRY_COUNT = 3
24
25-SOLUTION_NAME = "snappy-image-tests"
26+SOLUTION_NAME = "snappy-proposed-migration"
27
28 SERVICE_NAME = "core-image-tester"
29
30@@ -47,3 +32,17 @@
31 'service': SERVICE_NAME,
32 'hostname': HOSTNAME,
33 }
34+
35+# Queue names are constant, rather than being defined in the config.
36+
37+# The queue we listen to for new payloads to check:
38+INPUT_QUEUE = "{}.tests.v1".format(SOLUTION_NAME)
39+
40+# The queue we put fatally error'd payloads into:
41+DEAD_LETTER_QUEUE = "{}.deadletters.v1".format(SOLUTION_NAME)
42+
43+# The queue we put payloads on to re-run the test:
44+TEST_RETRY_QUEUE = "{}.tests.v1".format(SOLUTION_NAME)
45+
46+# The queue we put results on:
47+DONE_QUEUE = "{}.result.v1".format(SOLUTION_NAME)
48
49=== modified file 'core_image_tester/tests/test_queue_integration.py'
50--- core_image_tester/tests/test_queue_integration.py 2015-04-07 19:54:41 +0000
51+++ core_image_tester/tests/test_queue_integration.py 2015-05-22 21:15:17 +0000
52@@ -22,6 +22,7 @@
53
54
55 from core_image_tester.queue import CoreImageTesterQueueMonitor
56+from core_image_tester import constants
57
58
59 class KombuQueueIntegrationTests(TestCase):
60@@ -68,5 +69,5 @@
61
62
63 def queue_message(conn, message):
64- q = conn.SimpleQueue('core.tests.v1')
65+ q = conn.SimpleQueue(constants.INPUT_QUEUE)
66 q.put(message)

Subscribers

People subscribed via source and target branches