diff --git a/mod_test/controllers.py b/mod_test/controllers.py index 82eb98d3e..bb34319b2 100644 --- a/mod_test/controllers.py +++ b/mod_test/controllers.py @@ -212,11 +212,23 @@ def get_json_data(test_id): 'message': entry.message }) + # Calculate sample progress from existing TestResult data + 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 jsonify({ 'status': 'success', 'details': pr_data["progress"], 'complete': test.finished, - 'progress_array': progress_array + 'progress_array': progress_array, + '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 8a92167db..6818b47d3 100644 --- a/templates/test/by_id.html +++ b/templates/test/by_id.html @@ -1,6 +1,22 @@ {% extends "base.html" %} {% block title %}Test progress for {{ title }} {{ super() }}{% endblock %} + +{% block styles %} + {{ super() }} + +{% endblock %} + {% block body %} {{ super() }}
@@ -48,7 +64,14 @@

Test progress for {{ title }}

{% if progress.progress.state == 'error' and progress.progress.step == loop.index0 -%} {% set status = status ~ ' error' %} {%- endif %} -
  • {{ stage.description }}
  • +
  • + {{ stage.description }} + {% if stage.description == 'Testing' and status == 'running' %} +
    + 0 / 0 samples +
    + {% endif %} +
  • {%- endfor %}
    @@ -181,6 +204,17 @@
    There are no tests executed in this category.
    if (testprogress === 0 && val.length !== 0) { window.location.reload(); } + + // Update sample progress display + if (data.sample_progress) { + var progressText = document.getElementById('sample-progress-text'); + if (progressText) { + progressText.textContent = data.sample_progress.current + ' / ' + + data.sample_progress.total + ' samples (' + + data.sample_progress.percentage + '%)'; + } + } + {% for stage in progress.stages %} if (data.details.step >= {{ loop.index0 }}) { status = 'done';