diff --git a/src/integrationtest/integrationtest_drunc.py b/src/integrationtest/integrationtest_drunc.py index 9813ff3..9da8e19 100644 --- a/src/integrationtest/integrationtest_drunc.py +++ b/src/integrationtest/integrationtest_drunc.py @@ -613,8 +613,8 @@ class RunResult: cwd=run_dir ) - # print out each line of captured output, as well as add it to the string that we - # pass back to the user, subject to the verbosity level that the user has requested + # print out each line of captured output, subject to the verbosity level that the + # user has requested, as well as add it to the string that we pass back to the user tmp_string = request.config.getoption("--dunerc-fullprint-watch-string") full_printout_watch_string = tmp_string.replace("_SPC_", " ") full_printout_activated = False @@ -643,7 +643,9 @@ class RunResult: # check for errors and warnings for all verbosity levels if should_be_printed == False: - if ("error" in line.lower() and (not "In error" in line and not "Endpoint" in line)) or "warning" in line.lower(): + lc_line = line.lower() + if ("error" in lc_line and (not "In error" in line and not "Endpoint" in line)) \ + or "warning" in lc_line or "critical" in lc_line: should_be_printed = True # check for basic transition messages, if that level of verbosity is requested @@ -673,6 +675,11 @@ class RunResult: rc_process.communicate() proc_returncode = rc_process.returncode + # store the full dunerc console output in a log file for reference and checking + with open(f"{run_dir}/log_{getpass.getuser()}_drunc_console_output.txt", "w", encoding="utf-8") as ff: + no_ansi_output = re.sub(r"\x1b\[[0-9;]*m", "", full_output) + ff.write(no_ansi_output) + # construct a CompletedProcess instance to be passed back to the user. In this way, # user code does not need to change in response to the change in this code from # using subprocess.run() to subprocess.Popen(). diff --git a/src/integrationtest/log_file_checks.py b/src/integrationtest/log_file_checks.py index 8f83c51..26e3a35 100644 --- a/src/integrationtest/log_file_checks.py +++ b/src/integrationtest/log_file_checks.py @@ -111,6 +111,9 @@ def logs_are_error_free(log_file_names, show_all_problems=True, print_logfilenam ["RAN:", "LogLevel=error"] ) + # 21-Jul-2026, KAB: phrases that we always want to exclude + excluded_substring_map.setdefault("drunc", []).extend(["Substate.*In error.*Endpoint"]) + all_ok=True #print("") # Clear potential dot from pytest for log in log_file_names: @@ -121,13 +124,11 @@ def logs_are_error_free(log_file_names, show_all_problems=True, print_logfilenam match_obj = re.search(exclusion_key, log.name) if match_obj: exclusions += excluded_substring_map[exclusion_key] - break for required_key in required_substring_map.keys(): match_obj = re.search(required_key, log.name) if match_obj: requireds += required_substring_map[required_key] - break - + single_ok=log_has_no_errors(log, print_logfilename_for_problems, exclusions, requireds, print_required_message_report, verbosity_helper)