make logging more verbose in debug mode by making all loggers do something, fix cypress

This commit is contained in:
burnettk 2023-03-09 00:38:29 -05:00
parent ffe15bf9af
commit 178b67d5b1
No known key found for this signature in database
2 changed files with 13 additions and 7 deletions

View File

@ -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)

View File

@ -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(