From 752d6c3bcce886d2f590917199707b630560fd12 Mon Sep 17 00:00:00 2001 From: Marius Kittler Date: Tue, 12 Oct 2021 18:16:27 +0200 Subject: [PATCH] Report missing bug references of softfails, don't just write a log line See https://progress.opensuse.org/issues/95715 --- openqa_review/openqa_review.py | 5 +-- .../:api:v1:jobs:5590738:details | 8 ++++ ...ests:5590738:file:details-netns_sysfs.json | 1 + ...D%253A18520%253Akernel-ec2%26groupid%3D161 | 22 +++++++++++ ...3A::openqa.suse.de:group_overview:161.json | 38 +++++++++++++++++++ .../report-broken-softfails.md | 18 +++++++++ tests/test_openqa_review.py | 14 +++++++ 7 files changed, 102 insertions(+), 4 deletions(-) create mode 100644 tests/broken-softfails/:api:v1:jobs:5590738:details create mode 100644 tests/broken-softfails/:tests:5590738:file:details-netns_sysfs.json create mode 100644 tests/broken-softfails/:tests:overview%3Fdistri%3Dsle%26version%3D11-SP3%26build%3D%253A18520%253Akernel-ec2%26groupid%3D161 create mode 100644 tests/broken-softfails/https%3A::openqa.suse.de:group_overview:161.json create mode 100644 tests/broken-softfails/report-broken-softfails.md diff --git a/openqa_review/openqa_review.py b/openqa_review/openqa_review.py index 197c219..9863922 100755 --- a/openqa_review/openqa_review.py +++ b/openqa_review/openqa_review.py @@ -1026,10 +1026,7 @@ def _get_bugref_for_softfailed_module(self, result_item, module_name): continue return match.group(1) + "#" + match.group(2) else: # pragma: no cover - log.error( - "Could not find any soft failure reference within details of soft-failed job '%s'. Could be deleted workaround needle?." - % absolute_url(self.root_url, result_item) - ) + return "missing bug reference" def has_todo_issues(self): """Tell if report has new or existing todo issues.""" diff --git a/tests/broken-softfails/:api:v1:jobs:5590738:details b/tests/broken-softfails/:api:v1:jobs:5590738:details new file mode 100644 index 0000000..57d5251 --- /dev/null +++ b/tests/broken-softfails/:api:v1:jobs:5590738:details @@ -0,0 +1,8 @@ +{ + "job" : { + "name" : "sle-11-SP3-Server-DVD-Incidents-Kernel-x86_64-Build:18520:kernel-ec2-ltp_containers@64bit", + "result" : "softfailed", + "test" : "ltp_containers", + "testresults" : [{ "details" : [], "name" : "netns_sysfs", "result" : "softfailed" }] + } +} diff --git a/tests/broken-softfails/:tests:5590738:file:details-netns_sysfs.json b/tests/broken-softfails/:tests:5590738:file:details-netns_sysfs.json new file mode 100644 index 0000000..9d4ab95 --- /dev/null +++ b/tests/broken-softfails/:tests:5590738:file:details-netns_sysfs.json @@ -0,0 +1 @@ +{ "details" : [], "result" : "softfail" } diff --git a/tests/broken-softfails/:tests:overview%3Fdistri%3Dsle%26version%3D11-SP3%26build%3D%253A18520%253Akernel-ec2%26groupid%3D161 b/tests/broken-softfails/:tests:overview%3Fdistri%3Dsle%26version%3D11-SP3%26build%3D%253A18520%253Akernel-ec2%26groupid%3D161 new file mode 100644 index 0000000..964bc21 --- /dev/null +++ b/tests/broken-softfails/:tests:overview%3Fdistri%3Dsle%26version%3D11-SP3%26build%3D%253A18520%253Akernel-ec2%26groupid%3D161 @@ -0,0 +1,22 @@ + + +openQA: Test summary + +

Test result overview

+
+

Flavor: Server-DVD-Incidents-Kernel

+ + + + + + + + +
Testx86_64
ltp_containers + + + +
+ + diff --git a/tests/broken-softfails/https%3A::openqa.suse.de:group_overview:161.json b/tests/broken-softfails/https%3A::openqa.suse.de:group_overview:161.json new file mode 100644 index 0000000..8cceaf7 --- /dev/null +++ b/tests/broken-softfails/https%3A::openqa.suse.de:group_overview:161.json @@ -0,0 +1,38 @@ +{ + "build_results" : [ + { + "build" : ":18520:kernel-ec2", + "distris" : { "sle" : 1 }, + "failed" : 9, + "key" : "11-SP3-:18520:kernel-ec2", + "labeled" : 0, + "passed" : 34, + "reviewed" : "", + "skipped" : 0, + "softfailed" : 2, + "total" : 45, + "unfinished" : 0, + "version" : "11-SP3" + }, + { + "build" : ":18179:kernel-ec2", + "distris" : { "sle" : 1 }, + "failed" : 1, + "key" : "11-SP3-:18179:kernel-ec2", + "labeled" : 0, + "passed" : 0, + "reviewed" : "", + "skipped" : 44, + "softfailed" : 0, + "total" : 45, + "unfinished" : 0, + "version" : "11-SP3" + } + ], + "group" : { + "id" : 161, + "name" : "Maintenance: SLE 11 SP3 Kernel Incidents", + "parent_id" : 8, + "parent_name" : "Maintenance: Single Incidents" + } +} diff --git a/tests/broken-softfails/report-broken-softfails.md b/tests/broken-softfails/report-broken-softfails.md new file mode 100644 index 0000000..e3da693 --- /dev/null +++ b/tests/broken-softfails/report-broken-softfails.md @@ -0,0 +1,18 @@ +# 0 + + +**Date:** 2021-10-13 - 13:17 +**Build:** :18520:kernel-ec2 + +--- + +**Arch:** x86_64 +**Status: Green** + +**Existing Product bugs:** + +* soft fails: ltp_containers -> missing bug reference + + + +--- diff --git a/tests/test_openqa_review.py b/tests/test_openqa_review.py index c532e5e..3080c7c 100644 --- a/tests/test_openqa_review.py +++ b/tests/test_openqa_review.py @@ -552,6 +552,20 @@ def test_custom_reports_based_on_issue_status(): compare_report(str(report), os.path.join(args.load_dir, "report25_bugrefs_query_issues_filter_closed.md")) +def test_get_bugref_for_softfailed_module(): + args = cache_test_args_factory() + args.verbose_test = 1 + args.show_empty = False + args.bugrefs = True + args.include_softfails = True + args.builds = ":18520:kernel-ec2,:18179:kernel-ec2" + args.job_group_urls = "https://openqa.suse.de/group_overview/161" + args.load_dir = os.path.join(os.path.dirname(os.path.realpath(__file__)), "broken-softfails") + + report = str(openqa_review.generate_report(args)) + compare_report(report, os.path.join(args.load_dir, "report-broken-softfails.md")) + + def test_arch_distinguish(): args = cache_test_args_factory() args.arch = None