{% set tests_by_category = tests|groupby('status.category') %}
{% set nodes_run = tests|map(attribute='item.nodeid')|list %}
{% set nof_nodes_not_run = session.items|rejectattr('nodeid', 'in', nodes_run)|list|count %}
{% for category, tests in tests_by_category %}
{{ tests|count }}
{{ category }}
{% endfor %}
{% if nof_nodes_not_run %}
{{ nof_nodes_not_run }}
not run
{% endif %}