diff --git a/app/cdash/app/Model/Build.php b/app/cdash/app/Model/Build.php index 498d237cf3..a46adf5036 100644 --- a/app/cdash/app/Model/Build.php +++ b/app/cdash/app/Model/Build.php @@ -2239,7 +2239,7 @@ public function GetBuildErrorUrl(): string public function GetTestUrl(): string { - return url('/viewTest.php') . "?buildid={$this->Id}"; + return url("/builds/{$this->Id}/tests"); } public static function ConvertMissingToZero($value): int diff --git a/app/cdash/tests/autoremovebuilds/CMakeLists.txt b/app/cdash/tests/autoremovebuilds/CMakeLists.txt index cf7f6411dc..c5769e4345 100644 --- a/app/cdash/tests/autoremovebuilds/CMakeLists.txt +++ b/app/cdash/tests/autoremovebuilds/CMakeLists.txt @@ -5,7 +5,6 @@ set_property(TEST deletesubproject PROPERTY DEPENDS cypress/e2e/manage-overview cypress/e2e/manage-build-group cypress/e2e/manage-sub-project - cypress/e2e/view-test cypress/e2e/sort-index cypress/e2e/expected-build cypress/e2e/remove-build diff --git a/phpstan-baseline.neon b/phpstan-baseline.neon index 4680fc42c8..1721feeb4d 100644 --- a/phpstan-baseline.neon +++ b/phpstan-baseline.neon @@ -23562,7 +23562,7 @@ parameters: - rawMessage: 'Part $buildid (array|string|null) of encapsed string cannot be cast to string.' identifier: encapsedStringPart.nonString - count: 7 + count: 8 path: routes/web.php - diff --git a/resources/js/angular/controllers/viewTest.js b/resources/js/angular/controllers/viewTest.js deleted file mode 100644 index 211c05893b..0000000000 --- a/resources/js/angular/controllers/viewTest.js +++ /dev/null @@ -1,148 +0,0 @@ -export function ViewTestController($scope, $rootScope, $http, $filter, $q, apiLoader, multisort, filters) { - $scope.loading = true; - - // Pagination settings. - $scope.pagination = []; - $scope.pagination.filteredTests = []; - $scope.pagination.currentPage = 1; - $scope.pagination.maxSize = 5; - - // Check if we have a cookie for number of tests to display. - var num_per_page_cookie = $.cookie('viewTest_num_per_page'); - if(num_per_page_cookie) { - $scope.pagination.numPerPage = parseInt(num_per_page_cookie); - } else { - $scope.pagination.numPerPage = 25; - } - - // Hide filters by default. - $scope.showfilters = false; - - // Check for filters - $rootScope.queryString['filterstring'] = filters.getString(); - - // Check for sort order cookie. - var sort_order = []; - var sort_cookie_value = $.cookie('cdash_view_test_sort'); - if(sort_cookie_value) { - sort_order = sort_cookie_value.split(","); - } else { - // Default sorting : failed tests in alphabetical order. - sort_order = ['subprojectname', 'status', 'name']; - } - $scope.orderByFields = sort_order; - - // Mechanism to cancel the summary/history AJAX query if the user loads another page. - $scope.canceler = $q.defer(); - - apiLoader.loadPageData($scope, 'api/v1/viewTest.php'); - $scope.finishSetup = function() { - $scope.cdash.tests = $filter('orderBy')($scope.cdash.tests, $scope.orderByFields); - $scope.setPage(1); - }; - - $scope.showfilters_toggle = function() { - $scope.showfilters = !$scope.showfilters; - filters.toggle($scope.showfilters); - }; - - $scope.setPage = function (pageNo) { - var begin = ((pageNo - 1) * $scope.pagination.numPerPage) - , end = begin + $scope.pagination.numPerPage; - if (end > 0) { - $scope.pagination.filteredTests = $scope.cdash.tests.slice(begin, end); - } else { - $scope.pagination.filteredTests = $scope.cdash.tests; - } - - // Load history & summary data for these newly revealed tests (if necessary). - var tests_to_load = []; - for (var i = 0, len = $scope.pagination.filteredTests.length; i < len; i++) { - if ( !('detailsloaded' in $scope.pagination.filteredTests[i]) ) { - tests_to_load.push($scope.pagination.filteredTests[i]['name']); - } - } - - if (tests_to_load.length > 0) { - $http({ - url: 'api/v1/viewTest.php', - method: 'GET', - params: { - 'tests[]': tests_to_load, - 'buildid': $scope.cdash.build.id, - 'previous_builds': $scope.cdash.previous_builds, - 'time_begin': $scope.cdash.time_begin, - 'time_end': $scope.cdash.time_end, - 'projectid': $scope.cdash.projectid, - 'groupid': $scope.cdash.groupid - }, - timeout: $scope.canceler.promise - }).then(function success(s) { - var response = s.data; - $scope.cdash.displayhistory = $scope.cdash.displayhistory || response.displayhistory; - $scope.cdash.displaysummary = $scope.cdash.displaysummary || response.displaysummary; - - function copy_test_details(test, response) { - - // Don't display extra data for missing tests - if (test['status'] === 'Missing') { - return; - } - - if ('history' in response) { - test['history'] = response['history']; - test['historyclass'] = response['historyclass']; - } - if ('summary' in response) { - test['summary'] = response['summary']; - test['summaryclass'] = response['summaryclass']; - } - test['detailsloaded'] = true; - } - - // Update our currently displayed filtered results with this new data. - for (var i = 0, len1 = response.tests.length; i < len1; i++) { - for (var j = 0, len2 = $scope.pagination.filteredTests.length; j < len2; j++) { - if (response.tests[i].name === $scope.pagination.filteredTests[j].name) { - copy_test_details($scope.pagination.filteredTests[j], response.tests[i]); - } - } - } - - // Also copy this newfound data into the 'master list' of tests. - for (var i = 0, len1 = response.tests.length; i < len1; i++) { - for (var j = 0, len2 = $scope.cdash.tests.length; j < len2; j++) { - if (response.tests[i].name === $scope.cdash.tests[j].name) { - copy_test_details($scope.cdash.tests[j], response.tests[i]); - } - } - } - }); - } - }; - - $scope.pageChanged = function() { - $scope.setPage($scope.pagination.currentPage); - }; - - $scope.updateOrderByFields = function(field, $event) { - multisort.updateOrderByFields($scope, field, $event); - $scope.cdash.tests = $filter('orderBy')($scope.cdash.tests, $scope.orderByFields); - $scope.pageChanged(); - $.cookie('cdash_view_test_sort', $scope.orderByFields); - }; - - $scope.sortByExtraMeasurement = function(idx, $event) { - var field = 'measurements[' + idx + ']'; - $scope.updateOrderByFields(field, $event); - } - - $scope.numTestsPerPageChanged = function() { - $.cookie("viewTest_num_per_page", $scope.pagination.numPerPage, { expires: 365 }); - $scope.pageChanged(); - }; - - $scope.cancelAjax = function() { - $scope.canceler.resolve(); - } -} diff --git a/resources/js/angular/legacy.js b/resources/js/angular/legacy.js index 600d57a31b..933da0667f 100644 --- a/resources/js/angular/legacy.js +++ b/resources/js/angular/legacy.js @@ -57,9 +57,6 @@ CDash.controller('SubProjectController', ["$scope", "$rootScope", "$http", SubPr import { QueryTestsController } from "./controllers/queryTests"; CDash.controller('QueryTestsController', ["$scope", "$rootScope", "$filter", "apiLoader", "filters", "multisort", QueryTestsController]); -import { ViewTestController } from "./controllers/viewTest"; -CDash.controller('ViewTestController', ["$scope", "$rootScope", "$http", "$filter", "$q", "apiLoader", "multisort", "filters", ViewTestController]); - import { OverviewController, linechart, bulletchart } from "./controllers/overview"; CDash.controller('OverviewController', ["$scope", "$location", "anchors", "apiLoader", OverviewController]); CDash.directive('linechart', linechart); diff --git a/resources/js/vue/components/ProjectSettings/TestMeasurementsTab.vue b/resources/js/vue/components/ProjectSettings/TestMeasurementsTab.vue index 01b4543fe8..2817046a5f 100644 --- a/resources/js/vue/components/ProjectSettings/TestMeasurementsTab.vue +++ b/resources/js/vue/components/ProjectSettings/TestMeasurementsTab.vue @@ -86,7 +86,6 @@ Add test measurements of type numeric/double or text/string. Any measurement added here will be displayed as an extra column on the following pages: diff --git a/resources/views/test/view-test.blade.php b/resources/views/test/view-test.blade.php deleted file mode 100644 index b283b7b39b..0000000000 --- a/resources/views/test/view-test.blade.php +++ /dev/null @@ -1,309 +0,0 @@ -@extends('cdash', [ - 'angular' => true, - 'angular_controller' => 'ViewTestController' -]) - -@section('main_content') - @verbatim -

Testing started on {{::cdash.build.testtime}}

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
System Information
- Site Name: - - {{::cdash.build.site}} -
- Build Name: - - {{::cdash.build.buildname}} -
- Build Start Time: - - {{::cdash.build.starttime}} -
- Total time: - - {{::cdash.totaltime}} -
- OS Name: - - {{::cdash.build.osname}} -
- OS Platform: - - {{::cdash.build.osplatform}} -
- OS Release: - - {{::cdash.build.osrelease}} -
- OS Version: - - {{::cdash.build.osversion}} -
- Compiler Name: - - {{::cdash.build.compilername}} -
- Compiler Version: - - {{::cdash.build.compilerversion}} -
- - -
- - Show Filters - Hide Filters - -
- @endverbatim - - @verbatim - -
-

{{::cdash.numPassed}} tests passed.

-

{{::cdash.numFailed}} tests failed.

-

{{::cdash.numNotRun}} tests not run.

-

{{::cdash.numTimeFailed}} tests failed the time status check.

-

- {{::cdash.numPassed}} passed, - {{::cdash.numFailed}} failed, - - {{::cdash.numTimeFailed}} failed the time status check, - - {{::cdash.numNotRun}} not run, - {{::cdash.numMissing}} missing. -

-
- -
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- SubProject - - - Name - - - Status - - - Time Status - - - Time - - - Proc Time - - - Details - - - Labels - - - History - - - Summary - - - {{::columnname}} - -
- {{::test.subprojectname}} - - - - {{::test.name}} - - {{::test.status}} - - {{::test.timestatus}} - - {{::test.execTimeFull}} - {{::test.execTime}} - - {{::test.procTimeFull}} - {{::test.procTime}} - - {{::test.details}} - - {{::label}} - - {{test.history}} - - {{test.summary}} - - {{::measurement}} -
- -
- - - -
- - -
-
- -
- Download Table as CSV File -
- @endverbatim -@endsection diff --git a/routes/web.php b/routes/web.php index f7df6aff94..ee12895b06 100755 --- a/routes/web.php +++ b/routes/web.php @@ -91,6 +91,10 @@ Route::get('/builds/{build_id}/tests', 'BuildController@tests') ->whereNumber('build_id'); +Route::get('/viewTest.php', function (Request $request) { + $buildid = $request->query('buildid'); + return redirect("/builds/{$buildid}/tests", 301); +}); Route::get('/builds/{id}/update', 'BuildController@update') ->whereNumber('id'); @@ -229,8 +233,6 @@ Route::permanentRedirect('/viewProjects.php', url('/projects')); Route::permanentRedirect('/projects/all', url('/projects')); -Route::get('/viewTest.php', 'ViewTestController@viewTest'); - Route::get('/queryTests.php', 'TestController@queryTests'); Route::get('/testSummary.php', function (Request $request) { $project = Project::find($request->integer('project')); diff --git a/tests/cypress/e2e/CMakeLists.txt b/tests/cypress/e2e/CMakeLists.txt index 7019683433..55dc93b17b 100644 --- a/tests/cypress/e2e/CMakeLists.txt +++ b/tests/cypress/e2e/CMakeLists.txt @@ -21,9 +21,6 @@ endfunction() add_cypress_e2e_test(query-tests) set_tests_properties(cypress/e2e/query-tests PROPERTIES DEPENDS cypress/e2e/remove-build) -add_cypress_e2e_test(view-test) -set_tests_properties(cypress/e2e/view-test PROPERTIES DEPENDS cypress/e2e/remove-build) - add_cypress_e2e_test(tests) set_tests_properties(cypress/e2e/tests PROPERTIES DEPENDS cypress/e2e/remove-build) diff --git a/tests/cypress/e2e/view-test.cy.js b/tests/cypress/e2e/view-test.cy.js deleted file mode 100644 index 60ccbec9d9..0000000000 --- a/tests/cypress/e2e/view-test.cy.js +++ /dev/null @@ -1,40 +0,0 @@ -describe('viewTest', () => { - - it('shows the test we expect', () => { - cy.visit('viewTest.php?buildid=1'); - cy.get('#viewTestTable').find('tbody').contains('tr', 'kwsys.testHashSTL').should('exist'); - }); - - - it('accounts for missing tests', () => { - // go to the viewTest page corresponding to build with name 'Win32-MSVC2009' - cy.visit('index.php?project=EmailProjectExample&date=2009-02-26'); - cy.get('tbody').contains('a', 'Win32-MSVC2009').invoke('attr', 'href').then(build_url => { - const buildid = build_url.match(/builds\/([0-9]+)/)[1]; - cy.visit(`viewTest.php?buildid=${buildid}`); - }); - - // verify that summary table displays tests as missing - function verify_missing_row(test_name) { - cy.get('#viewTestTable').contains('tr', test_name).as('missing_test_row'); - cy.get('@missing_test_row').find('td').eq(0).should('contain', test_name); - cy.get('@missing_test_row').find('td').eq(1).should('contain', 'Missing'); - } - verify_missing_row('Parser1Test1'); - verify_missing_row('DashboardSendTest'); - verify_missing_row('SystemInfoTest'); - - // check stats above the table - function get_whitespace_regex(input_str) { - const ws = '\\s+'; // matches any whitespace - return new RegExp(ws + input_str.split(/\s+/).join(ws) + ws); - } - // TODO: (sbelsk) we have to do this hack to comapre the text - // because it's bound in angular and cypress can't get it easily. - // once this gets redone in Vue, we should simply do: - // cy.get('h3#test-totals-indicator').should('contain', '2 passed, 3 failed, 0 not run, 3 missing.'); - const expected_regex = get_whitespace_regex('2 passed, 3 failed, 0 not run, 3 missing.'); - cy.get('h3#test-totals-indicator').invoke('text').should('match', expected_regex); - }); - -});