Skip to content

Commit d579a43

Browse files
authored
Fix: CM details page list unused testcases (#1071)
For instance, the testcase scs-0104-image-debian-13 is not (yet) used by any version. Or the testcase scs-0104-image-capi-1 is only used by deprecated versions, and those are not shown if an effective version is passed. Showing these unused testcases in the table accomplished nothing but confusion. Signed-off-by: Matthias Büchse <matthias.buechse@alasca.cloud>
1 parent a96918b commit d579a43

1 file changed

Lines changed: 6 additions & 1 deletion

File tree

compliance-monitor/monitor.py

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -279,14 +279,19 @@ def _evaluate_scope(spec, scope_results, include_drafts=False):
279279
if include_drafts:
280280
relevant.extend(by_validity['draft'])
281281
passed = [vname for vname in relevant if version_results[vname]['result'] == 1]
282+
# only list testcases that occur in any relevant version
283+
relevant_testcases = set()
284+
for vname in relevant:
285+
for tc_ids in versions[vname]['targets'].values():
286+
relevant_testcases.update(tc_ids)
282287
return {
283288
'name': spec['name'],
284289
'testcases': testcases,
285290
'results': scope_results,
286291
'buckets': {
287292
# sort testcase that occur any main target on top of those that don't
288293
res: sorted(tc_ids, key=lambda tc_id: (not testcases[tc_id]['attn'], tc_id))
289-
for res, tc_ids in eval_buckets(scope_results, testcases).items()
294+
for res, tc_ids in eval_buckets(scope_results, relevant_testcases).items()
290295
},
291296
'versions': version_results,
292297
'relevant': relevant,

0 commit comments

Comments
 (0)