diff --git a/mod_test/controllers.py b/mod_test/controllers.py index fb35dab5..67de3a4d 100644 --- a/mod_test/controllers.py +++ b/mod_test/controllers.py @@ -150,12 +150,24 @@ def get_data_for_test(test, title=None) -> Dict[str, Any]: results = get_test_results(test) + # Calculate sample progress for initial page load + completed_samples = len(test.results) + total_samples = len(test.get_customized_regressiontests()) + progress_percentage = 0 + if total_samples > 0: + progress_percentage = int((completed_samples / total_samples) * 100) + return { 'test': test, 'TestType': TestType, 'results': results, 'title': title, - 'avg_minutes': avg_minutes + 'avg_minutes': avg_minutes, + 'sample_progress': { + 'current': completed_samples, + 'total': total_samples, + 'percentage': progress_percentage + } } diff --git a/templates/test/by_id.html b/templates/test/by_id.html index d9a6c5cd..92aa37e7 100644 --- a/templates/test/by_id.html +++ b/templates/test/by_id.html @@ -68,7 +68,7 @@

Test progress for {{ title }}

{{ stage.description }} {% if stage.description == 'Testing' and status == 'running' %}
- 0 / 0 samples + {{ sample_progress.current }} / {{ sample_progress.total }} samples{% if sample_progress.total > 0 %} ({{ sample_progress.percentage }}%){% endif %}
{% endif %}