From 04bd3a2c1dbfa57daf029170368e69b68ab300f4 Mon Sep 17 00:00:00 2001 From: Prahitha Movva Date: Tue, 25 May 2021 23:06:39 +0530 Subject: [PATCH 1/4] filter for test coverage Signed-off-by: Prahitha Movva --- conf/report/report-template.html | 44 +++++++++++++++++++++++++++++++- 1 file changed, 43 insertions(+), 1 deletion(-) diff --git a/conf/report/report-template.html b/conf/report/report-template.html index 8b10a9f92104a..162a7e79d5209 100644 --- a/conf/report/report-template.html +++ b/conf/report/report-template.html @@ -15,6 +15,8 @@ + + @@ -33,7 +35,47 @@ {% for tool in report %} { "orderDataType": "test-status" }, {% endfor %} - ] + ], + initComplete: function() { + this.api().columns([2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17]).every(function() { + var column = this; + var select = $('') + .appendTo($(column.footer()).empty()) + .on('change', function() { + var val = $(this).val(); + if(val.length > 1){ + val = parseFloat(val.slice(0, -1)); + } else { + val = parseFloat(val); + } + column.data().each(function(d, j) { + output = d.split('/'); + tests_passed = output[0]; + total_tests = output[1]; + percentage = (tests_passed/total_tests)*100; + + // 0 tests passed + if(tests_passed == val && tests_passed == 0){ + column.draw(); + } + // At least 1 test passed + else if(tests_passed >= val && val == 1){ + column.draw(); + } + // other cases + else if(percentage >= val && val > 1) { + column.draw(); + } + }) + } ); + select.append(''); + select.append(''); + select.append(''); + select.append(''); + select.append(''); + select.append(''); + } ); + } }); } ); From dc93a1cc82247e36cda23beb68faa6cbb5469fd0 Mon Sep 17 00:00:00 2001 From: Prahitha Movva Date: Mon, 31 May 2021 20:19:09 +0530 Subject: [PATCH 2/4] works; but has some bugs Signed-off-by: Prahitha Movva --- conf/report/report-template.html | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/conf/report/report-template.html b/conf/report/report-template.html index 162a7e79d5209..5cfefe2eea085 100644 --- a/conf/report/report-template.html +++ b/conf/report/report-template.html @@ -42,6 +42,7 @@ var select = $('') .appendTo($(column.footer()).empty()) .on('change', function() { + var array = [] var val = $(this).val(); if(val.length > 1){ val = parseFloat(val.slice(0, -1)); @@ -55,18 +56,20 @@ percentage = (tests_passed/total_tests)*100; // 0 tests passed - if(tests_passed == val && tests_passed == 0){ - column.draw(); + if(tests_passed == val && tests_passed == 0 && tests_passed != ""){ + array.push(d); } // At least 1 test passed else if(tests_passed >= val && val == 1){ - column.draw(); + array.push(d); } // other cases else if(percentage >= val && val > 1) { - column.draw(); + array.push(d); } - }) + }); + array = array.join('|'); + column.search(array, true, false, true).draw(); } ); select.append(''); select.append(''); From e645d28870fc0e55f542b992b06d5bf4d351e4eb Mon Sep 17 00:00:00 2001 From: Prahitha Movva Date: Wed, 2 Jun 2021 21:37:50 +0530 Subject: [PATCH 3/4] toggle buttons for filter Signed-off-by: Prahitha Movva --- conf/report/report-template.html | 35 ++++++++++++++++++++++++++++---- 1 file changed, 31 insertions(+), 4 deletions(-) diff --git a/conf/report/report-template.html b/conf/report/report-template.html index 5cfefe2eea085..a7e4ef6e09b6c 100644 --- a/conf/report/report-template.html +++ b/conf/report/report-template.html @@ -22,6 +22,24 @@