| |
@@ -13,6 +13,7 @@
|
| |
import textwrap
|
| |
from unittest.mock import patch
|
| |
|
| |
+ from module_build_service.builder.utils import execute_cmd
|
| |
from module_build_service.common import log, models
|
| |
from module_build_service.common.logger import ModuleBuildLogs, MBSConsoleHandler
|
| |
from module_build_service.scheduler.consumer import MBSConsumer
|
| |
@@ -92,6 +93,9 @@
|
| |
log.error("ignore this test msg2")
|
| |
self.build_log.current_log_stream.write("ignore this test output2")
|
| |
|
| |
+ # Get a message logged by a different part of MBS
|
| |
+ execute_cmd(["true"])
|
| |
+
|
| |
self.build_log.stop(build)
|
| |
assert os.path.exists(path)
|
| |
with open(path, "r") as f:
|
| |
@@ -101,6 +105,9 @@
|
| |
assert data.find("MBS - {0} - ignore this test msg2".format(level)) != -1
|
| |
assert data.find("ignore this test output2")
|
| |
|
| |
+ # Check that we log the category correctly
|
| |
+ assert data.find("MBS.builder.utils - INFO - Executing the command") != -1
|
| |
+
|
| |
# Try to log more messages when build_log for module 1 is stopped.
|
| |
# New messages should not appear in a log.
|
| |
MBSConsumer.current_module_build_id = 2
|
| |
The move of logger.py to common/logger.py
(https://pagure.io/fm-orchestrator/c/c7c650a4f0) broke the log
formatting introduced in https://pagure.io/fm-orchestrator/pull-request/1161,
so all logging outside the common directory was logged as 'MBS' instead
of 'MBS.<category>'