@@ -16,50 +16,81 @@ def __init__(self, input, expected_output):
1616
1717 async def run (self ) -> TriageState :
1818 metrics_middleware = MetricsMiddleware ()
19+
1920 def testing_factory (gateway_tools ):
2021 triage_agent = create_triage_agent (gateway_tools )
2122 triage_agent .middlewares .append (metrics_middleware )
2223 return triage_agent
24+
2325 finished_state = await run_workflow (self .input , False , testing_factory )
2426 self .metrics = metrics_middleware .get_metrics ()
2527 return finished_state
2628
27- test_cases = [
28- TriageAgentTestCase (input = "RHEL-15216" ,
29- expected_output = TriageOutputSchema (resolution = Resolution .BACKPORT ,
30- data = BackportData (package = "dnsmasq" ,
31- patch_urls = ["http://thekelleys.org.uk/gitweb/?p=dnsmasq.git;a=patch;h=dd33e98da09c487a58b6cb6693b8628c0b234a3b" ],
32- justification = "not-implemented" ,
33- jira_issue = "RHEL-15216" ,
34- cve_id = None ,
35- fix_version = "rhel-8.10" ))
29+
30+ test_cases = [
31+ TriageAgentTestCase (
32+ input = "RHEL-15216" ,
33+ expected_output = TriageOutputSchema (
34+ resolution = Resolution .BACKPORT ,
35+ data = BackportData (
36+ package = "dnsmasq" ,
37+ patch_urls = [
38+ "http://thekelleys.org.uk/gitweb/?p=dnsmasq.git;a=patch;h=dd33e98da09c487a58b6cb6693b8628c0b234a3b"
39+ ],
40+ justification = "not-implemented" ,
41+ jira_issue = "RHEL-15216" ,
42+ cve_id = None ,
43+ fix_version = "rhel-8.10" ,
44+ ),
45+ ),
3646 ),
37- TriageAgentTestCase (input = "RHEL-112546" ,
38- expected_output = TriageOutputSchema (resolution = Resolution .BACKPORT ,
39- data = BackportData (package = "libtiff" ,
40- patch_urls = ["https://gitlab.com/libtiff/libtiff/-/commit/d1c0719e004fbb223c571d286c73911569d4dbb6.patch" ],
41- justification = "not-implemented" ,
42- jira_issue = "RHEL-112546" ,
43- cve_id = "CVE-2025-9900" ,
44- fix_version = "rhel-9.6.z" ))
47+ TriageAgentTestCase (
48+ input = "RHEL-112546" ,
49+ expected_output = TriageOutputSchema (
50+ resolution = Resolution .BACKPORT ,
51+ data = BackportData (
52+ package = "libtiff" ,
53+ patch_urls = [
54+ "https://gitlab.com/libtiff/libtiff/-/commit/d1c0719e004fbb223c571d286c73911569d4dbb6.patch"
55+ ],
56+ justification = "not-implemented" ,
57+ jira_issue = "RHEL-112546" ,
58+ cve_id = "CVE-2025-9900" ,
59+ fix_version = "rhel-9.6.z" ,
60+ ),
61+ ),
4562 ),
46- TriageAgentTestCase (input = "RHEL-61943" ,
47- expected_output = TriageOutputSchema (resolution = Resolution .BACKPORT ,
48- data = BackportData (package = "dnsmasq" ,
49- patch_urls = ["http://thekelleys.org.uk/gitweb/?p=dnsmasq.git;a=patch;h=eb1fe15ca80b6bc43cd6bfdf309ec6c590aff811" ],
50- justification = "not-implemented" ,
51- jira_issue = "RHEL-61943" ,
52- cve_id = None ,
53- fix_version = "rhel-8.10.z" ))
63+ TriageAgentTestCase (
64+ input = "RHEL-61943" ,
65+ expected_output = TriageOutputSchema (
66+ resolution = Resolution .BACKPORT ,
67+ data = BackportData (
68+ package = "dnsmasq" ,
69+ patch_urls = [
70+ "http://thekelleys.org.uk/gitweb/?p=dnsmasq.git;a=patch;h=eb1fe15ca80b6bc43cd6bfdf309ec6c590aff811"
71+ ],
72+ justification = "not-implemented" ,
73+ jira_issue = "RHEL-61943" ,
74+ cve_id = None ,
75+ fix_version = "rhel-8.10.z" ,
76+ ),
77+ ),
5478 ),
55- TriageAgentTestCase (input = "RHEL-29712" ,
56- expected_output = TriageOutputSchema (resolution = Resolution .BACKPORT ,
57- data = BackportData (package = "bind" ,
58- patch_urls = ["https://gitlab.isc.org/isc-projects/bind9/-/commit/7e2f50c36958f8c98d54e6d131f088a4837ce269" ],
59- justification = "not-implemented" ,
60- jira_issue = "RHEL-29712" ,
61- cve_id = None ,
62- fix_version = "rhel-8.10.z" ))
79+ TriageAgentTestCase (
80+ input = "RHEL-29712" ,
81+ expected_output = TriageOutputSchema (
82+ resolution = Resolution .BACKPORT ,
83+ data = BackportData (
84+ package = "bind" ,
85+ patch_urls = [
86+ "https://gitlab.isc.org/isc-projects/bind9/-/commit/7e2f50c36958f8c98d54e6d131f088a4837ce269"
87+ ],
88+ justification = "not-implemented" ,
89+ jira_issue = "RHEL-29712" ,
90+ cve_id = None ,
91+ fix_version = "rhel-8.10.z" ,
92+ ),
93+ ),
6394 ),
6495]
6596
@@ -86,7 +117,9 @@ def mydata(request):
86117 test_cases ,
87118)
88119async def test_triage_agent (test_case : TriageAgentTestCase ):
89- def verify_result (real_output : TriageOutputSchema , expected_output : TriageOutputSchema ):
120+ def verify_result (
121+ real_output : TriageOutputSchema , expected_output : TriageOutputSchema
122+ ):
90123 assert real_output .resolution == expected_output .resolution
91124 assert real_output .data .package == expected_output .data .package
92125 assert real_output .data .patch_urls == expected_output .data .patch_urls
0 commit comments