Skip to content

Commit

Permalink
stable-rc: use common templates created for stable
Browse files Browse the repository at this point in the history
Use common templates such as `stable_build.j2`, `stable_revision.j2`,
`stable_revision_summary.j2`, and `common.j2` to avoid
duplication in `stable-rc` and `stable-rt` report templates.

Signed-off-by: Jeny Sadadia <[email protected]>
  • Loading branch information
Jeny Sadadia committed Aug 29, 2024
1 parent 5e6b323 commit 16df8cf
Show file tree
Hide file tree
Showing 7 changed files with 8 additions and 97 deletions.
2 changes: 1 addition & 1 deletion kcidb/monitor/subscriptions/linux_stable_rc.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ def match_revision(revision):
# Send notification 3 hours after a revision is created/updated
return (Message(
subject='KernelCI report for stable-rc: '
'{% include "stable_rc_revision_summary.txt.j2" %}',
'{% include "stable_revision_summary.txt.j2" %}',
to=["Jeny Sadadia <[email protected]>",
"Gustavo Padovan <[email protected]>",
"Shreeya Patel <[email protected]>"],
Expand Down
3 changes: 0 additions & 3 deletions kcidb/templates/stable_rc.j2

This file was deleted.

48 changes: 0 additions & 48 deletions kcidb/templates/stable_rc_build.j2

This file was deleted.

34 changes: 0 additions & 34 deletions kcidb/templates/stable_rc_revision.j2

This file was deleted.

6 changes: 3 additions & 3 deletions kcidb/templates/stable_rc_revision_description.txt.j2
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{# Revision description template #}
{% import "stable_rc.j2" as stable_rc_macros %}
{% from "common.j2" import selected_origins %}
{% import "stable_rc_test.j2" as test_macros %}
{% import "stable_rc_build.j2" as build_macros %}
{% import "stable_build.j2" as build_macros %}
{% import "misc.j2" as misc_macros %}
{# Maximum length of a list of things (builds/tests/etc.) #}
{% set max_list_len = 5 %}
Expand All @@ -18,7 +18,7 @@ OVERVIEW
Boot tests: {{ test_macros.tests_stats(revision) }}
{% endif %}
CI systems: {{ revision.checkouts | map(attribute="origin") |
unique | sort | select('in', stable_rc_macros.selected_origins) | join(", ") }}
unique | sort | select('in', selected_origins) | join(", ") }}

REVISION

Expand Down
3 changes: 0 additions & 3 deletions kcidb/templates/stable_rc_revision_summary.txt.j2

This file was deleted.

9 changes: 4 additions & 5 deletions kcidb/templates/stable_rc_test.j2
Original file line number Diff line number Diff line change
@@ -1,12 +1,11 @@
{# Test macros #}
{% import "stable_rc.j2" as stable_rc_macros %}
{% from "stable_rc.j2" import indent %}
{% from "common.j2" import selected_origins, indent %}

{% macro tests_stats(container) %}
{% if container.tests %}
{% set boot_tests = container.tests_root["boot"].waived_status_tests %}
{% set failed_tests = boot_tests[false]["FAIL"] | selectattr('origin', 'in', stable_rc_macros.selected_origins) | list %}
{% set passed_tests = boot_tests[false]["PASS"] | selectattr('origin', 'in', stable_rc_macros.selected_origins) | list %}
{% set failed_tests = boot_tests[false]["FAIL"] | selectattr('origin', 'in', selected_origins) | list %}
{% set passed_tests = boot_tests[false]["PASS"] | selectattr('origin', 'in', selected_origins) | list %}
{{- passed_tests | length | string + " passed, " +
failed_tests | length | string + " failed" }}
{% endif %}
Expand All @@ -16,7 +15,7 @@
{{- "\nBOOT TESTS" }}
{% if container.tests %}
{% set failed_boot_tests = container.tests_root["boot"].waived_status_tests[false]["FAIL"] |
selectattr('origin', 'in', stable_rc_macros.selected_origins) | list %}
selectattr('origin', 'in', selected_origins) | list %}
{% if failed_boot_tests %}
{{- "\n Failures" }}
{% for origin, boot_tests in failed_boot_tests|groupby("origin") %}
Expand Down

0 comments on commit 16df8cf

Please sign in to comment.