-
Notifications
You must be signed in to change notification settings - Fork 2
In integration tests, store drunc console output in a log file and check for warnings and errors #162
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
In integration tests, store drunc console output in a log file and check for warnings and errors #162
Changes from 6 commits
73113a4
4f55e76
7e8cab7
4cc6708
f0e3ea4
59a351f
a7716ec
e2e2450
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -27,6 +27,7 @@ def log_has_no_errors(log_file_name, print_logfilename_for_problems=True, exclud | |
| severity=match_logline_prefix.group(1) | ||
| if severity in ("WARNING", "ERROR", "FATAL"): | ||
| bad_line=True | ||
| #if not bad_line: | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Can this be removed? |
||
| else: # This line's not produced with our logging package, so let's just look for bad words | ||
| if "WARN" in line or "Warn" in line or "warn" in line or \ | ||
| "ERROR" in line or "Error" in line or "error" in line or \ | ||
|
|
@@ -111,6 +112,10 @@ 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"]) | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. What is the movtivation for excluding the phrase "Endpoint" or "Substate" here? |
||
| excluded_substring_map.setdefault(r".*", []).extend(["X11 forwarding setup failed"]) | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This issue should have been addressed by DUNE-DAQ/drunc#982, I would suggest removing it so we can keep track of whether this issue re-appears in the future |
||
|
|
||
| all_ok=True | ||
| #print("") # Clear potential dot from pytest | ||
| for log in log_file_names: | ||
|
|
@@ -121,13 +126,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) | ||
|
|
||
|
|
||
Uh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is exactly what is needed, but I suggest an extension here. Investigating the logfile, mani ANSI escape characters associated with the use of the
richoutput with color coding is including additional verbosity asThere was a similar case of this when @emmuhamm overhauled the python logging framework, and the stripping of this was implemented in
daqsystemtestin this PR. Would it be possible to implement this?