Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 13 additions & 1 deletion mod_test/controllers.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
}
})


Expand Down
36 changes: 35 additions & 1 deletion templates/test/by_id.html
Original file line number Diff line number Diff line change
@@ -1,6 +1,22 @@
{% extends "base.html" %}

{% block title %}Test progress for {{ title }} {{ super() }}{% endblock %}

{% block styles %}
{{ super() }}
<style>
.sample-progress {
margin-top: 5px;
font-size: 12px;
color: #666;
}
#sample-progress-text {
display: block;
text-align: center;
}
</style>
{% endblock %}

{% block body %}
{{ super() }}
<br />
Expand Down Expand Up @@ -48,7 +64,14 @@ <h1>Test progress for {{ title }}</h1>
{% if progress.progress.state == 'error' and progress.progress.step == loop.index0 -%}
{% set status = status ~ ' error' %}
{%- endif %}
<li class="progtrckr-{{ status }}" id="trckr-{{ stage.description }}">{{ stage.description }}</li>
<li class="progtrckr-{{ status }}" id="trckr-{{ stage.description }}">
{{ stage.description }}
{% if stage.description == 'Testing' and status == 'running' %}
<div class="sample-progress" id="sample-progress">
<small id="sample-progress-text">0 / 0 samples</small>
</div>
{% endif %}
</li>
{%- endfor %}
</ol>
<br class="clear" />
Expand Down Expand Up @@ -181,6 +204,17 @@ <h6>There are no tests executed in this category.</h6>
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';
Expand Down