-
Notifications
You must be signed in to change notification settings - Fork 1.5k
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
Logging: Fix tests. #8273
Logging: Fix tests. #8273
Conversation
I think you need to also change the usage to |
Also, we need to figure out why #8227 passed CI here. |
@tseaver We forgot to add |
Looks like there's some more work to get tests passing again (after fixing the import)
|
I don't understand the google-cloud-python/logging/google/cloud/logging/logger.py Lines 338 to 348 in c5acdad
creating a
which derives from
which derives from google-cloud-python/logging/google/cloud/logging/entries.py Lines 67 to 87 in c5acdad
which clearly takes a |
OK, the google-cloud-python/logging/tests/unit/handlers/transports/test_background_thread.py Lines 420 to 446 in c5acdad
There will also be test failures due to the use of a def enqueue(
self, record, message, resource=None, labels=None, trace=None, span_id=None
):
"""Queues a log entry to be written by the background thread.
:type record: :class:`logging.LogRecord`
:param record: Python log record that the handler was called with.
:type message: str
:param message: The message from the ``LogRecord`` after being
formatted by the associated log formatters.
:type resource: :class:`~google.cloud.logging.resource.Resource`
:param resource: (Optional) Monitored resource of the entry
:type labels: dict
:param labels: (Optional) Mapping of labels for the entry.
:type trace: str
:param trace: (optional) traceid to apply to the logging entry.
:type span_id: str
:param span_id: (optional) span_id within the trace for the log entry.
Specify the trace parameter if span_id is set.
"""
self._queue.put_nowait(
{
"info": {"message": message, "python_logger": record.name},
"severity": record.levelname,
"resource": resource,
"labels": labels,
"trace": trace,
"span_id": span_id,
> "timestamp": datetime.datetime.utcfromtimestamp(record.created),
}
)
E TypeError: an integer is required (got type Mock) |
If this is going to take a long time to fix, would it make sense to roll back PR #8227 in the meantime? |
|
Fixes internal issue 134713268.