From 613a80d9d6473d8c0558485e446431d9c9033272 Mon Sep 17 00:00:00 2001 From: Radek Vykydal Date: Fri, 3 Jan 2025 12:00:40 +0100 Subject: [PATCH] Update classify script with more generic check (gh1346) --- scripts/classify-failures | 39 +++++++++++++++++++-------------------- 1 file changed, 19 insertions(+), 20 deletions(-) diff --git a/scripts/classify-failures b/scripts/classify-failures index f5998e92..989bfeda 100755 --- a/scripts/classify-failures +++ b/scripts/classify-failures @@ -23,23 +23,15 @@ import re ISSUES = [ - { - "description": "", - "first_grep": "", - "last_anaconda_re": "", - }, +# { +# "description": "", +# "first_grep": "", +# "last_matching_re": ("", ""), +# }, { "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" @@ -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", @@ -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 = [ @@ -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