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

Proposed by Sylvain Pineau
Status: Merged
Approved by: Sylvain Pineau
Approved revision: 11d265bb0de99520d26e7b54ed371688757941b8
Merged at revision: f8dcad741a63f1ddd730ef50a0f8041658afee45
Proposed branch: ~sylvain-pineau/checkbox-ng:json_exporter_title_cat_names
Merge into: checkbox-ng:master
Diff against target: 39 lines (+5/-4)
2 files modified
plainbox/impl/providers/exporters/data/checkbox.json (+3/-1)
plainbox/impl/unit/testplan.py (+2/-3)
Reviewer Review Type Date Requested Status
Sylvain Pineau (community) Approve
Review via email: mp+349040@code.launchpad.net

Description of the change

Update of the json exporter to get

- the session title
- category names instead of their effective ids

Both are prerequisite to the report merge tool.

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

second commit was not expected (bootstrap), tell me if you prefer to have a separate MR for it...

Revision history for this message
Sylvain Pineau (sylvain-pineau) wrote :

self-approved

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1diff --git a/plainbox/impl/providers/exporters/data/checkbox.json b/plainbox/impl/providers/exporters/data/checkbox.json
2index 95a2fa3..cea8dec 100644
3--- a/plainbox/impl/providers/exporters/data/checkbox.json
4+++ b/plainbox/impl/providers/exporters/data/checkbox.json
5@@ -2,7 +2,9 @@
6 {%- set state = manager.default_device_context.state -%}
7 {%- set resource_map = state.resource_map -%}
8 {%- set job_state_map = state.job_state_map -%}
9+{%- set category_map = state.category_map -%}
10 {
11+ "title": {{ state.metadata.title | jsonify | safe }},
12 {%- if "description" in app_blob %}
13 {%- if app_blob['description'] %}
14 "description": {{ app_blob['description'] | jsonify | safe }},
15@@ -46,7 +48,7 @@
16 "id": "{{ job_id|strip_ns }}",
17 "name": "{{ job_state.job.tr_summary() }}",
18 "certification_status": "{{ job_state.effective_certification_status }}",
19- "category": "{{ job_state.effective_category_id }}",
20+ "category": "{{ category_map[job_state.effective_category_id] }}",
21 "status": "{{ job_state.result.outcome_meta().hexr_mapping }}",
22 "comments": {{ job_state.result.comments | jsonify | safe }},
23 "io_log": {{ job_state.result.io_log_as_flat_text | jsonify | safe }},
24diff --git a/plainbox/impl/unit/testplan.py b/plainbox/impl/unit/testplan.py
25index a5d9ebc..53567a5 100644
26--- a/plainbox/impl/unit/testplan.py
27+++ b/plainbox/impl/unit/testplan.py
28@@ -645,9 +645,8 @@ class TestPlanUnit(UnitWithId):
29 lambda referrer, referee: referee.unit == 'job',
30 message=_("the referenced unit is not a job")),
31 ReferenceConstraint(
32- lambda referrer, referee: (
33- referee.plugin == 'resource'),
34- message=_("only resource jobs are allowed "
35+ lambda referrer, referee: referee.automated,
36+ message=_("only automated jobs are allowed "
37 "in bootstrapping_include"))])
38 ],
39 fields.exclude: [

Subscribers

People subscribed via source and target branches