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
diff --git a/plainbox/impl/providers/exporters/data/checkbox.json b/plainbox/impl/providers/exporters/data/checkbox.json
index 95a2fa3..cea8dec 100644
--- a/plainbox/impl/providers/exporters/data/checkbox.json
+++ b/plainbox/impl/providers/exporters/data/checkbox.json
@@ -2,7 +2,9 @@
2{%- set state = manager.default_device_context.state -%}2{%- set state = manager.default_device_context.state -%}
3{%- set resource_map = state.resource_map -%}3{%- set resource_map = state.resource_map -%}
4{%- set job_state_map = state.job_state_map -%}4{%- set job_state_map = state.job_state_map -%}
5{%- set category_map = state.category_map -%}
5{6{
7 "title": {{ state.metadata.title | jsonify | safe }},
6{%- if "description" in app_blob %}8{%- if "description" in app_blob %}
7{%- if app_blob['description'] %}9{%- if app_blob['description'] %}
8 "description": {{ app_blob['description'] | jsonify | safe }},10 "description": {{ app_blob['description'] | jsonify | safe }},
@@ -46,7 +48,7 @@
46 "id": "{{ job_id|strip_ns }}",48 "id": "{{ job_id|strip_ns }}",
47 "name": "{{ job_state.job.tr_summary() }}",49 "name": "{{ job_state.job.tr_summary() }}",
48 "certification_status": "{{ job_state.effective_certification_status }}",50 "certification_status": "{{ job_state.effective_certification_status }}",
49 "category": "{{ job_state.effective_category_id }}",51 "category": "{{ category_map[job_state.effective_category_id] }}",
50 "status": "{{ job_state.result.outcome_meta().hexr_mapping }}",52 "status": "{{ job_state.result.outcome_meta().hexr_mapping }}",
51 "comments": {{ job_state.result.comments | jsonify | safe }},53 "comments": {{ job_state.result.comments | jsonify | safe }},
52 "io_log": {{ job_state.result.io_log_as_flat_text | jsonify | safe }},54 "io_log": {{ job_state.result.io_log_as_flat_text | jsonify | safe }},
diff --git a/plainbox/impl/unit/testplan.py b/plainbox/impl/unit/testplan.py
index a5d9ebc..53567a5 100644
--- a/plainbox/impl/unit/testplan.py
+++ b/plainbox/impl/unit/testplan.py
@@ -645,9 +645,8 @@ class TestPlanUnit(UnitWithId):
645 lambda referrer, referee: referee.unit == 'job',645 lambda referrer, referee: referee.unit == 'job',
646 message=_("the referenced unit is not a job")),646 message=_("the referenced unit is not a job")),
647 ReferenceConstraint(647 ReferenceConstraint(
648 lambda referrer, referee: (648 lambda referrer, referee: referee.automated,
649 referee.plugin == 'resource'),649 message=_("only automated jobs are allowed "
650 message=_("only resource jobs are allowed "
651 "in bootstrapping_include"))])650 "in bootstrapping_include"))])
652 ],651 ],
653 fields.exclude: [652 fields.exclude: [

Subscribers

People subscribed via source and target branches