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(tracing): Refactor tracing_utils.py #3452

Merged

Conversation

rominf
Copy link
Contributor

@rominf rominf commented Aug 20, 2024

Preparation for:
#3313
Proposed in:
#3313 (comment)

Note that the _module_in_list function returns False if name is None or items are falsy, hence extra check before function call can be omitted to simplify code.


Thank you for contributing to sentry-python! Please add tests to validate your changes, and lint your code using tox -e linters.

Running the test suite on your PR might require maintainer approval. The AWS Lambda tests additionally require a maintainer to add a special label, and they will fail until this label is added.

Preparation for:
getsentry#3313
Proposed in:
getsentry#3313 (comment)

Note that the `_module_in_list` function returns `False` if `name` is
`None` or `items` are falsy, hence extra check before function call can
be omitted to simplify code.
Copy link
Member

@szokeasaurusrex szokeasaurusrex left a comment

Choose a reason for hiding this comment

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

Thanks for the contribution! Code looks much cleaner this way.

I also made a further simplification to the should_be_included logic

@szokeasaurusrex szokeasaurusrex added the Trigger: tests using secrets PR code is safe; run CI label Aug 26, 2024
@szokeasaurusrex szokeasaurusrex enabled auto-merge (squash) August 26, 2024 14:55
@szokeasaurusrex szokeasaurusrex self-assigned this Aug 26, 2024
Copy link

codecov bot commented Aug 26, 2024

❌ 4 Tests Failed:

Tests completed Failed Passed Skipped
110 4 106 0
View the top 3 failed tests by shortest run time
tests.integrations.aws_lambda.test_aws test_init_error[python3.11]
Stack Traces | 9.41s run time
.../integrations/aws_lambda/test_aws.py:334: in test_init_error
    (event,) = envelope_items
E   ValueError: not enough values to unpack (expected 1, got 0)
tests.integrations.aws_lambda.test_aws test_init_error[python3.9]
Stack Traces | 9.97s run time
.../integrations/aws_lambda/test_aws.py:334: in test_init_error
    (event,) = envelope_items
E   ValueError: not enough values to unpack (expected 1, got 0)
tests.integrations.aws_lambda.test_aws test_init_error[python3.10]
Stack Traces | 10s run time
.../integrations/aws_lambda/test_aws.py:334: in test_init_error
    (event,) = envelope_items
E   ValueError: not enough values to unpack (expected 1, got 0)

To view individual test run time comparison to the main branch, go to the Test Analytics Dashboard

@szokeasaurusrex szokeasaurusrex merged commit a1b7ce5 into getsentry:master Aug 27, 2024
122 of 127 checks passed
@rominf rominf deleted the rominf-tracing-refactor-logic-in_app branch September 5, 2024 17:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Trigger: tests using secrets PR code is safe; run CI
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants