Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: added option to specify error pubtopic (#102)
* feat: added option to specify error pubtopic * simplified; added tests and debug statements * misc fixes * autopropagate errors in other test modules * maintain current ergo error queue auto delete status quo for now * updated ergo graph * updated version * pinned importlib-metadata to 4.13.0 Co-authored-by: Zach Schubert <zschubert@nautiluslabs.co>
- Loading branch information
1 parent
e9da646
commit 75788fe
Showing
13 changed files
with
109 additions
and
11 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -12,3 +12,4 @@ requests | |
docker | ||
pytest | ||
pytest-timeout | ||
importlib-metadata==4.13.0 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -7,7 +7,7 @@ | |
import subprocess | ||
import sys | ||
|
||
VERSION = '0.10.1' | ||
VERSION = '0.11.0' | ||
|
||
|
||
def get_version() -> str: | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
from ergo.message import Message | ||
|
||
from test.integration.utils.amqp import AMQPComponent, Queue, publish | ||
|
||
|
||
def assert_false(): | ||
assert False | ||
|
||
|
||
def test_no_error_pubtopic(): | ||
component = AMQPComponent(assert_false) | ||
error_queue = Queue(name=component.error_queue_name, auto_delete=False) | ||
with component, error_queue: | ||
publish({}, component.subtopic) | ||
error_message = error_queue.get() | ||
|
||
assert isinstance(error_message, Message) | ||
assert error_message.error['type'] == 'AssertionError' | ||
|
||
|
||
def test_error_pubtopic(): | ||
error_key = 'test.error_pubtopic' | ||
component = AMQPComponent(assert_false, error_pubtopic=error_key) | ||
error_queue = Queue(name=component.error_queue_name, auto_delete=False) | ||
error_pubtopic = Queue(routing_key=error_key) | ||
with component, error_queue, error_pubtopic: | ||
publish({}, component.subtopic) | ||
|
||
error_queue_message = error_queue.get() | ||
assert isinstance(error_queue_message, Message) | ||
assert error_queue_message.error['type'] == 'AssertionError' | ||
|
||
error_pubtopic_message = error_pubtopic.get() | ||
assert isinstance(error_pubtopic_message, Message) | ||
assert error_pubtopic_message.error['type'] == 'AssertionError' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters