Skip to content
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

Update classify script with more generic check (gh1346) #1348

Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
39 changes: 19 additions & 20 deletions scripts/classify-failures
Original file line number Diff line number Diff line change
Expand Up @@ -23,23 +23,15 @@ import re


ISSUES = [
{
"description": "<ISSUE DESCRIPTION PREFERABLY WITH GITHUB ISSUE REFERENCE>",
"first_grep": "<REGULAR EXPRESSION FOR GREP TO BE LOOKED FOR>",
"last_anaconda_re": "<REGULAR EXPRESSION FOR PYTHON TO BE MATCHED AGAINST THE LAST LINE IN THE LOG CONTAINING 'anaconda:'>",
},
# {
# "description": "<ISSUE DESCRIPTION PREFERABLY WITH GITHUB ISSUE REFERENCE>",
# "first_grep": "<REGULAR EXPRESSION FOR GREP TO BE LOOKED FOR>",
# "last_matching_re": ("<REGULAR EXPRESSION FOR GREP TO FIND THE LAST MATCHING LINE>", "<REGULAR EXPRESSION FOR PYTHON TO MATCH AGAINST THE FOUND LINE>"),
# },
{
"description": "[675] ([1]) https://github.com/rhinstaller/kickstart-tests/issues/675",
"last_anaconda_re": ".*Configuring \\(running scriptlet for\\): rootfiles.*",
"last_matching_re": ("anaconda:", ".*Configuring \\(running scriptlet for\\): rootfiles.*"),
},
# Superseded by the last_anaconda_re check
# {
# # The detection may be improved, not sure if just with grep.
# "description": "[675] ([1]) https://github.com/rhinstaller/kickstart-tests/issues/675 The string is also in successful installation, but there is high chance that for test which times out it will be this issue.",
# "first_grep": "Failed to start man-db-cache-update.service: Unit man-db-cache-update.service not found.",
# # Context of this line can be useful as well
# # "INFO anaconda:dnf: Running transaction check",
# },
{
"description": "[TODO] https://github.com/rhinstaller/kickstart-tests/issues/TODO",
"first_grep": "^[^E]*ERR anaconda:dnf: Error in POSTIN scriptlet in rpm package coreutils-common"
Expand Down Expand Up @@ -158,7 +150,7 @@ ISSUES = [
},
{
"description": "[1017] https://github.com/rhinstaller/kickstart-tests/issues/1017",
"last_anaconda_re": ".*DEBUG anaconda:anaconda: ui.gui.hubs: kickstart installation, spoke Installation Source is ready.*"
"last_matching_re": ("anaconda:", ".*DEBUG anaconda:anaconda: ui.gui.hubs: kickstart installation, spoke Installation Source is ready.*"),
},
{
"description": "[1235] https://github.com/rhinstaller/kickstart-tests/issues/1235",
Expand Down Expand Up @@ -208,6 +200,10 @@ ISSUES = [
"description": "[1318] https://github.com/rhinstaller/kickstart-tests/issues/1318",
"first_grep": "anaconda:anaconda: display: X or window manager startup failed: systemd exited with status 1",
},
{
"description": "[1346] https://github.com/rhinstaller/kickstart-tests/issues/1346",
"last_matching_re": (".*org.fedoraproject.Anaconda.Modules.*", ".*grub2-mkconfig.*")
},
]

CLOSED_ISSUES = [
Expand Down Expand Up @@ -315,14 +311,17 @@ def _get_match(issue, file_path, args):
)
match = grep.stdout

if "last_anaconda_re" in issue:
last_anaconda = subprocess.check_output(
"grep anaconda: {} | tail -n 1".format(file_path),
if "last_matching_re" in issue:
line_match_re, line_check_re = issue["last_matching_re"]
last_matching_line = subprocess.check_output(
"grep {} {} | tail -n 1".format(line_match_re, file_path),
shell=True,
encoding="utf8",
)
if re.match(issue["last_anaconda_re"], last_anaconda):
match = last_anaconda
if last_matching_line:
if re.match(line_check_re, last_matching_line):
match = last_matching_line

return match


Expand Down
Loading