From e680a362b778943f9cfe80f18395c69c8c5ca8b2 Mon Sep 17 00:00:00 2001 From: Petr Kalis Date: Wed, 8 Dec 2021 18:13:08 +0100 Subject: [PATCH] OP-2042 - additions to developer documentation --- tests/integration/README.md | 18 +++++++++++++++++- 1 file changed, 17 insertions(+), 1 deletion(-) diff --git a/tests/integration/README.md b/tests/integration/README.md index 8839e2e43f..0b6a1804ae 100644 --- a/tests/integration/README.md +++ b/tests/integration/README.md @@ -15,6 +15,10 @@ How to run OR can use built executables `openpype_console runtests {ABS_PATH}/tests/integration` +How to check logs/errors from app +-------------------------------- +Keep PERSIST to True in the class and check `test_openpype.logs` collection. + How to create test for publishing from host ------------------------------------------ - Extend PublishTest in `tests/lib/testing_classes.py` @@ -28,9 +32,21 @@ How to create test for publishing from host ``` import openpype from avalon import api, HOST + +from openpype.api import Logger + +log = Logger().get_logger(__name__) api.install(HOST) -pyblish.util.publish() +log_lines = [] +for result in pyblish.util.publish_iter(): + for record in result["records"]: # for logging to test_openpype DB + log_lines.append("{}: {}".format( + result["plugin"].label, record.msg)) + + if result["error"]: + err_fmt = "Failed {plugin.__name__}: {error} -- {error.traceback}" + log.error(err_fmt.format(**result)) EXIT_APP (command to exit host) ```