diff options
Diffstat (limited to 'utils/test')
15 files changed, 74 insertions, 220 deletions
diff --git a/utils/test/reporting/LICENSE.txt b/utils/test/reporting/LICENSE.txt index d447b560b..4d0b33c6e 100644 --- a/utils/test/reporting/LICENSE.txt +++ b/utils/test/reporting/LICENSE.txt @@ -1,5 +1,5 @@ -Creative Commons Attribution 3.0 Unported
-http://creativecommons.org/licenses/by/3.0/
+This work is licensed under a Creative Commons Attribution 4.0 International License.
+SPDX-License-Identifier: CC-BY-4.0
License
diff --git a/utils/test/reporting/README.txt b/utils/test/reporting/README.txt index 31b8d044d..049cf62ef 100644 --- a/utils/test/reporting/README.txt +++ b/utils/test/reporting/README.txt @@ -1,6 +1,6 @@ Phantom by HTML5 UP
html5up.net | @ajlkn
-Free for personal and commercial use under the CCA 3.0 license (html5up.net/license)
+SPDX-License-Identifier: CC-BY-4.0
This is Phantom, a simple design built around a grid of large, colorful, semi-interactive
@@ -30,4 +30,4 @@ Credits: html5shiv.js (@afarkas @jdalton @jon_neal @rem)
Misc. Sass functions (@HugoGiraudel)
Respond.js (j.mp/respondjs)
- Skel (skel.io)
\ No newline at end of file + Skel (skel.io)
diff --git a/utils/test/reporting/api/api/handlers/testcases.py b/utils/test/reporting/api/api/handlers/testcases.py index 110ac4c26..2b9118623 100644 --- a/utils/test/reporting/api/api/handlers/testcases.py +++ b/utils/test/reporting/api/api/handlers/testcases.py @@ -20,7 +20,7 @@ class TestCases(BaseHandler): url = '{}/projects/{}/cases'.format(conf.base_url, project) cases = requests.get(url).json().get('testcases', []) - data = [t['name'] for t in cases] + data = [{t['name']: t['catalog_description']} for t in cases] self.write(json_encode(data)) diff --git a/utils/test/reporting/pages/app/images/overview.png b/utils/test/reporting/pages/app/images/overview.png Binary files differindex 14dbbff42..f1688cf37 100644 --- a/utils/test/reporting/pages/app/images/overview.png +++ b/utils/test/reporting/pages/app/images/overview.png diff --git a/utils/test/reporting/pages/app/scripts/controllers/testvisual.controller.js b/utils/test/reporting/pages/app/scripts/controllers/testvisual.controller.js index 7082aede0..def8e7293 100644 --- a/utils/test/reporting/pages/app/scripts/controllers/testvisual.controller.js +++ b/utils/test/reporting/pages/app/scripts/controllers/testvisual.controller.js @@ -10,16 +10,16 @@ angular.module('opnfvApp') .controller('testVisualController', ['$scope', '$state', '$stateParams', 'TableFactory', 'ngDialog', '$http', '$loading', function($scope, $state, $stateParams, TableFactory, ngDialog, $http, $loading) { - $scope.dovet = "59,222,156,317"; - $scope.functest = "203,163,334,365"; - $scope.yardstick = "398,161,513,384"; - $scope.vsperf = "567,163,673,350"; - $scope.stor = "686,165,789,341"; - $scope.qtip = "802,164,905,341"; - $scope.bootleneck = "917,161,1022,338"; - $scope.noPopArea1 = "30,11,1243,146"; - $scope.noPopArea2 = "1041,157,1250,561"; - $scope.noPopArea3 = "15,392,1027,561"; + $scope.dovet = "50,168,177,443"; + $scope.functest = "194,173,356,442"; + $scope.yardstick = "377,183,521,412"; + $scope.vsperf = "542,185,640,414"; + $scope.stor = "658,187,750,410"; + $scope.qtip = "769,190,852,416"; + $scope.bootleneck = "870,192,983,419"; + $scope.noPopArea1 = "26,8,1190,180"; + $scope.noPopArea2 = "1018,193,1190,590"; + $scope.noPopArea3 = "37,455,1003,584"; init(); $scope.showSelectValue = 0; @@ -51,20 +51,41 @@ angular.module('opnfvApp') $http.get(url, config).then(function(response) { if (response.status == 200) { $scope.tableData = response.data; + + $scope.tableData = constructObjectArray($scope.tableData); + console.log($scope.tableData); $loading.finish('Key'); + } }) } + //construct key value for tableData + function constructObjectArray(array) { + var templateArray = []; + for (var i = 0; i < array.length; i++) { + var key = Object.keys(array[i])[0]; + var value = array[i][key]; + var temp = { + 'key': key, + 'value': value + }; + templateArray.push(temp); + + } + + return templateArray; + } + function getDetail(casename) { TableFactory.getProjectTestCaseDetail().get({ 'project': $scope.modalName, 'testcase': casename }).$promise.then(function(response) { if (response != null) { - $scope.project_name_modal = response.project_name; + $scope.name_modal = response.name; $scope.description_modal = response.description; openTestDetail(); } @@ -108,4 +129,4 @@ angular.module('opnfvApp') } - ]);
\ No newline at end of file + ]); diff --git a/utils/test/reporting/pages/app/styles/custome.css b/utils/test/reporting/pages/app/styles/custome.css index 7ab869b56..8e567ca6e 100644 --- a/utils/test/reporting/pages/app/styles/custome.css +++ b/utils/test/reporting/pages/app/styles/custome.css @@ -71,6 +71,7 @@ html { border-radius: 5px 5px 5px 5px; background-color: #f3f3f4; opacity: 0.9; + width: 200px; } .ngdialog.ngdialog.ngdialog-theme-default .ngdialog-content { diff --git a/utils/test/reporting/pages/app/views/commons/testCaseVisual.html b/utils/test/reporting/pages/app/views/commons/testCaseVisual.html index 9d146ba93..74eb56eba 100644 --- a/utils/test/reporting/pages/app/views/commons/testCaseVisual.html +++ b/utils/test/reporting/pages/app/views/commons/testCaseVisual.html @@ -4,7 +4,7 @@ <div class="row"> - <div class="row border-bottom white-bg dashboard-header" style="border-radius: 5px 5px 5px 5px "> + <div class="row border-bottom white-bg dashboard-header" style="border-radius: 5px 5px 5px 5px;width:90%;margin-left:30px; "> <h3>OPNFV Test ecosystem <small> *mouse over display test case list</small> @@ -70,7 +70,7 @@ </div> - <div id="popup" class="popup" style="width: 20%;height: 35%" dw-loading="Key"> + <div id="popup" class="popup" style="width: 40%;height: 35%" dw-loading="Key"> <div ng-show="tableData.length==0"> <center> @@ -90,7 +90,8 @@ <tbody> <tr dir-paginate="data in tableData | itemsPerPage: 8 track by $index "> - <td><a ng-click="getDetail(data)"> {{data}}</a></td> + <td ng-if="data.value!=null"><a ng-click="getDetail(data.key)"> {{data.value}}</a></td> + <td ng-if="data.value==null"><a ng-click="getDetail(data.key)"> null</a></td> <tr> </tbody> diff --git a/utils/test/reporting/pages/app/views/modal/testcasedetail.html b/utils/test/reporting/pages/app/views/modal/testcasedetail.html index 8918b3f74..db6f71295 100644 --- a/utils/test/reporting/pages/app/views/modal/testcasedetail.html +++ b/utils/test/reporting/pages/app/views/modal/testcasedetail.html @@ -2,6 +2,6 @@ <div class="hr-line-dashed"></div> -<strong> name</strong>: {{project_name_modal}}<br> +<strong> name</strong>: {{name_modal}}<br> -<strong>description</strong>: {{description_modal}}<br>
\ No newline at end of file +<strong>description</strong>: {{description_modal}}<br> diff --git a/utils/test/testapi/3rd_party/static/testapi-ui/assets/img/OpenStack_Project_Refstack_mascot_90x90.png b/utils/test/testapi/3rd_party/static/testapi-ui/assets/img/OpenStack_Project_Refstack_mascot_90x90.png Binary files differdeleted file mode 100755 index 4695090dc..000000000 --- a/utils/test/testapi/3rd_party/static/testapi-ui/assets/img/OpenStack_Project_Refstack_mascot_90x90.png +++ /dev/null diff --git a/utils/test/testapi/3rd_party/static/testapi-ui/assets/img/openstack-logo.png b/utils/test/testapi/3rd_party/static/testapi-ui/assets/img/openstack-logo.png Binary files differdeleted file mode 100644 index 826bf2e5d..000000000 --- a/utils/test/testapi/3rd_party/static/testapi-ui/assets/img/openstack-logo.png +++ /dev/null diff --git a/utils/test/testapi/3rd_party/static/testapi-ui/assets/img/refstack-logo.png b/utils/test/testapi/3rd_party/static/testapi-ui/assets/img/refstack-logo.png Binary files differdeleted file mode 100755 index fc45f3ee0..000000000 --- a/utils/test/testapi/3rd_party/static/testapi-ui/assets/img/refstack-logo.png +++ /dev/null diff --git a/utils/test/testapi/3rd_party/static/testapi-ui/assets/img/testapi-logo.png b/utils/test/testapi/3rd_party/static/testapi-ui/assets/img/testapi-logo.png Binary files differnew file mode 100644 index 000000000..ff78eb1ee --- /dev/null +++ b/utils/test/testapi/3rd_party/static/testapi-ui/assets/img/testapi-logo.png diff --git a/utils/test/testapi/3rd_party/static/testapi-ui/components/results/results.html b/utils/test/testapi/3rd_party/static/testapi-ui/components/results/results.html index 2a43cd1e2..3056e1dbe 100644 --- a/utils/test/testapi/3rd_party/static/testapi-ui/components/results/results.html +++ b/utils/test/testapi/3rd_party/static/testapi-ui/components/results/results.html @@ -43,184 +43,36 @@ <div cg-busy="{promise:ctrl.resultsRequest,message:'Loading'}"></div> <div ng-show="ctrl.data" class="results-table"> - <table ng-show="ctrl.data" class="table table-striped table-hover"> + <table ng-data="ctrl.data.result" ng-show="ctrl.data" class="table table-striped table-hover"> <thead> <tr> - <th ng-if="ctrl.isUserResults"></th> - <th>Upload Date</th> - <th>Test Run ID</th> - <th ng-if="ctrl.isUserResults">Vendor</th> - <th ng-if="ctrl.isUserResults">Product (version)</th> - <th ng-if="ctrl.isUserResults">Target Program</th> - <th ng-if="ctrl.isUserResults">Guideline</th> - <th ng-if="ctrl.isUserResults">Verified</th> - <th ng-if="ctrl.isUserResults">Shared</th> + <th>ID</th> + <th>Pod</th> + <th>Project</th> + <th>Test Case</th> + <th>Installer</th> + <th>Version</th> + <th>Scenario</th> + <th>Criteria</th> + <th>Start Date</th> + <th>Stop Date</th> </tr> </thead> <tbody> <tr ng-repeat-start="(index, result) in ctrl.data.results"> - <td ng-if="ctrl.isUserResults"> - <a ng-if="!result.expanded" - class="glyphicon glyphicon-plus" - ng-click="result.expanded = true"> - </a> - <a ng-if="result.expanded" - class="glyphicon glyphicon-minus" - ng-click="result.expanded = false"> - </a> - </td> - <td>{{result.created_at}}</td> - <td><a ui-sref="resultsDetail({testID: result.id})"> - {{result.id.slice(0, 8)}}...{{result.id.slice(-8)}} - </a> - </td> - <td ng-if="ctrl.isUserResults"> - {{ctrl.vendors[result.product_version.product_info.organization_id].name || '-'}} - </td> - <td ng-if="ctrl.isUserResults">{{result.product_version.product_info.name || '-'}} - <span ng-if="result.product_version.version"> - ({{result.product_version.version}}) - </span> - </td> - <td ng-if="ctrl.isUserResults">{{ctrl.targetMappings[result.meta.target] || '-'}}</td> - <td ng-if="ctrl.isUserResults">{{result.meta.guideline.slice(0, -5) || '-'}}</td> - <td ng-if="ctrl.isUserResults"> - <span ng-if="result.verification_status" class="glyphicon glyphicon-ok"></span> - <span ng-if="!result.verification_status">-</span> - - </td> - <td ng-if="ctrl.isUserResults"> - <span ng-show="result.meta.shared" class="glyphicon glyphicon-share"></span> - </td> + <td>{{ result._id }}</td> + <td>{{ result.pod_name }}</td> + <td>{{ result.project_name }}</td> + <td>{{ result.case_name }}</td> + <td>{{ result.installer }}</td> + <td>{{ result.version }}</td> + <td>{{ result.scenario }}</td> + <td>{{ result.criteria }}</td> + <td>{{ result.start_date }}</td> + <td>{{ result.stop_date }}</td> </tr> - <tr ng-if="result.expanded" ng-repeat-end> - <td></td> - <td colspan="3"> - <strong>Publicly Shared:</strong> - <span ng-if="result.meta.shared == 'true' && !result.sharedEdit">Yes</span> - <span ng-if="!result.meta.shared && !result.sharedEdit"> - <em>No</em> - </span> - <select ng-if="result.sharedEdit" - ng-model="result.meta.shared" - class="form-inline"> - <option value="true">Yes</option> - <option value="">No</option> - </select> - <a ng-if="!result.sharedEdit" - ng-click="result.sharedEdit = true" - title="Edit" - class="glyphicon glyphicon-pencil"></a> - <a ng-if="result.sharedEdit" - ng-click="ctrl.associateMeta(index,'shared',result.meta.shared)" - title="Save" - class="glyphicon glyphicon-floppy-disk"></a> - <br /> - - <strong>Associated Guideline:</strong> - <span ng-if="!result.meta.guideline && !result.guidelineEdit"> - <em>None</em> - </span> - <span ng-if="result.meta.guideline && !result.guidelineEdit"> - {{result.meta.guideline.slice(0, -5)}} - </span> - <select ng-if="result.guidelineEdit" - ng-model="result.meta.guideline" - ng-options="o as o.slice(0, -5) for o in ctrl.versionList" - class="form-inline"> - <option value="">None</option> - </select> - <a ng-if="!result.guidelineEdit" - ng-click="ctrl.getVersionList();result.guidelineEdit = true" - title="Edit" - class="glyphicon glyphicon-pencil"></a> - <a ng-if="result.guidelineEdit" - ng-click="ctrl.associateMeta(index, 'guideline', result.meta.guideline)" - title="Save" - class="glyphicon glyphicon-floppy-disk"> - </a> - <br /> - - <strong>Associated Target Program:</strong> - <span ng-if="!result.meta.target && !result.targetEdit"> - <em>None</em> - </span> - <span ng-if="result.meta.target && !result.targetEdit"> - {{ctrl.targetMappings[result.meta.target]}}</span> - <select ng-if="result.targetEdit" - ng-model="result.meta.target" - class="form-inline"> - <option value="">None</option> - <option value="platform">OpenStack Powered Platform</option> - <option value="compute">OpenStack Powered Compute</option> - <option value="object">OpenStack Powered Object Storage</option> - </select> - <a ng-if="!result.targetEdit" - ng-click="result.targetEdit = true;" - title="Edit" - class="glyphicon glyphicon-pencil"> - </a> - <a ng-if="result.targetEdit" - ng-click="ctrl.associateMeta(index, 'target', result.meta.target)" - title="Save" - class="glyphicon glyphicon-floppy-disk"> - </a> - <br /> - - <strong>Associated Product:</strong> - <span ng-if="!result.product_version && !result.productEdit"> - <em>None</em> - </span> - <span ng-if="result.product_version && !result.productEdit"> - <span ng-if="ctrl.products[result.product_version.product_info.id].product_type == 0"> - <a ui-sref="distro({id: result.product_version.product_info.id})"> - {{ctrl.products[result.product_version.product_info.id].name}} - <small ng-if="result.product_version.version"> - ({{result.product_version.version}}) - </small> - </a> - </span> - <span ng-if="ctrl.products[result.product_version.product_info.id].product_type != 0"> - <a ui-sref="cloud({id: result.product_version.product_info.id})"> - {{ctrl.products[result.product_version.product_info.id].name}} - <small ng-if="result.product_version.version"> - ({{result.product_version.version}}) - </small> - </a> - </span> - </span> - - <select ng-if="result.productEdit" - ng-options="product as product.name for product in ctrl.products | arrayConverter | orderBy: 'name' track by product.id" - ng-model="result.selectedProduct" - ng-change="ctrl.getProductVersions(result)"> - <option value="">-- No Product --</option> - </select> - - <span ng-if="result.productVersions.length && result.productEdit"> - <span class="glyphicon glyphicon-arrow-right" style="padding-right:3px;color:#303030;"></span> - Version: - <select ng-options="version as version.version for version in result.productVersions | orderBy: 'version' track by version.id" - ng-model="result.selectedVersion"> - </select> - - </span> - <a ng-if="!result.productEdit" - ng-click="ctrl.prepVersionEdit(result)" - title="Edit" - class="glyphicon glyphicon-pencil"> - </a> - <a ng-if="result.productEdit" - ng-click="ctrl.associateProductVersion(result)" - confirm="Once you associate this test to this product, ownership - will be transferred to the product's vendor admins. - Continue?" - title="Save" - class="glyphicon glyphicon-floppy-disk"> - </a> - <br /> - </td> + <tr ng-repeat-end=> </tr> </tbody> </table> diff --git a/utils/test/testapi/3rd_party/static/testapi-ui/components/results/resultsController.js b/utils/test/testapi/3rd_party/static/testapi-ui/components/results/resultsController.js index 2b0338c87..39ace00eb 100644 --- a/utils/test/testapi/3rd_party/static/testapi-ui/components/results/resultsController.js +++ b/utils/test/testapi/3rd_party/static/testapi-ui/components/results/resultsController.js @@ -38,7 +38,6 @@ ctrl.associateMeta = associateMeta; ctrl.getVersionList = getVersionList; ctrl.getUserProducts = getUserProducts; - ctrl.getVendors = getVendors; ctrl.associateProductVersion = associateProductVersion; ctrl.getProductVersions = getProductVersions; ctrl.prepVersionEdit = prepVersionEdit; @@ -100,8 +99,6 @@ ctrl.update(); } - ctrl.getVendors(); - /** * This will contact the TestAPI API to get a listing of test run * results. @@ -126,9 +123,8 @@ ctrl.resultsRequest = $http.get(content_url).success(function (data) { ctrl.data = data; - ctrl.totalItems = ctrl.data.pagination.total_pages * - ctrl.itemsPerPage; - ctrl.currentPage = ctrl.data.pagination.current_page; + ctrl.totalItems = 20 // ctrl.data.pagination.total_pages * ctrl.itemsPerPage; + ctrl.currentPage = 1 // ctrl.data.pagination.current_page; }).error(function (error) { ctrl.data = null; ctrl.totalItems = 0; @@ -248,27 +244,6 @@ } /** - * This will contact the TestAPI API to get a listing of - * vendors. - */ - function getVendors() { - var contentUrl = testapiApiUrl + '/vendors'; - ctrl.vendorsRequest = - $http.get(contentUrl).success(function (data) { - ctrl.vendors = {}; - data.vendors.forEach(function(vendor) { - ctrl.vendors[vendor.id] = vendor; - }); - }).error(function (error) { - ctrl.vendors = null; - ctrl.showError = true; - ctrl.error = - 'Error retrieving vendor listing from server: ' + - angular.toJson(error); - }); - } - - /** * Send a PUT request to the API server to associate a product with * a test result. */ diff --git a/utils/test/testapi/opnfv_testapi/resources/result_handlers.py b/utils/test/testapi/opnfv_testapi/resources/result_handlers.py index 214706f5f..b84d1e3c2 100644 --- a/utils/test/testapi/opnfv_testapi/resources/result_handlers.py +++ b/utils/test/testapi/opnfv_testapi/resources/result_handlers.py @@ -47,7 +47,7 @@ class GenericResultHandler(handlers.GenericApiHandler): query['start_date'] = obj elif k == 'trust_indicator': query[k + '.current'] = float(v) - elif k != 'last': + elif k != 'last' and k != 'page': query[k] = v return query @@ -126,6 +126,10 @@ class ResultsCLHandler(GenericResultHandler): if last is not None: last = self.get_int('last', last) + page = self.get_query_argument('page', 0) + if page: + last = 20 + self._list(query=self.set_query(), sort=[('start_date', -1)], last=last) |