From a785736b6c1c2ebe56763ea332886dfef12b51a1 Mon Sep 17 00:00:00 2001 From: Fodor Zoltan Date: Fri, 8 Jul 2022 21:00:43 +0300 Subject: [PATCH] #150: Fix tests and improve readme for continous logging. --- README.md | 5 +++-- src/collector/LogCollectExtendedControl.js | 2 ++ src/installLogsPrinter.js | 2 +- 3 files changed, 6 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index 0c4cee1..3ae417a 100755 --- a/README.md +++ b/README.md @@ -178,8 +178,9 @@ before all and after all hooks. #### `options.enableContinuousLogging` boolean; default false; Enables logging logs to terminal continuously / immediately as they are registered. -This feature is unstable and has an impact on pipeline performance. Use only for debugging purposes in case -the pipelines / tests are timing out. +This feature is unstable and has an impact on pipeline performance. This option has no effect for extended +collector, only works for the simple collector. Use only for debugging purposes in case the pipelines / +tests are timing out. > NOTE: In case of this option enabled, logs will come before the actual title of the test. Also the > `printLogsToConsole` option will be ignored. Logging to files might also get impacted. diff --git a/src/collector/LogCollectExtendedControl.js b/src/collector/LogCollectExtendedControl.js index 2325e05..c2252c9 100644 --- a/src/collector/LogCollectExtendedControl.js +++ b/src/collector/LogCollectExtendedControl.js @@ -64,6 +64,7 @@ module.exports = class LogCollectExtendedControl extends LogCollectBaseControl { level: testLevel, consoleTitle: options.consoleTitle, isHook: options.isHook, + continuous: false, } }) // For some reason cypress throws empty error although the task indeed works. @@ -84,6 +85,7 @@ module.exports = class LogCollectExtendedControl extends LogCollectBaseControl { level: testLevel, consoleTitle: options.consoleTitle, isHook: options.isHook, + continuous: false, }, {log: false} ); diff --git a/src/installLogsPrinter.js b/src/installLogsPrinter.js index 1942b01..71bea22 100755 --- a/src/installLogsPrinter.js +++ b/src/installLogsPrinter.js @@ -316,7 +316,7 @@ function logToTerminal(messages, options, data) { ); }); - if (messages.length !== 0 && data.continuous === false) { + if (messages.length !== 0 && !data.continuous) { console.log('\n'); } }