-
Notifications
You must be signed in to change notification settings - Fork 143
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
Added the option to ignore missing segments #338
Added the option to ignore missing segments #338
Conversation
Normally we have tests follow alongside the change, but I can't think of any easy way to check if a Otherwise the test could live next to this one: aws-xray-sdk-python/tests/test_recorder.py Lines 122 to 132 in 8a82e4b
Let me know if you know how we could test for log generation? I was checking out this SO post but unfortunately we don't use I'll try to think of a way but if I can't I'll come back and update on this PR 🙂 |
You can use the built-in capsys test fixture by pytest. By adding “capsys”
in the test function argument, all log generated will be automatically
captured and you can assert on those.
https://docs.pytest.org/en/6.2.x/capture.html
…On Wed, 25 May 2022 at 01:04, Nathaniel Ruiz Nowell < ***@***.***> wrote:
Normally we have tests follow alongside the change, but I can't think of
any easy way to check if a log was outputted to the console.
Otherwise the test could live next to this one:
https://github.com/aws/aws-xray-sdk-python/blob/8a82e4b8a175cdee0c0073005ff0bac078560663/tests/test_recorder.py#L122-L132
Let me know if you know how we could test for log generation? I was
checking out this SO post <https://stackoverflow.com/a/34920727> but
unfortunately we don't use unittest.TestCase in our file. Although that
would be a nice improvement 🙂
I'll try to think of a way but if I can't I'll come back and update on
this PR 🙂
—
Reply to this email directly, view it on GitHub
<#338 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AAZPQBHHYF6NDTGLIKFVLQLVLVOAPANCNFSM5WZUFLFQ>
.
You are receiving this because you are subscribed to this thread.Message
ID: ***@***.***>
|
I added a test for the ignore. However I am having a lot of trouble running the tests. I tried to run the command
Any idea what might be wrong? I am running ubuntu in WSL2 |
552c73d
to
07f5b32
Compare
I instead used |
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.
Thank you for this!
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.
Ah so sorry I forgot to call this out earlier, can you add this change under the CHANGELOG.rst
: https://github.com/aws/aws-xray-sdk-python/blob/master/CHANGELOG.rst
Under an “Unreleased” heading please? Thank you!
@NathanielRN Perhaps I should change it to that? |
@stijndehaes Yes please! I would greatly appreciate that since it will make our doc writers’ lives easier 🙂 Thank you! 😄 |
This is the same naming used in other SDK's
This is the same naming used in other SDK's
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.
Thank you so much, @stijndehaes! Very grateful to this community for helping to make this SDK better 😄
Issue #, if available: #334
Description of changes:
Adds the option to ignore a missing context
By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.