feat(ci): add LOG_LEVEL parameter for Jenkins jobs

Signed-off-by: Jakub Sokołowski <jakub@status.im>
This commit is contained in:
Jakub Sokołowski 2023-12-01 14:57:36 +01:00
parent 8351ae80ca
commit 76c04968fe
3 changed files with 11 additions and 5 deletions

View File

@ -40,6 +40,11 @@ pipeline {
description: 'Test run name in Test Rail.',
defaultValue: ''
)
choice(
name: 'LOG_LEVEL',
description: 'Log level for pytest.',
choices: ['INFO', 'DEBUG', 'TRACE', 'WARNING', 'CRITICAL']
)
/* FIXME: This is temporary and should be removed. */
choice(
name: 'AGENT',
@ -129,8 +134,9 @@ pipeline {
stage('Test') {
steps { timeout(90) { script {
def flags = []
if (params.TEST_NAME) { flags.add("-k=${params.TEST_NAME}") }
if (params.TEST_NAME) { flags.add("-k=${params.TEST_NAME}") }
if (params.TEST_SCOPE) { flags.add("-m=${params.TEST_SCOPE}") }
if (params.LOG_LEVEL) { flags.addAll(["--log-level=${params.LOG_LEVEL}", "--log-cli-level=${params.LOG_LEVEL}"]) }
dir ('configs') { sh 'ln -s _local.ci.py _local.py' }
wrap([
$class: 'Xvfb',

View File

@ -1,7 +1,7 @@
import logging
import os
import logging
LOG_LEVEL = logging.INFO
LOG_LEVEL = logging.getLevelName(os.getenv('LOG_LEVEL', 'INFO'))
UPDATE_VP_ON_FAIL = False
DEV_BUILD = False
AUT_PATH = os.getenv('AUT_PATH')

View File

@ -1,8 +1,8 @@
[pytest]
log_level = DEBUG
log_level = INFO
log_format = %(asctime)s.%(msecs)03d %(levelname)7s %(name)s %(message).5000s
log_cli = true
log_cli_level = DEBUG
log_cli_level = INFO
log_cli_format = %(asctime)s.%(msecs)03d %(levelname)7s CLI %(name)s %(message).5000s
addopts = --disable-warnings -p no:logging