Merge ~sylvain-pineau/checkbox-ng:build_tree_using_effective_category_id into checkbox-ng:master

Proposed by Sylvain Pineau
Status: Merged
Approved by: Sylvain Pineau
Approved revision: d1dd4271db8b607e429d25557d0359c1898c785e
Merged at revision: f2160c9252ffd242a4129d28643e54424354a822
Proposed branch: ~sylvain-pineau/checkbox-ng:build_tree_using_effective_category_id
Merge into: checkbox-ng:master
Diff against target: 14 lines (+2/-1)
1 file modified
checkbox_ng/misc.py (+2/-1)
Reviewer Review Type Date Requested Status
Sylvain Pineau (community) Approve
Review via email: mp+317782@code.launchpad.net

Description of the change

This MR fixes the UI screens where the tester can pick up the tests to run using trees of jobs (ordered by categories).
Without the fix, categories overrides are not taken into account i.e job selection is inefficient.

To post a comment you must log in.
Revision history for this message
Sylvain Pineau (sylvain-pineau) wrote :

tested using the snappy providers and applying the following overrides:

category_overrides:
    apply "2013.com.canonical.plainbox::suspend" to "2013.com.canonical.certification::after-suspend-.*"

self-approved

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1diff --git a/checkbox_ng/misc.py b/checkbox_ng/misc.py
2index b5c06eb..dc92a37 100644
3--- a/checkbox_ng/misc.py
4+++ b/checkbox_ng/misc.py
5@@ -157,7 +157,8 @@ class JobTreeNode:
6 """
7 root_node = cls()
8 for job in job_list:
9- cat_name = sa.get_category(job.category_id).tr_name()
10+ cat_id = sa.get_job_state(job.id).effective_category_id
11+ cat_name = sa.get_category(cat_id).tr_name()
12 matches = [n for n in root_node.categories if n.name == cat_name]
13 if not matches:
14 node = cls(cat_name)

Subscribers

People subscribed via source and target branches