-
Notifications
You must be signed in to change notification settings - Fork 0
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat: added option to specify error pubtopic #102
Merged
Merged
Changes from all commits
Commits
Show all changes
8 commits
Select commit
Hold shift + click to select a range
bbca6f8
feat: added option to specify error pubtopic
xytxytxyt be579fa
simplified; added tests and debug statements
xytxytxyt aebb4c1
misc fixes
zachschubert 51baff6
autopropagate errors in other test modules
zachschubert ae2d59c
maintain current ergo error queue auto delete status quo for now
xytxytxyt e818632
updated ergo graph
xytxytxyt a0e525e
updated version
xytxytxyt 37ec022
pinned importlib-metadata to 4.13.0
xytxytxyt File filter
Filter by extension
Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,6 @@ | ||
"""Summary.""" | ||
import glob | ||
import itertools | ||
import os | ||
import sys | ||
from typing import Dict, Generator, List, Tuple, Union | ||
|
@@ -80,6 +81,9 @@ def topics(dot: graphviz.Digraph, configs: List[Dict[str, Union[None, str, List[ | |
for topic_element in format_topic('pubtopic', config): | ||
dot.edge(format_component(config)[0], topic_element[0]) | ||
dot.node(*topic_element, shape='box') | ||
for topic_element in format_topic('error_pubtopic', config): | ||
dot.edge(format_component(config)[0], topic_element[0]) | ||
dot.node(*topic_element, shape='octagon') | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. chose octagon because it is used for stop signs: http://www.trafficsign.us/signshape.html |
||
for topic_element in format_topic('subtopic', config): | ||
dot.node(*topic_element, shape='box') | ||
dot.edge(topic_element[0], format_component(config)[0]) | ||
|
@@ -94,7 +98,10 @@ def derived_topics(dot: graphviz.Digraph, configs: List[Dict[str, Union[None, st | |
""" | ||
for pub in configs: | ||
for sub in configs: | ||
for pub_topic in format_topic('pubtopic', pub): | ||
for pub_topic in itertools.chain( | ||
format_topic('pubtopic', pub), | ||
format_topic('error_pubtopic', pub), | ||
): | ||
for sub_topic in format_topic('subtopic', sub): | ||
if sub_topic[0] == pub_topic[0]: | ||
continue | ||
|
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
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
https://exerror.com/entrypoints-object-has-no-attribute-get/