From 178b67d5b12dca1d7caae8362c73e31919624d60 Mon Sep 17 00:00:00 2001 From: burnettk Date: Thu, 9 Mar 2023 00:38:29 -0500 Subject: [PATCH] make logging more verbose in debug mode by making all loggers do something, fix cypress --- .../services/logging_service.py | 5 +++++ spiffworkflow-frontend/cypress/pilot/pp1.cy.js | 15 ++++++++------- 2 files changed, 13 insertions(+), 7 deletions(-) diff --git a/spiffworkflow-backend/src/spiffworkflow_backend/services/logging_service.py b/spiffworkflow-backend/src/spiffworkflow_backend/services/logging_service.py index 25f00d63..401d071e 100644 --- a/spiffworkflow-backend/src/spiffworkflow_backend/services/logging_service.py +++ b/spiffworkflow-backend/src/spiffworkflow_backend/services/logging_service.py @@ -2,6 +2,7 @@ import json import logging import re +import sys from typing import Any from typing import Optional @@ -171,6 +172,10 @@ def setup_logger(app: Flask) -> None: the_logger.propagate = False the_logger.addHandler(spiff_logger_filehandler) else: + if len(the_logger.handlers) < 1: + # it's very verbose, so only add handlers for the obscure loggers when log level is DEBUG + if upper_log_level_string == "DEBUG": + the_logger.addHandler(logging.StreamHandler(sys.stdout)) for the_handler in the_logger.handlers: the_handler.setFormatter(log_formatter) the_handler.setLevel(log_level) diff --git a/spiffworkflow-frontend/cypress/pilot/pp1.cy.js b/spiffworkflow-frontend/cypress/pilot/pp1.cy.js index aac3dbc8..7f38e37d 100644 --- a/spiffworkflow-frontend/cypress/pilot/pp1.cy.js +++ b/spiffworkflow-frontend/cypress/pilot/pp1.cy.js @@ -10,7 +10,7 @@ const approveWithUser = ( .contains(/^Submit$/) .click(); - cy.contains('Tasks I can complete', { timeout: 20000 }); + cy.contains('Tasks I can complete', { timeout: 30000 }); cy.get('.cds--btn').contains(/^Go$/).click(); // approve! @@ -19,12 +19,12 @@ const approveWithUser = ( .contains(/^Submit$/) .click(); if (expectAdditionalApprovalInfoPage) { - cy.contains(expectAdditionalApprovalInfoPage, { timeout: 20000 }); + cy.contains(expectAdditionalApprovalInfoPage, { timeout: 30000 }); cy.get('button') .contains(/^Continue$/) .click(); } - cy.location({ timeout: 20000 }).should((loc) => { + cy.location({ timeout: 30000 }).should((loc) => { expect(loc.pathname).to.eq('/tasks'); }); cy.logout(); @@ -37,7 +37,7 @@ describe('pp1', () => { cy.contains('Start New +').click(); cy.contains('Raise New Demand Request'); cy.runPrimaryBpmnFile(true); - cy.contains('Please select the type of request to Start the process.'); + cy.contains('Please select the type of request to start the process.'); // wait a second to ensure we can click the radio button cy.wait(1000); cy.get('input#root-procurement').click(); @@ -47,7 +47,7 @@ describe('pp1', () => { .click(); cy.contains( 'Submit a new demand request for the procurement of needed items', - { timeout: 20000 } + { timeout: 30000 } ); cy.url().then((currentUrl) => { @@ -68,7 +68,7 @@ describe('pp1', () => { .contains(/^Submit$/) .click(); - cy.contains('Task: Enter NDR Items', { timeout: 20000 }); + cy.contains('Task: Enter NDR Items', { timeout: 30000 }); cy.get('#root_0_sub_category').select('op_src'); cy.get('#root_0_item').clear().type('spiffworkflow'); cy.get('#root_0_qty').clear().type('1'); @@ -81,13 +81,14 @@ describe('pp1', () => { cy.contains( 'Review and provide any supporting information or files for your request.', - { timeout: 20000 } + { timeout: 30000 } ); cy.contains('Submit the Request').click(); cy.get('input[value="Submit the Request"]').click(); cy.get('button') .contains(/^Submit$/) .click(); + cy.contains('Tasks for my open instances', { timeout: 30000 }); cy.logout(); approveWithUser(