diff --git a/mod_regression/models.py b/mod_regression/models.py index 9ade0a61..7d11b472 100644 --- a/mod_regression/models.py +++ b/mod_regression/models.py @@ -137,6 +137,16 @@ def __repr__(self) -> str: """ return f"" + @property + def never_worked(self) -> bool: + """ + Determine if this regression test has never passed on any platform. + + :return: True if the test has no pass history on either platform + :rtype: bool + """ + return self.last_passed_on_linux is None and self.last_passed_on_windows is None + class RegressionTestOutput(Base): """Model to store output of regression test.""" diff --git a/templates/macros.html b/templates/macros.html index 424c619b..72a393d7 100644 --- a/templates/macros.html +++ b/templates/macros.html @@ -21,6 +21,19 @@ {% endif %} {% endmacro %} +{% macro platform_history_cell(test) %} + {% if test.never_worked %} + Never Worked + {% else %} + {% if test.last_passed_on_linux %} + #{{ test.last_passed_on_linux }}  + {% endif %} + {% if test.last_passed_on_windows %} + #{{ test.last_passed_on_windows }} + {% endif %} + {% endif %} +{% endmacro %} + {% macro render_media_info(info) %}