Skip to content
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

Chore(tracer): unit tests to verify decorators await decorated class methods #1108

Merged

Conversation

dreamorosi
Copy link
Contributor

Description of your changes

In #1091 it was reported that the tracer.captureMethod() and tracer.captureLambdaHandler() decorators might not be awaiting correctly the decorated methods.

After a closer look it seems that they we already awaited properly, see:

This PR simply introduces unit tests to prove that this is the case and to guard against any future regressions.

How to verify this change

See existing & new unit tests passing.

Related issues, RFCs

Issue number: #1091

PR status

Is this ready for review?: YES
Is it a breaking change?: NO

Checklist

  • My changes meet the tenets criteria
  • I have performed a self-review of my own code
  • I have commented my code where necessary, particularly in areas that should be flagged with a TODO, or hard-to-understand areas
  • I have made corresponding changes to the documentation
  • I have made corresponding changes to the examples
  • My changes generate no new warnings
  • The code coverage hasn't decreased
  • I have added tests that prove my change is effective and works
  • New and existing unit tests pass locally and in Github Actions
  • Any dependent changes have been merged and published in downstream module
  • The PR title follows the conventional commit semantics

Breaking change checklist

N/A


By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.

@dreamorosi dreamorosi self-assigned this Oct 3, 2022
@dreamorosi dreamorosi linked an issue Oct 3, 2022 that may be closed by this pull request
ijemmy
ijemmy previously approved these changes Oct 6, 2022
Copy link
Contributor

@ijemmy ijemmy left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM. Small suggestions on readability but will leave it up to you.

packages/tracer/tests/unit/Tracer.test.ts Outdated Show resolved Hide resolved
packages/tracer/tests/unit/Tracer.test.ts Outdated Show resolved Hide resolved
@dreamorosi
Copy link
Contributor Author

LGTM. Small suggestions on readability but will leave it up to you.

Thank you @ijemmy, I have accepted both your suggestions.

@dreamorosi
Copy link
Contributor Author

Going to merge this. @ijemmy's previously already approved the PR and left comments which were addressed, so I'm going to consider this as approved.

@dreamorosi dreamorosi merged commit 0bb77af into main Oct 11, 2022
@dreamorosi dreamorosi deleted the 1091-bug-tracer-decorators-not-awaiting-decorated-class-method branch October 11, 2022 10:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Bug: decorators not awaiting decorated class method
3 participants