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

Syncing from upstream OCA/server-tools (15.0) #1273

Merged
merged 5 commits into from
Sep 2, 2023
Merged

Conversation

bt-admin
Copy link

@bt-admin bt-admin commented Sep 2, 2023

bt_gitbot

aisopuro and others added 5 commits August 28, 2023 15:46
Before this fix, the Sentry module sent events for WARNING-
level logs, even if sentry_logging_level was registered as
"error" or higher.

The fix itself is minor: setup of the integration mistakenly
set the hardcoded WARNING level to the event handler and the
sentry_logging_level to the breadcrumb handler, when they
should have been the other way around.

The largest part of the diff is a reworking of the tests in
order to properly replicate the issue:

* The test previously emitted a fake log event directly using
  the integration's handler's emit-method, which skipped the
  part of the logic that actually filters based on logging level.
  This has been changed to use a bespoke NoopHandler and dedicated
  Logger, so that the tests can emit "actual logs" and test Sentry
  as accurately as possible.
* The tests were not configured to use a non-default logging level,
  thus making it so that none of them caught the fact we were basically
  hard-coding the setting to WARNING-level.
  The tests now set the logging level to ERROR in order to make sure
  the configuration parameter works when it is non-default.
* Changes to configuration (especially ignored loggers) were leaking
  from one test into others. The tests were directly mutating the
  `odoo.tools.config.options` mapping, without resetting it afterward,
  leaving the changes in place for subsequent tests.
  Introduced a helper method `patch_config` that can be used to patch
  the config object so that the patch is undone at the end of the test.
Signed-off-by moylop260
@bt-admin bt-admin added the 15.0 label Sep 2, 2023
@bt-admin bt-admin merged commit b6ae4c5 into brain-tec:15.0 Sep 2, 2023
6 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants