Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
9 changed files
with
282 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
97 changes: 97 additions & 0 deletions
97
tcms/telemetry/static/telemetry/js/testing/execution-trends.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,97 @@ | ||
$(document).ready(() => { | ||
loadInitialProduct(); | ||
loadInitialTestPlans(); | ||
|
||
document.getElementById('id_product').onchange = () => { | ||
update_version_select_from_product(); | ||
update_build_select_from_product(true); | ||
updateTestPlanSelectFromProduct(drawChart); | ||
}; | ||
|
||
document.getElementById('id_version').onchange = drawChart; | ||
document.getElementById('id_build').onchange = drawChart; | ||
document.getElementById('id_test_plan').onchange = drawChart; | ||
|
||
$('#id_after').on('dp.change', drawChart); | ||
$('#id_before').on('dp.change', drawChart); | ||
|
||
drawChart(); | ||
}); | ||
|
||
function drawChart() { | ||
const query = {}; | ||
|
||
const productId = $('#id_product').val(); | ||
if (productId) { | ||
query['case__plan__product'] = productId; | ||
} | ||
|
||
const versionId = $('#id_version').val(); | ||
if (versionId) { | ||
query['case__plan__product_version'] = versionId; | ||
} | ||
|
||
const buildId = $('#id_build').val(); | ||
if (buildId) { | ||
query['build_id'] = buildId; | ||
} | ||
|
||
const testPlanId = $('#id_test_plan').val(); | ||
if (testPlanId) { | ||
query['case__plan__plan_id'] = testPlanId; | ||
} | ||
|
||
const dateBefore = $('#id_before'); | ||
if (dateBefore.val()) { | ||
query['close_date__lte'] = dateBefore.data('DateTimePicker').date().format('YYYY-MM-DD 23:59:59'); | ||
} | ||
|
||
const dateAfter = $('#id_after'); | ||
if (dateAfter.val()) { | ||
query['close_date__gte'] = dateAfter.data('DateTimePicker').date().format('YYYY-MM-DD 00:00:00'); | ||
} | ||
|
||
jsonRPC('Testing.execution_trends', query, data => { | ||
const chartData = []; | ||
|
||
Object.entries(data.data_set).forEach(entry => { | ||
chartData.push([entry[0], ...entry[1]]); | ||
}); | ||
|
||
$('#chart > svg').remove(); | ||
|
||
const c3ChartDefaults = $().c3ChartDefaults(); | ||
const config = c3ChartDefaults.getDefaultAreaConfig(); | ||
config.axis = { | ||
x: { | ||
categories: data.categories, | ||
type: 'category', | ||
tick: { | ||
format: runId => `TR-${runId}`, | ||
fit: false, | ||
multiline: false, | ||
}, | ||
}, | ||
y: { | ||
tick: { | ||
format: showOnlyRoundNumbers | ||
} | ||
} | ||
}; | ||
config.bindto = '#chart'; | ||
config.color = { | ||
pattern: data.colors | ||
}; | ||
config.data = { | ||
columns: chartData, | ||
type: 'area-spline', | ||
order: null | ||
}; | ||
config.bar = { | ||
width: { | ||
ratio: 1 | ||
} | ||
}; | ||
c3.generate(config); | ||
}); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
95 changes: 95 additions & 0 deletions
95
tcms/telemetry/templates/telemetry/testing/execution-trends.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,95 @@ | ||
{% extends "base.html" %} | ||
{% load i18n %} | ||
{% load static %} | ||
|
||
{% block title %}{% trans "Testing Status Matrix" %}{% endblock %} | ||
|
||
{% block contents %} | ||
|
||
<div class="container-fluid container-cards-pf"> | ||
|
||
<form class="form-horizontal"> | ||
<div class="form-group"> | ||
<label for="id_product" class="col-md-1 col-lg-1"> | ||
{% trans "Product" %} | ||
</label> | ||
<div class="col-md-3"> | ||
<select name="product" id="id_product" class="form-control selectpicker"> | ||
<option value="">----------</option> | ||
</select> | ||
</div> | ||
|
||
<label for="id_version" class="col-md-1 col-lg-1"> | ||
{% trans "Version" %} | ||
</label> | ||
<div class="col-md-3"> | ||
<select name="version" id="id_version" class="form-control selectpicker"> | ||
<option value="">----------</option> | ||
</select> | ||
</div> | ||
|
||
<label for="id_build" class="col-md-1 col-lg-1"> | ||
{% trans "Build" %} | ||
</label> | ||
<div class="col-md-3"> | ||
<select name="build" id="id_build" class="form-control selectpicker"> | ||
<option value="">----------</option> | ||
</select> | ||
</div> | ||
</div> | ||
|
||
<div class="form-group"> | ||
<label for="id_test_plan" class="col-md-1 col-lg-1"> | ||
{% trans "Test Plan" %} | ||
</label> | ||
<div class="col-md-3"> | ||
<select name="test_plan" id="id_test_plan" class="form-control selectpicker"> | ||
<option value="">----------</option> | ||
</select> | ||
</div> | ||
|
||
<label class="col-md-1 col-lg-1" for="id_after">{% trans "After" %}</label> | ||
<div class="col-md-3 col-lg-3"> | ||
<div class="input-group date-time-picker-pf"> | ||
<input type="text" class="form-control" id="id_after"> | ||
<span class="input-group-addon"> | ||
<span class="fa fa-calendar"></span> | ||
</span> | ||
</div> | ||
|
||
{% include "datetimepicker_script.html" with selector="#id_after" %} | ||
</div> | ||
|
||
<label class="col-md-1 col-lg-1" for="id_before">{% trans "Before" %}</label> | ||
<div class="col-md-3 col-lg-3"> | ||
<div class="input-group date-time-picker-pf"> | ||
<input type="text" class="form-control" id="id_before"> | ||
<span class="input-group-addon"> | ||
<span class="fa fa-calendar"></span> | ||
</span> | ||
</div> | ||
|
||
{% include "datetimepicker_script.html" with selector="#id_before" %} | ||
</div> | ||
</div> | ||
</form> | ||
|
||
<div id="chart"></div> | ||
|
||
<div id="area-chart-4"></div> | ||
</div> | ||
|
||
<script src="{% static 'moment/min/moment-with-locales.min.js' %}"></script> | ||
<script src="{% static 'eonasdan-bootstrap-datetimepicker/build/js/bootstrap-datetimepicker.min.js' %}"></script> | ||
<script src="{% static 'bootstrap-select/dist/js/bootstrap-select.min.js' %}"></script> | ||
<script src="{% static 'bootstrap-switch/dist/js/bootstrap-switch.min.js' %}"></script> | ||
<script src="{% static 'c3/c3.min.js' %}"></script> | ||
<script src="{% static 'd3/d3.min.js' %}"></script> | ||
|
||
<script src="{% static 'js/jsonrpc.js' %}"></script> | ||
<script src="{% static 'js/utils.js' %}"></script> | ||
|
||
<script src="{% static 'telemetry/js/testing/utils.js' %}"></script> | ||
<script src="{% static 'telemetry/js/testing/execution-trends.js' %}"></script> | ||
|
||
{% endblock %} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters