From 3e4e3f6d77cc1e2a5c741ebeb52cd66961f98b4e Mon Sep 17 00:00:00 2001 From: William Allen Date: Fri, 15 May 2026 15:34:35 -0400 Subject: [PATCH] Remove `/api/v1/viewTest.php` API endpoint Thanks to significant work over the course of the last few months, this endpoint is no longer used by CDash itself, and can thus be removed. --- app/Http/Controllers/FilterController.php | 11 - app/Http/Controllers/ViewTestController.php | 114 -- app/cdash/app/Controller/Api/ViewTest.php | 737 --------- app/cdash/app/Model/Build.php | 23 - app/cdash/include/filterdataFunctions.php | 63 - app/cdash/tests/CMakeLists.txt | 15 +- app/cdash/tests/test_builddetails.php | 97 -- app/cdash/tests/test_csvexport.php | 39 - app/cdash/tests/test_disabledtests.php | 28 - app/cdash/tests/test_junithandler.php | 14 +- app/cdash/tests/test_managemeasurements.php | 45 - .../tests/test_multiplelabelsfortests.php | 6 - app/cdash/tests/test_multiplesubprojects.php | 1 - app/cdash/tests/test_redundanttests.php | 23 - .../tests/test_subprojecttestfilters.php | 76 - app/cdash/tests/test_testhistory.php | 49 - .../tests/test_timeoutsandmissingtests.php | 43 - phpstan-baseline.neon | 1345 +++-------------- routes/api.php | 2 - tests/cypress/e2e/manage-build-group.cy.js | 2 +- tests/cypress/e2e/manage-sub-project.cy.js | 2 +- .../cypress/e2e/sub-project-group-order.cy.js | 8 +- 22 files changed, 210 insertions(+), 2533 deletions(-) delete mode 100644 app/Http/Controllers/ViewTestController.php delete mode 100644 app/cdash/app/Controller/Api/ViewTest.php delete mode 100644 app/cdash/tests/test_builddetails.php delete mode 100644 app/cdash/tests/test_csvexport.php delete mode 100644 app/cdash/tests/test_subprojecttestfilters.php diff --git a/app/Http/Controllers/FilterController.php b/app/Http/Controllers/FilterController.php index 72dc5e7d1e..8812709719 100644 --- a/app/Http/Controllers/FilterController.php +++ b/app/Http/Controllers/FilterController.php @@ -108,15 +108,6 @@ private static function getFiltersForPage(string $page_id): array 'testoutput', 'time', ], - 'viewTest.php' => [ - 'details', - 'label', - 'status', - 'subproject', - 'testname', - 'timestatus', - 'time', - ], 'testOverview.php' => [ 'buildname', 'subproject', @@ -135,8 +126,6 @@ private static function isDatePage(string $page_id): bool case 'testOverview.php': case 'viewBuildGroup.php': return true; - - case 'viewTest.php': default: return false; } diff --git a/app/Http/Controllers/ViewTestController.php b/app/Http/Controllers/ViewTestController.php deleted file mode 100644 index eb601ae847..0000000000 --- a/app/Http/Controllers/ViewTestController.php +++ /dev/null @@ -1,114 +0,0 @@ -setBuildById(request()->integer('buildid')); - return $this->view('test.view-test', 'Tests'); - } - - /** - * View tests of a particular build. - * - * GET /viewTest.php - * Required Params: - * buildid=[integer] The ID of the build - * - * Optional Params: - * - * date=[YYYY-mm-dd] - * tests=[array of test names] - * If tests is passed the following parameters apply: - * Required: - * projectid=[integer] - * groupid=[integer] - * Optional: - * previous_builds=[comma separated list of build ids] - * time_begin=[SQL compliant comparable to timestamp] - * time_end=[SQL compliant comparable to timestamp] - * onlypassed=[presence] - * onlyfailed=[presence] - * onlytimestatus=[presence] - * onlynotrun=[presence] - * onlydelta=[presence] - * filterstring - * export=[presence] - * - * TODO: figure out the return type for this function... - **/ - public function fetchPageContent(): JsonResponse|StreamedResponse - { - $db = Database::getInstance(); - $controller = new ViewTest($db, self::get_request_build()); - $response = $controller->getResponse(); - if ($controller->JSONEncodeResponse) { - return response()->json(cast_data_for_JSON($response)); - } - $headers = [ - 'Content-Type' => 'text/csv', - ]; - return response()->streamDownload(function () use ($response): void { - echo $response; - }, 'test-export.csv', $headers); - } - - /** - * Returns a build based on the id extracted from the request and returns it if the user has - * necessary access to the project - * - * @param bool $required - */ - private static function get_request_build($required = true): ?Build - { - $id = self::get_request_build_id($required); - if (null === $id) { - return null; - } - $build = new Build(); - $build->Id = $id; - - if ($required && !$build->Exists()) { - abort(400, 'This build does not exist. Maybe it has been deleted.'); - } - - if ($id) { - $build->FillFromId($id); - } - - return can_access_project($build->ProjectId) ? $build : null; - } - - /** - * Pulls the buildid from the request - * - * @param bool $required - */ - private static function get_request_build_id($required = true): ?int - { - $buildid = self::get_int_param('buildid', $required); - return $buildid; - } - - private static function get_int_param($name, $required = true): ?int - { - $value = get_param($name, $required); - if (null === $value) { - return null; - } - - if ($required && !is_numeric($value)) { - abort(400, "Valid $name required"); - } - return (int) $value; - } -} diff --git a/app/cdash/app/Controller/Api/ViewTest.php b/app/cdash/app/Controller/Api/ViewTest.php deleted file mode 100644 index c6d551fd3b..0000000000 --- a/app/cdash/app/Controller/Api/ViewTest.php +++ /dev/null @@ -1,737 +0,0 @@ -JSONEncodeResponse = true; - $this->project->Fill(); - - $this->extraMeasurements = []; - $this->numExtraMeasurements = 0; - } - - public function getResponse() - { - if (isset($_GET['tests'])) { - // AJAX call to load history & summary data for currently visible tests. - $this->loadTestDetails(); - exit(0); - } - - $this->setDate($this->build->GetDate()); - - $response = begin_JSON_response(); - $response['title'] = "{$this->project->Name} - Tests"; - $response['groupid'] = $this->build->GroupId; - get_dashboard_JSON($this->project->Name, $this->date, $response); - - // Filters - $filterdata = get_filterdata_from_request(); - $response['filterdata'] = $filterdata; - $this->setFilterData($filterdata); - $response['filterurl'] = get_filterurl(); - - // Menu - $menu = []; - - $onlypassed = 0; - $onlyfailed = 0; - $onlytimestatus = 0; - $onlynotrun = 0; - $onlydelta = 0; - $extraquery = ''; - - if (isset($_GET['onlypassed'])) { - $onlypassed = 1; - $extraquery = '&onlypassed'; - $display = 'onlypassed'; - } elseif (isset($_GET['onlyfailed'])) { - $onlyfailed = 1; - $extraquery = '&onlyfailed'; - $display = 'onlyfailed'; - } elseif (isset($_GET['onlytimestatus'])) { - $onlytimestatus = 1; - $extraquery = '&onlytimestatus'; - $display = 'onlytimestatus'; - } elseif (isset($_GET['onlynotrun'])) { - $onlynotrun = 1; - $extraquery = '&onlynotrun'; - $display = 'onlynotrun'; - } elseif (isset($_GET['onlydelta'])) { - // new test that are showing up for this category - $onlydelta = 1; - $extraquery = '&onlydelta'; - $display = 'onlydelta'; - } else { - $display = 'all'; - } - - if ($this->build->GetParentId() > 0) { - $menu['back'] = 'index.php?project=' . urlencode($this->project->Name) . "&parentid={$this->build->GetParentId()}"; - } else { - $menu['back'] = 'index.php?project=' . urlencode($this->project->Name) . "&date=$this->date"; - } - - // Get the IDs of the four previous builds. - // These are used to check the recent history of this test. - $n = 3; - $id = $buildid = $this->build->Id; - $previous_buildid = 0; - $previous_buildids = []; - - // Include the current buildid in this list so the current status will - // be reflected in the history column. - $previous_buildids[] = $id; - - for ($i = 0; $i < $n; $i++) { - $b = new Build(); - $b->Id = $id; - - $id = $b->GetPreviousBuildId(); - - if ($i == 0) { - $previous_buildid = $id; - $current_buildid = $b->GetCurrentBuildId(); - $next_buildid = $b->GetNextBuildId(); - } - - if ($id == 0) { - break; - } - $previous_buildids[] = $id; - } - - $previous_buildids_str = ''; - if ($previous_buildid > 0) { - $menu['previous'] = "viewTest.php?buildid={$previous_buildid}{$extraquery}"; - if (count($previous_buildids) > 1) { - $previous_buildids_str = implode(', ', $previous_buildids); - } - } else { - $menu['previous'] = false; - } - $response['previous_builds'] = $previous_buildids_str; - - $menu['current'] = "viewTest.php?buildid={$current_buildid}{$extraquery}"; - - if ($next_buildid > 0) { - $menu['next'] = "viewTest.php?buildid={$next_buildid}{$extraquery}"; - } else { - $menu['next'] = false; - } - - $response['menu'] = $menu; - - $build_response = Build::MarshalResponseArray($this->build, [ - 'displaylabels' => $this->project->DisplayLabels, - 'site' => $this->build->GetSite()->name, - 'testtime' => $this->build->EndTime, - ]); - - // Find the OS and compiler information - if ($this->build->OSName != '') { - $build_response['osname'] = $this->build->OSName; - } - if ($this->build->OSPlatform != '') { - $build_response['osplatform'] = $this->build->OSPlatform; - } - if ($this->build->OSRelease != '') { - $build_response['osrelease'] = $this->build->OSRelease; - } - if ($this->build->OSVersion != '') { - $build_response['osversion'] = $this->build->OSVersion; - } - if ($this->build->CompilerName != '') { - $build_response['compilername'] = $this->build->CompilerName; - } - if ($this->build->CompilerVersion != '') { - $build_response['compilerversion'] = $this->build->CompilerVersion; - } - - $response['build'] = $build_response; - $response['csvlink'] = "api/v1/viewTest.php?buildid=$buildid&export=csv"; - - $project_response = []; - $project_response['showtesttime'] = $this->project->ShowTestTime; - $response['project'] = $project_response; - $response['parentBuild'] = $this->build->GetParentId() == Build::PARENT_BUILD; - - $params = [':buildid' => $buildid]; - $displaydetails = 1; - $status = 'AND bt.status = :status'; - if ($onlypassed) { - $displaydetails = 0; - $params[':status'] = 'passed'; - } elseif ($onlyfailed) { - $params[':status'] = 'failed'; - } elseif ($onlynotrun) { - $params[':status'] = 'notrun'; - } elseif ($onlytimestatus) { - $status = 'AND bt.timestatus >= :maxtimestatus'; - $params[':maxtimestatus'] = $this->project->TestTimeMaxStatus; - } else { - $status = ''; - } - - $response['displaydetails'] = $displaydetails; - $response['display'] = $display; - - $limitnew = ''; - $onlydelta_extra = ''; - if ($onlydelta) { - $limitnew = ' AND newstatus=1 '; - $onlydelta_extra = ' AND build2test.newstatus=1 '; - } - - if ($this->build->GetParentId() == Build::PARENT_BUILD) { - $parentBuildFieldSql = ', b.subprojectid, sp.name subprojectname'; - $parentBuildJoinSql = 'JOIN build b ON (b.id = bt.buildid) - JOIN subproject sp on (sp.id = b.subprojectid)'; - $parentBuildWhere = 'b.parentid = :buildid'; - } else { - $parentBuildFieldSql = ''; - $parentBuildJoinSql = ''; - $parentBuildWhere = 'bt.buildid = :buildid'; - } - - $sql = " - SELECT bt.status, bt.newstatus, bt.timestatus, bt.time, bt.buildid, bt.details, - bt.id AS buildtestid, bt.testname $parentBuildFieldSql - FROM build2test AS bt - $parentBuildJoinSql - WHERE $parentBuildWhere $status $this->filterSQL $limitnew - $this->limitSQL"; - $stmt = $this->db->prepare($sql); - $this->db->execute($stmt, $params); - - $numPassed = 0; - $numFailed = 0; - $numNotRun = 0; - $numTimeFailed = 0; - - // Are we looking for tests that were performed by this build, - // or tests that were performed by children of this build? - if ($this->build->GetParentId() == Build::PARENT_BUILD) { - $buildid_field = 'parentid'; - } else { - $buildid_field = 'id'; - } - - // Get the list of extra measurements that should be displayed on this page. - $response['hasprocessors'] = false; - $processors_idx = -1; - $extra_measurements = EloquentProject::findOrFail($this->project->Id) - ->pinnedTestMeasurements() - ->orderBy('position') - ->get(); - foreach ($extra_measurements as $extra_measurement) { - $this->extraMeasurements[] = $extra_measurement->name; - // If we have the Processors measurement, then we should also - // compute and display 'Proc Time'. - if ($extra_measurement->name === 'Processors') { - $processors_idx = count($this->extraMeasurements) - 1; - $response['hasprocessors'] = true; - } - } - $this->numExtraMeasurements = count($this->extraMeasurements); - $response['columnnames'] = $this->extraMeasurements; - - $params = [':buildid' => $buildid]; - $status_clause = 'AND build2test.status = :status'; - if ($onlypassed) { - $params[':status'] = 'passed'; - } elseif ($onlyfailed) { - $params[':status'] = 'failed'; - } elseif ($onlynotrun) { - $params[':status'] = 'notrun'; - } else { - $status_clause = ''; - } - - $getalltestlistsql = "SELECT build2test.id - FROM build2test - JOIN build ON (build.id = build2test.buildid) - WHERE build.$buildid_field=:buildid $onlydelta_extra - $status_clause - ORDER BY build2test.id - "; - $getalltestlist = $this->db->prepare($getalltestlistsql); - $this->db->execute($getalltestlist, $params); - - // Allocate empty array for all possible measurements. - $test_measurements = []; - - while ($row = $getalltestlist->fetch()) { - $test_measurements[$row['id']] = []; - for ($i = 0; $i < $this->numExtraMeasurements; $i++) { - $test_measurements[$row['id']][$i] = ''; - } - } - - $etestquery = null; - if ($this->numExtraMeasurements > 0) { - $etestquery = $this->db->prepare( - "SELECT build2test.id, build.projectid, build2test.buildid, - build2test.status, build2test.timestatus, build2test.testname, testmeasurement.name, - testmeasurement.value, build.starttime, - build2test.time - FROM build2test - JOIN build ON (build.id = build2test.buildid) - JOIN testmeasurement ON (build2test.id = testmeasurement.testid) - JOIN measurement ON (build.projectid=measurement.projectid AND testmeasurement.name=measurement.name) - WHERE build.$buildid_field = :buildid - $onlydelta_extra - $status_clause - ORDER BY build2test.id, testmeasurement.name"); - $this->db->execute($etestquery, $params); - } - - if (@$_GET['export'] === 'csv') { - $this->JSONEncodeResponse = false; - return $this->exportAsCsv($stmt, $this->project->ShowTestTime, $this->project->TestTimeMaxStatus); - } - - // Keep track of extra measurements for each test. - // Overwrite the empty values with the correct ones if exists. - if ($etestquery) { - while ($row = $etestquery->fetch()) { - // Get the index of this extra measurement. - $idx = array_search($row['name'], $this->extraMeasurements); - - // Fill in this measurement value for this test. - $test_measurements[$row['id']][$idx] = $row['value']; - } - } - - // Gather test info - $tests = []; - - // Find the time to run all the tests - $time_stmt = $this->db->prepare( - 'SELECT SUM(time) FROM build2test WHERE buildid = ?'); - $this->db->execute($time_stmt, [$buildid]); - $time = $time_stmt->fetchColumn(); - $response['totaltime'] = time_difference($time, true, '', true); - - // Gather date information. - $testdate = $this->date; - [$previousdate, $currentstarttime, $nextdate, $today] = - get_dates($this->date, $this->project->NightlyTime); - $beginning_timestamp = $currentstarttime; - $end_timestamp = $currentstarttime + 3600 * 24; - $beginning_UTCDate = gmdate(FMT_DATETIME, $beginning_timestamp); - $end_UTCDate = gmdate(FMT_DATETIME, $end_timestamp); - $response['time_begin'] = $beginning_UTCDate; - $response['time_end'] = $end_UTCDate; - $labels_found = false; - - // Generate a response for each test found. - while ($row = $stmt->fetch()) { - $marshaledTest = self::marshal($row, $row['buildid'], $this->project->Name, $this->project->ShowTestTime, $this->project->TestTimeMaxStatus, $testdate); - - if ($marshaledTest['status'] === 'Passed') { - $numPassed++; - } elseif ($marshaledTest['status'] === 'Failed') { - $numFailed++; - } elseif ($marshaledTest['status'] === 'Not Run') { - $numNotRun++; - } - - if ($row['timestatus'] >= $this->project->TestTimeMaxStatus) { - $numTimeFailed++; - } - - $labels_found = !empty($marshaledTest['labels']); - - $marshaledTest['measurements'] = $test_measurements[$marshaledTest['buildtestid']]; - if ($response['hasprocessors']) { - // Show an additional column "proc time" if these tests have - // the Processor measurement. - $num_procs = $test_measurements[$marshaledTest['buildtestid']][$processors_idx]; - if (!$num_procs) { - $num_procs = 1; - } - $marshaledTest['procTimeFull'] = - $marshaledTest['execTimeFull'] * $num_procs; - $marshaledTest['procTime'] = - time_difference($marshaledTest['procTimeFull'], true, '', true); - } - $tests[] = $marshaledTest; - } - - // Check for missing tests - $numMissing = $this->build->GetNumberOfMissingTests(); - - if ($numMissing > 0) { - foreach ($this->build->MissingTests as $name) { - $marshaledTest = self::marshalMissing($name, $buildid, $this->project->Name, $this->project->ShowTestTime, $this->project->TestTimeMaxStatus, $testdate); - array_unshift($tests, $marshaledTest); - } - } - - $response['tests'] = $tests; - $response['numPassed'] = $numPassed; - $response['numFailed'] = $numFailed; - $response['numNotRun'] = $numNotRun; - $response['numTimeFailed'] = $numTimeFailed; - $response['numMissing'] = $numMissing; - - // Only show the labels column if some were found. - $response['build']['displaylabels'] &= $labels_found; - - $response['columncount'] = $this->numExtraMeasurements; - - $this->pageTimer->end($response); - return $response; - } - - private function getTestHistory($testname, $previous_buildids): array - { - $retval = []; - - $history_query = " - SELECT DISTINCT status - FROM build2test AS b2t - WHERE b2t.buildid IN ($previous_buildids) AND b2t.testname = :testname"; - $history_stmt = $this->db->prepare($history_query); - $this->db->execute($history_stmt, [':testname' => $testname]); - $statuses = []; - while ($row = $history_stmt->fetch()) { - $statuses[] = $row['status']; - } - $num_statuses = count($statuses); - if ($num_statuses > 0) { - if ($num_statuses > 1) { - $retval['history'] = 'Unstable'; - $retval['historyclass'] = 'warning'; - } else { - $status = $statuses[0]; - $retval['history'] = ucfirst($status); - - switch ($status) { - case 'passed': - $retval['historyclass'] = 'normal'; - $retval['history'] = 'Stable'; - break; - case 'failed': - $retval['historyclass'] = 'error'; - $retval['history'] = 'Broken'; - break; - case 'notrun': - $retval['historyclass'] = 'warning'; - $retval['history'] = 'Inactive'; - break; - } - } - } - return $retval; - } - - private function getTestSummary($testname, $projectid, $groupid, $begin, $end): array - { - $retval = []; - - $summary_query = ' - SELECT DISTINCT b2t.status FROM build AS b - INNER JOIN build2group AS b2g ON (b.id = b2g.buildid) - INNER JOIN build2test AS b2t ON (b.id = b2t.buildid) - WHERE b2g.groupid = :groupid - AND b.projectid = :projectid - AND b.starttime >= :begin - AND b.starttime < :end - AND b2t.testname = :testname'; - $params = [ - ':groupid' => $groupid, - ':projectid' => $projectid, - ':begin' => $begin, - ':end' => $end, - ':testname' => $testname, - ]; - $summary_stmt = $this->db->prepare($summary_query); - $this->db->execute($summary_stmt, $params); - $statuses = []; - while ($row = $summary_stmt->fetch()) { - $statuses[] = $row['status']; - } - $num_statuses = count($statuses); - if ($num_statuses > 0) { - if ($num_statuses > 1) { - $retval['summary'] = 'Unstable'; - $retval['summaryclass'] = 'warning'; - } else { - $status = $statuses[0]; - $retval['summary'] = ucfirst($status); - switch ($status) { - case 'passed': - $retval['summaryclass'] = 'normal'; - $retval['summary'] = 'Stable'; - break; - case 'failed': - $retval['summaryclass'] = 'error'; - $retval['summary'] = 'Broken'; - break; - case 'notrun': - $retval['summaryclass'] = 'warning'; - $retval['summary'] = 'Inactive'; - break; - } - } - } - return $retval; - } - - private function loadTestDetails(): void - { - // Parse input arguments. - $tests = []; - foreach ($_GET['tests'] as $test) { - $tests[] = pdo_real_escape_string($test); - } - if (empty($tests)) { - return; - } - - $projectid = (int) $_GET['projectid']; - - $previous_buildids = []; - if (array_key_exists('previous_builds', $_GET)) { - foreach (explode(', ', $_GET['previous_builds']) as $previous_buildid) { - if (is_numeric($previous_buildid) && $previous_buildid > 1) { - $previous_build_row = DB::table('build') - ->where('id', $previous_buildid) - ->first(); - if ((int) $previous_build_row->projectid === $projectid) { - $previous_buildids[] = $previous_buildid; - } - } - } - } - $previous_builds = implode(', ', $previous_buildids); - $time_begin = ''; - if (array_key_exists('time_begin', $_GET)) { - $time_begin = pdo_real_escape_string($_GET['time_begin']); - } - $time_end = ''; - if (array_key_exists('time_end', $_GET)) { - $time_end = pdo_real_escape_string($_GET['time_end']); - } - $groupid = (int) $_GET['groupid']; - - $response = []; - $tests_response = []; - - foreach ($tests as $test) { - $test_response = []; - $test_response['name'] = $test; - $data_found = false; - - if ($time_begin && $time_end) { - $summary_response = $this->getTestSummary($test, $projectid, $groupid, - $time_begin, $time_end); - if (!empty($summary_response)) { - $test_response = array_merge($test_response, $summary_response); - $data_found = true; - } - } - - if ($previous_builds) { - $history_response = $this->getTestHistory($test, $previous_builds); - if (!empty($history_response)) { - $test_response = array_merge($test_response, $history_response); - $response['displayhistory'] = true; - $data_found = true; - } - } - - if ($data_found) { - $tests_response[] = $test_response; - } - } - - if (!empty($tests_response)) { - $response['tests'] = $tests_response; - } - - echo json_encode($response); - } - - // Export test results as CSV file. - private function exportAsCsv($stmt, $projectshowtesttime, $testtimemaxstatus): string - { - $csv_contents = []; - // Standard columns. - $csv_headers = ['Name', 'Time', 'Details', 'Status']; - if ($projectshowtesttime) { - $csv_headers[] = 'Time Status'; - } - - $csv_contents[] = $csv_headers; - - while ($row = $stmt->fetch()) { - $csv_row = []; - $csv_row[] = $row['testname']; - $csv_row[] = $row['time']; - $csv_row[] = $row['details']; - - switch ($row['status']) { - case 'passed': - $csv_row[] = 'Passed'; - break; - case 'failed': - $csv_row[] = 'Failed'; - break; - case 'notrun': - default: - $csv_row[] = 'Not Run'; - break; - } - - if ($projectshowtesttime) { - if ($row['timestatus'] < $testtimemaxstatus) { - $csv_row[] = 'Passed'; - } else { - $csv_row[] = 'Failed'; - } - } - - $csv_contents[] = $csv_row; - } - - $output = fopen('php://temp', 'w'); - foreach ($csv_contents as $csv_row) { - fputcsv($output, $csv_row); - } - rewind($output); - - $file = stream_get_contents($output); - - fclose($output); - return $file; - } - - /** - * Marshal functions moved here from the old BuildTest model class. - */ - public static function marshalMissing($name, $buildid, $projectname, $projectshowtesttime, $testtimemaxstatus, $testdate): array - { - $data = []; - $data['testname'] = $name; - $data['status'] = 'missing'; - $data['id'] = ''; - $data['buildtestid'] = ''; - $data['time'] = ''; - $data['details'] = ''; - $data['newstatus'] = false; - - $test = self::marshal($data, $buildid, $projectname, $projectshowtesttime, $testtimemaxstatus, $testdate); - - // Since these tests are missing they should - // not behave like other tests - $test['execTime'] = ''; - $test['summary'] = ''; - $test['detailsLink'] = ''; - $test['summaryLink'] = ''; - - return $test; - } - - public static function marshalStatus($status): array - { - $statuses = ['passed' => ['Passed', 'normal'], - 'failed' => ['Failed', 'error'], - 'notrun' => ['Not Run', 'warning'], - 'missing' => ['Missing', 'missing']]; - - return $statuses[$status]; - } - - public static function marshal($data, $buildid, $projectname, $projectshowtesttime, $testtimemaxstatus, $testdate): array - { - $marshaledStatus = self::marshalStatus($data['status']); - if ($data['details'] === 'Disabled') { - $marshaledStatus = ['Not Run', 'disabled-test']; - } - $marshaledData = [ - 'buildid' => $buildid, - 'buildtestid' => $data['buildtestid'], - 'status' => $marshaledStatus[0], - 'statusclass' => $marshaledStatus[1], - 'name' => $data['testname'], - 'execTime' => time_difference($data['time'], true, '', true), - 'execTimeFull' => (float) $data['time'], - 'details' => $data['details'], - 'summaryLink' => "queryTests.php?project={$projectname}&date={$testdate}&filtercount=1&showfilters=1&field1=testname&compare1=61&value1=" . urlencode($data['testname']), - 'summary' => 'Summary', /* Default value later replaced by AJAX */ - 'detailsLink' => "tests/{$data['buildtestid']}", - ]; - - if ($data['newstatus']) { - $marshaledData['new'] = '1'; - } - - if ($projectshowtesttime && array_key_exists('timestatus', $data)) { - if ($data['timestatus'] == 0) { - $marshaledData['timestatus'] = 'Passed'; - $marshaledData['timestatusclass'] = 'normal'; - } elseif ($data['timestatus'] < $testtimemaxstatus) { - $marshaledData['timestatus'] = 'Warning'; - $marshaledData['timestatusclass'] = 'warning'; - } else { - $marshaledData['timestatus'] = 'Failed'; - $marshaledData['timestatusclass'] = 'error'; - } - } - - if ($marshaledData['buildtestid'] ?? false) { - $test = Test::find((int) $data['buildtestid']); - if ($test !== null) { - $marshaledData['labels'] = $test->labels()->pluck('text'); - } - } else { - if (!empty($data['labels'])) { - $labels = explode(',', $data['labels']); - $marshaledData['labels'] = $labels; - } - } - - if (isset($data['subprojectid'])) { - $marshaledData['subprojectid'] = $data['subprojectid']; - } - - if (isset($data['subprojectname'])) { - $marshaledData['subprojectname'] = $data['subprojectname']; - } - - return $marshaledData; - } -} diff --git a/app/cdash/app/Model/Build.php b/app/cdash/app/Model/Build.php index a46adf5036..acc722d2d7 100644 --- a/app/cdash/app/Model/Build.php +++ b/app/cdash/app/Model/Build.php @@ -378,29 +378,6 @@ public function FillFromId($buildid): void $this->Filled = true; } - public static function MarshalResponseArray(self $build, array $optional_values = []): array - { - $response = [ - 'id' => $build->Id, - 'buildid' => $build->Id, - 'siteid' => $build->SiteId, - 'name' => $build->Name, - 'buildname' => $build->Name, - 'stamp' => $build->Stamp, - 'projectid' => $build->ProjectId, - 'starttime' => $build->StartTime, - 'endtime' => $build->EndTime, - 'groupid' => $build->GroupId, - 'group' => $build->Type, - ]; - - if ($build->GetSubProjectName()) { - $response['subproject'] = $build->SubProjectName; - } - - return array_merge($response, $optional_values); - } - /** Get the previous build id. */ public function GetPreviousBuildId(?int $previous_parentid = null): int { diff --git a/app/cdash/include/filterdataFunctions.php b/app/cdash/include/filterdataFunctions.php index 1ed021d094..a7be3b1edd 100644 --- a/app/cdash/include/filterdataFunctions.php +++ b/app/cdash/include/filterdataFunctions.php @@ -377,65 +377,6 @@ public function getSqlField($field): string } } -class ViewTestPhpFilters extends DefaultFilters -{ - public function getDefaultFilter(): array - { - return [ - 'field' => 'testname', - 'fieldtype' => 'string', - 'compare' => 63, - 'value' => '', - ]; - } - - public function getSqlField($field): string - { - $sql_field = ''; - switch (strtolower($field)) { - case 'details': - $sql_field = 'bt.details'; - - break; - - case 'label': - $sql_field = "(SELECT $this->TextConcat FROM label, label2test WHERE label.id=label2test.labelid AND label2test.testid=bt.id)"; - - break; - - case 'status': - $sql_field = 'bt.status'; - - break; - - case 'subproject': - $sql_field = 'sp.name'; - - break; - - case 'testname': - $sql_field = 'bt.testname'; - - break; - - case 'timestatus': - $sql_field = 'bt.timestatus'; - - break; - - case 'time': - $sql_field = 'bt.time'; - - break; - - default: - trigger_error('unknown $field value: ' . $field, E_USER_WARNING); - break; - } - return $sql_field; - } -} - class TestOverviewPhpFilters extends DefaultFilters { public function getDefaultFilter(): array @@ -488,10 +429,6 @@ function createPageSpecificFilters($page_id) return new QueryTestsPhpFilters(); break; - case 'viewTest.php': - return new ViewTestPhpFilters(); - break; - case 'testOverview.php': return new TestOverviewPhpFilters(); break; diff --git a/app/cdash/tests/CMakeLists.txt b/app/cdash/tests/CMakeLists.txt index a91c85f181..4f3cdbcf32 100644 --- a/app/cdash/tests/CMakeLists.txt +++ b/app/cdash/tests/CMakeLists.txt @@ -594,11 +594,8 @@ set_tests_properties(opencovercoverage PROPERTIES DEPENDS jscovercoverage) add_php_test(buildfailuredetails) set_tests_properties(buildfailuredetails PROPERTIES DEPENDS opencovercoverage) -add_php_test(builddetails) -set_tests_properties(builddetails PROPERTIES DEPENDS buildfailuredetails) - add_php_test(updateappend) -set_tests_properties(updateappend PROPERTIES DEPENDS builddetails) +set_tests_properties(updateappend PROPERTIES DEPENDS buildfailuredetails) add_php_test(hidecolumns) set_tests_properties(hidecolumns PROPERTIES DEPENDS updateappend) @@ -648,11 +645,8 @@ set_tests_properties(viewsubprojects PROPERTIES DEPENDS dynamicanalysissummary) add_php_test(truncateoutput) set_tests_properties(truncateoutput PROPERTIES DEPENDS viewsubprojects) -add_php_test(csvexport) -set_tests_properties(csvexport PROPERTIES DEPENDS truncateoutput) - add_php_test(uniquediffs) -set_tests_properties(uniquediffs PROPERTIES DEPENDS csvexport) +set_tests_properties(uniquediffs PROPERTIES DEPENDS truncateoutput) add_php_test(imagecomparison) set_tests_properties(imagecomparison PROPERTIES DEPENDS uniquediffs) @@ -732,11 +726,8 @@ set_tests_properties(longbuildname PROPERTIES DEPENDS namedmeasurements) add_php_test(multiplelabelsfortests) set_tests_properties(multiplelabelsfortests PROPERTIES DEPENDS longbuildname) -add_php_test(subprojecttestfilters) -set_tests_properties(subprojecttestfilters PROPERTIES DEPENDS multiplelabelsfortests) - add_php_test(starttimefromnotes) -set_tests_properties(starttimefromnotes PROPERTIES DEPENDS subprojecttestfilters) +set_tests_properties(starttimefromnotes PROPERTIES DEPENDS multiplelabelsfortests) add_php_test(starttimefromupload) set_tests_properties(starttimefromupload PROPERTIES DEPENDS starttimefromnotes) diff --git a/app/cdash/tests/test_builddetails.php b/app/cdash/tests/test_builddetails.php deleted file mode 100644 index b9b702195e..0000000000 --- a/app/cdash/tests/test_builddetails.php +++ /dev/null @@ -1,97 +0,0 @@ -testDataDir = __DIR__ . '/data/BuildDetails'; - $this->testDataFiles = ['Subbuild1.xml', 'Subbuild2.xml', 'Subbuild3.xml']; - - $this->createProject([ - 'Name' => 'BuildDetails', - 'CvsViewerType' => null, - ]); - - foreach ($this->testDataFiles as $testDataFile) { - if (!$this->submission('BuildDetails', $this->testDataDir . '/' . $testDataFile)) { - $this->fail('Failed to submit ' . $testDataFile); - return 1; - } - } - - $this->builds = []; - $builds = pdo_query("SELECT * FROM build WHERE name = 'linux' ORDER BY id"); - while ($build = pdo_fetch_array($builds)) { - $this->builds[] = $build; - } - } - - public function __destruct() - { - foreach ($this->builds as $build) { - DatabaseCleanupUtils::removeBuild($build['id']); - } - } - - // This will be specific to a test xml - public function testViewTestReturnsProperFormat() - { - $testDataFile = $this->testDataDir . '/Insight_Experimental_Test.xml'; - if (!$this->submission('BuildDetails', $testDataFile)) { - $this->fail('Failed to submit ' . $testDataFile); - return 1; - } - - $buildId = DB::select("SELECT id FROM build WHERE name = 'BuildDetails-Linux-g++-4.1-LesionSizingSandbox_Debug'")[0]; - $json = $this->get("{$this->url}/api/v1/viewTest.php?buildid={$buildId->id}"); - $actualResponse = json_decode($json); - $expectedResponse = json_decode( - file_get_contents($this->testDataDir . '/InsightExperimentalExample_Expected.json')); - - $this->assertEqual(count($actualResponse->tests), count($expectedResponse->tests)); - - $this->assertEqual($actualResponse->numPassed, $expectedResponse->numPassed); - $this->assertEqual($actualResponse->numFailed, $expectedResponse->numFailed); - $this->assertEqual($actualResponse->numNotRun, $expectedResponse->numNotRun); - $this->assertEqual($actualResponse->numTimeFailed, $expectedResponse->numTimeFailed); - - DatabaseCleanupUtils::removeBuild($buildId->id); - } - - public function testViewTestReturnsProperFormatForParentBuilds() - { - $testDataFile = $this->testDataDir . '/Insight_Experimental_Test_Subbuild.xml'; - if (!$this->submission('BuildDetails', $testDataFile)) { - $this->fail('Failed to submit ' . $testDataFile); - return 1; - } - - $buildId = DB::select("SELECT id FROM build WHERE name = 'BuildDetails-Linux-g++-4.1-LesionSizingSandbox_Debug-has-subbuild' AND parentid=-1")[0]; - - $response = json_decode($this->get($this->url . '/api/v1/viewTest.php?buildid=' . $buildId->id)); - - $this->assertTrue($response->parentBuild); - - foreach ($response->tests as $test) { - $this->assertTrue(property_exists($test, 'subprojectid')); - $this->assertTrue($test->subprojectname === 'some-subproject'); - } - - DatabaseCleanupUtils::removeBuild($buildId->id); - } -} diff --git a/app/cdash/tests/test_csvexport.php b/app/cdash/tests/test_csvexport.php deleted file mode 100644 index 4bb7540677..0000000000 --- a/app/cdash/tests/test_csvexport.php +++ /dev/null @@ -1,39 +0,0 @@ -prepare(" - SELECT b.id FROM build b - JOIN build2test b2t ON b2t.buildid=b.id - WHERE b.name='Win32-MSVC2009' AND b2t.testname='curl'"); - $stmt->execute(); - $row = $stmt->fetch(); - $buildid = $row['id']; - - // Export this build's tests to CSV. - $content = $this->connect($this->url . "/api/v1/viewTest.php?buildid=$buildid&export=csv"); - - // Verify expected contents. - $expected = 'DashboardSendTest,0.05,"Completed (OTHER_FAULT)",Failed'; - if (!str_contains($content, $expected)) { - $this->fail('Expected content not found in CSV output'); - } - } -} diff --git a/app/cdash/tests/test_disabledtests.php b/app/cdash/tests/test_disabledtests.php index af7dc4a6e2..14e0440dc7 100644 --- a/app/cdash/tests/test_disabledtests.php +++ b/app/cdash/tests/test_disabledtests.php @@ -36,34 +36,6 @@ public function testDisabledTests(): void $this->fail('No buildid found when expected'); } - // Verify one disabled test and one test missing its executable. - $this->get("$this->url/api/v1/viewTest.php?buildid=$buildid"); - $content = $this->getBrowser()->getContent(); - $jsonobj = json_decode($content, true); - if ($jsonobj['numFailed'] !== 1) { - $this->fail("Did not find 1 'Failed' tests when expected"); - } - if ($jsonobj['numNotRun'] !== 1) { - $this->fail("Did not find 1 'NotRun' tests when expected"); - } - - $verified_disabled = false; - $verified_missingexe = false; - foreach ($jsonobj['tests'] as $test) { - if ($test['details'] === 'Disabled') { - $verified_disabled = true; - } - if ($test['details'] === 'Unable to find executable') { - $verified_missingexe = true; - } - } - if (!$verified_disabled) { - $this->fail('Did not find Disabled test'); - } - if (!$verified_missingexe) { - $this->fail('Did not find test with missing executable'); - } - // Verify email was sent for the missing exe but not for the disabled test. $log_contents = file_get_contents($this->logfilename); if (!str_contains($log_contents, 'ThisTestFails')) { diff --git a/app/cdash/tests/test_junithandler.php b/app/cdash/tests/test_junithandler.php index 2301feb5d3..50d94ef535 100644 --- a/app/cdash/tests/test_junithandler.php +++ b/app/cdash/tests/test_junithandler.php @@ -2,6 +2,7 @@ require_once __DIR__ . '/cdash_test_case.php'; +use App\Models\Build; use CDash\Database; use CDash\Model\Project; @@ -64,19 +65,18 @@ public function testJUnitHandler(): void } // Make sure the testing results look correct. - $this->get("$this->url/api/v1/viewTest.php?buildid=$buildid"); - $content = $this->getBrowser()->getContent(); - $jsonobj = json_decode($content, true); - if ($jsonobj['numPassed'] !== 2) { + $build = Build::findOrFail((int) $buildid); + if ($build->tests()->where('status', 'passed')->count() !== 2) { $this->fail("Did not find 2 'Passed' tests when expected"); } - if ($jsonobj['numFailed'] !== 3) { + if ($build->tests()->where('status', 'failed')->count() !== 3) { $this->fail("Did not find 3 'Failed' tests when expected"); } - if ($jsonobj['numNotRun'] !== 1) { + if ($build->tests()->where('status', 'notrun')->count() !== 1) { $this->fail("Did not find 1 'Not Run' test when expected"); } - if (trim($jsonobj['totaltime']) !== '500ms') { + echo 'Total time: ' . $build->tests()->sum('time') . PHP_EOL; + if (abs($build->tests()->sum('time') - 0.5) > 0.0001) { $this->fail('Did not find 500ms totaltime when expected'); } } diff --git a/app/cdash/tests/test_managemeasurements.php b/app/cdash/tests/test_managemeasurements.php index fd2c3a0fa0..f9e159555f 100644 --- a/app/cdash/tests/test_managemeasurements.php +++ b/app/cdash/tests/test_managemeasurements.php @@ -169,28 +169,6 @@ public function testManageMeasurements() $idx++; } - // Verify that the new measurements are displayed on viewTest.php. - $this->get($this->url . "/api/v1/viewTest.php?buildid=$this->BuildId"); - $content = $this->getBrowser()->getContent(); - $jsonobj = json_decode($content, true); - $this->assertEqual(3, $jsonobj['columncount']); - $this->assertEqual('Processors', $jsonobj['columnnames'][0]); - $this->assertEqual('I/O Wait Time', $jsonobj['columnnames'][1]); - $this->assertEqual('Peak Memory', $jsonobj['columnnames'][2]); - $this->assertEqual(3, count($jsonobj['tests'])); - $first = true; - foreach ($jsonobj['tests'] as $test) { - $test_name = $test['name']; - $num_procs = $test['measurements'][0]; - $proc_time = $test['procTimeFull']; - $this->validate_test($test_name, $num_procs, $proc_time, 'viewTest.php'); - if ($first && $num_procs) { - $selected_test_name = $test['name']; - $selected_nprocs = $num_procs; - $first = false; - } - } - // Check queryTests.php for this extra data too. $this->get($this->url . '/api/v1/queryTests.php?project=InsightExample&date=2017-08-29'); $content = $this->getBrowser()->getContent(); @@ -206,22 +184,6 @@ public function testManageMeasurements() $this->validate_test($build['testname'], $build['nprocs'], $build['procTime'], 'queryTests.php'); } - $this->get($this->url . "/api/v1/viewTest.php?buildid=$this->SubProjectBuildId"); - $content = $this->getBrowser()->getContent(); - $jsonobj = json_decode($content, true); - $this->assertEqual(3, $jsonobj['columncount']); - $this->assertEqual('Processors', $jsonobj['columnnames'][0]); - $this->assertEqual('I/O Wait Time', $jsonobj['columnnames'][1]); - $this->assertEqual('Peak Memory', $jsonobj['columnnames'][2]); - $this->assertEqual(3, count($jsonobj['tests'])); - foreach ($jsonobj['tests'] as $test) { - $test_name = $test['name']; - $num_procs = $test['measurements'][0]; - $proc_time = $test['procTimeFull']; - $io_wait_time = $test['measurements'][1]; - $this->validate_subproject_test($test_name, $num_procs, $proc_time, $io_wait_time, 'viewTest.php'); - } - $this->get($this->url . '/api/v1/queryTests.php?project=SubProjectExample&date=2017-08-29'); $content = $this->getBrowser()->getContent(); $jsonobj = json_decode($content, true); @@ -253,12 +215,5 @@ public function testManageMeasurements() $this->fail("Expected proc time to be $expected but found $found for subproject build $label"); } } - - // Verify that our test graphs correctly report Processors. - $this->get($this->url . "/api/v1/testGraph.php?testname={$selected_test_name}&buildid={$this->BuildId}&measurementname=Processors&type=measurement"); - $content = $this->getBrowser()->getContent(); - $jsonobj = json_decode($content, true); - $this->assertTrue($jsonobj[0]['data'][0]['y'] == $selected_nprocs); - $this->assertTrue(count($jsonobj[0]['data']) === 1); } } diff --git a/app/cdash/tests/test_multiplelabelsfortests.php b/app/cdash/tests/test_multiplelabelsfortests.php index 29c5e6a841..13b3957c9b 100644 --- a/app/cdash/tests/test_multiplelabelsfortests.php +++ b/app/cdash/tests/test_multiplelabelsfortests.php @@ -60,11 +60,5 @@ public function testMultipleLabelsForTests(): void $this->assertEqual('label1', $labels[0]); $this->assertEqual('label2', $labels[1]); $this->assertEqual('label3', $labels[2]); - - // Verify that these labels are correctly returned by the viewTests API. - $this->get("{$this->url}/api/v1/viewTest.php?buildid={$buildid}"); - $content = $this->getBrowser()->getContent(); - $jsonobj = json_decode($content, true); - $this->assertTrue(3 === count($jsonobj['tests'][0]['labels'])); } } diff --git a/app/cdash/tests/test_multiplesubprojects.php b/app/cdash/tests/test_multiplesubprojects.php index fc64da3230..c5e33fe21e 100644 --- a/app/cdash/tests/test_multiplesubprojects.php +++ b/app/cdash/tests/test_multiplesubprojects.php @@ -738,7 +738,6 @@ public function testMultipleSubprojects(): void // Verify that 'Back' links to the parent build. $pages = [ 'viewDynamicAnalysis.php', - 'viewTest.php', ]; $child_buildid = $builds[0]['id']; diff --git a/app/cdash/tests/test_redundanttests.php b/app/cdash/tests/test_redundanttests.php index 89a15a986d..602205e14a 100644 --- a/app/cdash/tests/test_redundanttests.php +++ b/app/cdash/tests/test_redundanttests.php @@ -80,28 +80,5 @@ public function testRedundantTests(): void if (!$test2found) { $this->fail('test #2 output not found when expected'); } - - // Verify expected output from 'view tests' API. - $this->get("{$this->url}/api/v1/viewTest.php?buildid={$buildid}"); - $content = $this->getBrowser()->getContent(); - $jsonobj = json_decode($content, true); - $this->assertEqual(2, count($jsonobj['tests'])); - - $purple_found = false; - $orange_found = false; - foreach ($jsonobj['tests'] as $test) { - if ($test['measurements'][0] === 'purple') { - $purple_found = true; - } - if ($test['measurements'][0] === 'orange') { - $orange_found = true; - } - } - if (!$purple_found) { - $this->fail('purple test not found when expected'); - } - if (!$orange_found) { - $this->fail('orange test not found when expected'); - } } } diff --git a/app/cdash/tests/test_subprojecttestfilters.php b/app/cdash/tests/test_subprojecttestfilters.php deleted file mode 100644 index 4e38d7f689..0000000000 --- a/app/cdash/tests/test_subprojecttestfilters.php +++ /dev/null @@ -1,76 +0,0 @@ -get($this->url . '/api/v1/index.php?project=Trilinos&date=2011-07-22&filtercount=3&showfilters=1&filtercombine=and&field1=subprojects&compare1=92&value1=AztecOO&field2=subprojects&compare2=92&value2=TrilinosFramework&field3=site&compare3=61&value3=hut11.kitware'); - $content = $this->getBrowser()->getContent(); - - // Get (and verify) some info about this filtered build. - $jsonobj = json_decode($content, true); - $buildgroup = array_pop($jsonobj['buildgroups']); - $this->assertEqual(1, count($buildgroup['builds'])); - $build = $buildgroup['builds'][0]; - $this->assertEqual(273, $build['test']['pass']); - $this->assertEqual(1, $build['test']['fail']); - $this->assertEqual(88, $build['test']['notrun']); - - // Verify filters to be passed to viewTest.php. - $expected = '&field1=subproject&compare1=62&value1=AztecOO&field2=subproject&compare2=62&value2=TrilinosFramework&filtercount=2&filtercombine=and&showfilters=1'; - $testfilters = $jsonobj['testfilters']; - $this->assertEqual($expected, $testfilters); - - // Load viewTest.php with this filters and verify the results. - $this->get("{$this->url}/api/v1/viewTest.php?buildid={$build['id']}{$testfilters}"); - $content = $this->getBrowser()->getContent(); - $jsonobj = json_decode($content, true); - $this->assertEqual(273, $jsonobj['numPassed']); - $this->assertEqual(1, $jsonobj['numFailed']); - $this->assertEqual(88, $jsonobj['numNotRun']); - foreach ($jsonobj['tests'] as $test) { - $this->assertNotEqual('TrilinosFramework', $test['subprojectname']); - $this->assertNotEqual('AztecOO', $test['subprojectname']); - } - - // Verify that SubProject test filters do not get set when viewing - // the children of a single build. - $this->get("{$this->url}/api/v1/index.php?project=Trilinos&date=2011-07-22&parentid={$build['id']}"); - $content = $this->getBrowser()->getContent(); - $jsonobj = json_decode($content, true); - $this->assertEqual('', $jsonobj['testfilters']); - - // Verify that the "include SubProjects" filters works as expected. - $this->get($this->url . '/api/v1/index.php?project=Trilinos&filtercount=3&field1=subprojects&compare1=93&value1=Sacado&field2=subprojects&compare2=93&value2=TrilinosFramework&field3=site&compare3=61&value3=hut11.kitware'); - $content = $this->getBrowser()->getContent(); - $jsonobj = json_decode($content, true); - $buildgroup = array_pop($jsonobj['buildgroups']); - $this->assertEqual(1, count($buildgroup['builds'])); - $build = $buildgroup['builds'][0]; - $this->assertEqual(300, $build['test']['pass']); - $this->assertEqual(11, $build['test']['fail']); - $this->assertEqual(0, $build['test']['notrun']); - $expected = '&field1=subproject&compare1=61&value1=Sacado&field2=subproject&compare2=61&value2=TrilinosFramework&filtercount=2&filtercombine=or&showfilters=1'; - $testfilters = $jsonobj['testfilters']; - $this->assertEqual($expected, $testfilters); - $this->get("{$this->url}/api/v1/viewTest.php?buildid={$build['id']}{$testfilters}"); - $content = $this->getBrowser()->getContent(); - $jsonobj = json_decode($content, true); - $this->assertEqual(300, $jsonobj['numPassed']); - $this->assertEqual(11, $jsonobj['numFailed']); - $this->assertEqual(0, $jsonobj['numNotRun']); - foreach ($jsonobj['tests'] as $test) { - if ($test['subprojectname'] !== 'TrilinosFramework' && $test['subprojectname'] !== 'Sacado') { - $this->fail("Unexpected subprojectname on viewTest.php for include case: {$test['subprojectname']}"); - } - } - } -} diff --git a/app/cdash/tests/test_testhistory.php b/app/cdash/tests/test_testhistory.php index dec768f6d3..7f06fb55fc 100644 --- a/app/cdash/tests/test_testhistory.php +++ b/app/cdash/tests/test_testhistory.php @@ -231,55 +231,6 @@ public function testTestHistory(): void $buildids[] = $build->buildid; } - // Verify handling of bad 'previous_builds' parameter. - $url = "{$this->url}/api/v1/viewTest.php?buildid={$buildids[4]}&groupid={$groupid}&previous_builds=exit(1)&projectid={$this->project->Id}&tests%5B%5D=fails&tests%5B%5D=flaky&tests%5B%5D=notrun&tests%5B%5D=passes&tests%5B%5D=sporadic&time_begin=2015-11-16T01:00:00&time_end=2015-11-17T01:00:00"; - $client = $this->getGuzzleClient(); - $response = $client->request('GET', $url, ['http_errors' => false]); - $expected = '{"tests":[{"name":"fails","summary":"Broken","summaryclass":"error"},{"name":"flaky","summary":"Unstable","summaryclass":"warning"},{"name":"notrun","summary":"Inactive","summaryclass":"warning"},{"name":"passes","summary":"Stable","summaryclass":"normal"},{"name":"sporadic","summary":"Stable","summaryclass":"normal"}]}'; - $this->assertEqual($expected, (string) $response->getBody()); - - // Verify that testing history matches what we expect. - $previous_buildids = "{$buildids[4]},+{$buildids[3]},+{$buildids[2]},+{$buildids[1]}"; - $url = "{$this->url}/api/v1/viewTest.php?buildid={$buildids[4]}&groupid={$groupid}&previous_builds={$previous_buildids}&projectid={$this->project->Id}&tests%5B%5D=fails&tests%5B%5D=flaky&tests%5B%5D=notrun&tests%5B%5D=passes&tests%5B%5D=sporadic&time_begin=2015-11-16T01:00:00&time_end=2015-11-17T01:00:00"; - $client = $this->getGuzzleClient(); - $response = $client->request('GET', - $url, - ['http_errors' => false]); - $jsonobj = json_decode($response->getBody(), true); - foreach ($jsonobj['tests'] as $test) { - $history = $test['history']; - switch ($test['name']) { - case 'fails': - if ($history !== 'Broken') { - $this->fail("Expected history for test 'fails' to be 'Broken', instead found '$history'"); - } - break; - case 'notrun': - if ($history !== 'Inactive') { - $this->fail("Expected history for test 'notrun' to be 'Inactive', instead found '$history'"); - } - break; - case 'flaky': - if ($history !== 'Unstable') { - $this->fail("Expected history for test 'flaky' to be 'Unstable', instead found '$history'"); - } - break; - case 'passes': - if ('passes' && $history !== 'Stable') { - $this->fail("Expected history for test 'passes' to be 'Stable', instead found '$history'"); - } - break; - case 'sporadic': - if ('sporadic' && $history !== 'Stable') { - $this->fail("Expected history for test 'sporadic' to be 'Stable', instead found '$history'"); - } - break; - default: - $this->fail("Unexpected test encountered: {$test['name']}"); - break; - } - } - // Verify test graphs for our 'flaky' test. // test graph diff --git a/app/cdash/tests/test_timeoutsandmissingtests.php b/app/cdash/tests/test_timeoutsandmissingtests.php index dabc1696f9..fa390fce3b 100644 --- a/app/cdash/tests/test_timeoutsandmissingtests.php +++ b/app/cdash/tests/test_timeoutsandmissingtests.php @@ -1,7 +1,5 @@ buildName = 'Win32-MSVC2009'; } - private function getLastBuildId() - { - $sql = " - SELECT id - FROM build - WHERE name='{$this->buildName}' - ORDER BY starttime DESC - LIMIT 1 - "; - - $query = DB::select($sql)[0]; - return $query->id; - } - public function testMissingTestsSummarizedInEmail(): void { $this->deleteLog($this->logfilename); @@ -66,33 +50,6 @@ public function testMissingTestsSummarizedInEmail(): void } } - public function testMissingTestsSummarizedInViewTestAPI(): void - { - $id = $this->getLastBuildId(); - - $url = "{$this->url}/api/v1/viewTest.php?buildid={$id}"; - $this->get($url); - $json = $this->getBrowser()->getContent(); - - $response = json_decode($json, true); - $tests = []; - - foreach ($response['tests'] as $test) { - $tests[$test['name']] = $test; - } - - $this->assertEqual($response['numMissing'], 3); - - $this->assertEqual($tests['SystemInfoTest']['status'], 'Missing'); - $this->assertEqual($tests['DashboardSendTest']['status'], 'Missing'); - $this->assertEqual($tests['Parser1Test1']['status'], 'Missing'); - - $this->assertNotEqual($tests['curl']['status'], 'Missing'); - $this->assertNotEqual($tests['FileActionsTest']['status'], 'Missing'); - $this->assertNotEqual($tests['StringActionsTest']['status'], 'Missing'); - $this->assertNotEqual($tests['MathActionsTest']['status'], 'Missing'); - } - public function testTimeoutFailuresDifferentiatedInEmail(): void { $this->deleteLog($this->logfilename); diff --git a/phpstan-baseline.neon b/phpstan-baseline.neon index 10110cce65..b5682b3e31 100644 --- a/phpstan-baseline.neon +++ b/phpstan-baseline.neon @@ -1572,36 +1572,6 @@ parameters: count: 1 path: app/Http/Controllers/UserController.php - - - rawMessage: 'Method App\Http\Controllers\ViewTestController::get_int_param() has parameter $name with no type specified.' - identifier: missingType.parameter - count: 1 - path: app/Http/Controllers/ViewTestController.php - - - - rawMessage: 'Method App\Http\Controllers\ViewTestController::get_int_param() has parameter $required with no type specified.' - identifier: missingType.parameter - count: 1 - path: app/Http/Controllers/ViewTestController.php - - - - rawMessage: 'Only booleans are allowed in an if condition, int given.' - identifier: if.condNotBoolean - count: 1 - path: app/Http/Controllers/ViewTestController.php - - - - rawMessage: 'Parameter #2 $build of class CDash\Controller\Api\ViewTest constructor expects CDash\Model\Build, CDash\Model\Build|null given.' - identifier: argument.type - count: 1 - path: app/Http/Controllers/ViewTestController.php - - - - rawMessage: 'Strict comparison using === between null and string will always evaluate to false.' - identifier: identical.alwaysFalse - count: 1 - path: app/Http/Controllers/ViewTestController.php - - rawMessage: 'PHPDoc type array of property App\Http\Kernel::$middleware is not the same as PHPDoc type array of overridden property Illuminate\Foundation\Http\Kernel::$middleware.' identifier: property.phpDocType @@ -7372,679 +7342,322 @@ parameters: path: app/cdash/app/Controller/Api/Timeline.php - - rawMessage: Access to an undefined property CDash\Controller\Api\ViewTest::$pageTimer. - identifier: property.notFound + rawMessage: Comparison operation ">" between 0 and 0 is always false. + identifier: greater.alwaysFalse + count: 2 + path: app/cdash/app/Lib/Repository/GitHub.php + + - + rawMessage: If condition is always false. + identifier: if.alwaysFalse + count: 3 + path: app/cdash/app/Lib/Repository/GitHub.php + + - + rawMessage: 'Method CDash\Lib\Repository\GitHub::__construct() throws checked exception TypeError but it''s missing from the PHPDoc @throws tag.' + identifier: missingType.checkedException + count: 2 + path: app/cdash/app/Lib/Repository/GitHub.php + + - + rawMessage: 'Method CDash\Lib\Repository\GitHub::authenticate() throws checked exception Lcobucci\JWT\Encoding\CannotEncodeContent but it''s missing from the PHPDoc @throws tag.' + identifier: missingType.checkedException count: 1 - path: app/cdash/app/Controller/Api/ViewTest.php + path: app/cdash/app/Lib/Repository/GitHub.php - - rawMessage: 'Argument of an invalid type mixed supplied for foreach, only iterables are supported.' - identifier: foreach.nonIterable + rawMessage: 'Method CDash\Lib\Repository\GitHub::authenticate() throws checked exception Lcobucci\JWT\Signer\CannotSignPayload but it''s missing from the PHPDoc @throws tag.' + identifier: missingType.checkedException count: 1 - path: app/cdash/app/Controller/Api/ViewTest.php + path: app/cdash/app/Lib/Repository/GitHub.php - - rawMessage: 'Call to an undefined method App\Models\Project|Illuminate\Database\Eloquent\Collection::pinnedTestMeasurements().' - identifier: method.notFound + rawMessage: 'Method CDash\Lib\Repository\GitHub::authenticate() throws checked exception Lcobucci\JWT\Signer\Ecdsa\ConversionFailed but it''s missing from the PHPDoc @throws tag.' + identifier: missingType.checkedException count: 1 - path: app/cdash/app/Controller/Api/ViewTest.php + path: app/cdash/app/Lib/Repository/GitHub.php - - rawMessage: ''' - Call to deprecated function pdo_real_escape_string(): - 04/01/2023 - ''' - identifier: function.deprecated - count: 3 - path: app/cdash/app/Controller/Api/ViewTest.php + rawMessage: 'Method CDash\Lib\Repository\GitHub::authenticate() throws checked exception Lcobucci\JWT\Signer\InvalidKeyProvided but it''s missing from the PHPDoc @throws tag.' + identifier: missingType.checkedException + count: 1 + path: app/cdash/app/Lib/Repository/GitHub.php - - rawMessage: 'Call to function array_search() requires parameter #3 to be set.' - identifier: function.strict + rawMessage: 'Method CDash\Lib\Repository\GitHub::authenticate() throws checked exception Lcobucci\JWT\Signer\Key\FileCouldNotBeRead but it''s missing from the PHPDoc @throws tag.' + identifier: missingType.checkedException count: 1 - path: app/cdash/app/Controller/Api/ViewTest.php + path: app/cdash/app/Lib/Repository/GitHub.php - - rawMessage: Cannot access property $projectid on stdClass|null. - identifier: property.nonObject + rawMessage: 'Only booleans are allowed in a negated boolean, bool|string given.' + identifier: booleanNot.exprNotBoolean + count: 2 + path: app/cdash/app/Lib/Repository/GitHub.php + + - + rawMessage: 'Parameter #1 $filename of function file_exists expects string, bool|string|null given.' + identifier: argument.type count: 1 - path: app/cdash/app/Controller/Api/ViewTest.php + path: app/cdash/app/Lib/Repository/GitHub.php - - rawMessage: Cannot cast mixed to int. - identifier: cast.int + rawMessage: 'Parameter #1 $issuer of method Lcobucci\JWT\Builder::issuedBy() expects non-empty-string, bool|string given.' + identifier: argument.type count: 1 - path: app/cdash/app/Controller/Api/ViewTest.php + path: app/cdash/app/Lib/Repository/GitHub.php - - rawMessage: 'Construct empty() is not allowed. Use more strict comparison.' - identifier: empty.notAllowed - count: 6 - path: app/cdash/app/Controller/Api/ViewTest.php + rawMessage: 'Possibly invalid array key type int<0, max>|false.' + identifier: offsetAccess.invalidOffset + count: 1 + path: app/cdash/app/Lib/Repository/GitHub.php - - rawMessage: Foreach overwrites $test with its value variable. - identifier: foreach.valueOverwrite + rawMessage: Property CDash\Lib\Repository\GitHub::$apiClient has no type specified. + identifier: missingType.property count: 1 - path: app/cdash/app/Controller/Api/ViewTest.php + path: app/cdash/app/Lib/Repository/GitHub.php - - rawMessage: 'Loose comparison via "!=" between mixed and string is not allowed.' - identifier: notEqual.notAllowed - count: 6 - path: app/cdash/app/Controller/Api/ViewTest.php + rawMessage: 'Property CDash\Lib\Repository\GitHub::$baseUrl (string) does not accept bool|string.' + identifier: assign.propertyType + count: 1 + path: app/cdash/app/Lib/Repository/GitHub.php - - rawMessage: 'Loose comparison via "==" between int and int is not allowed.' - identifier: equal.notAllowed + rawMessage: Property CDash\Lib\Repository\GitHub::$check has no type specified. + identifier: missingType.property count: 1 - path: app/cdash/app/Controller/Api/ViewTest.php + path: app/cdash/app/Lib/Repository/GitHub.php - - rawMessage: 'Loose comparison via "==" between int<0, 2> and int is not allowed.' - identifier: equal.notAllowed + rawMessage: Property CDash\Lib\Repository\GitHub::$db has no type specified. + identifier: missingType.property count: 1 - path: app/cdash/app/Controller/Api/ViewTest.php + path: app/cdash/app/Lib/Repository/GitHub.php - - rawMessage: 'Loose comparison via "==" between mixed and int is not allowed.' - identifier: equal.notAllowed - count: 4 - path: app/cdash/app/Controller/Api/ViewTest.php + rawMessage: 'Strict comparison using === between 0 and 0 will always evaluate to true.' + identifier: identical.alwaysTrue + count: 1 + path: app/cdash/app/Lib/Repository/GitHub.php - - rawMessage: 'Method CDash\Controller\Api\ViewTest::exportAsCsv() has parameter $projectshowtesttime with no type specified.' - identifier: missingType.parameter + rawMessage: Property CDash\Model\ActionableTypes::$categories has no type specified. + identifier: missingType.property count: 1 - path: app/cdash/app/Controller/Api/ViewTest.php + path: app/cdash/app/Model/ActionableTypes.php - - rawMessage: 'Method CDash\Controller\Api\ViewTest::exportAsCsv() has parameter $stmt with no type specified.' - identifier: missingType.parameter + rawMessage: ''' + Call to deprecated function pdo_execute(): + v2.5.0 01/22/2018 + ''' + identifier: function.deprecated + count: 13 + path: app/cdash/app/Model/Build.php + + - + rawMessage: ''' + Call to deprecated method getPdo() of class CDash\Database: + 04/22/2023 Use Laravel query builder or Eloquent instead + ''' + identifier: method.deprecated count: 1 - path: app/cdash/app/Controller/Api/ViewTest.php + path: app/cdash/app/Model/Build.php - - rawMessage: 'Method CDash\Controller\Api\ViewTest::exportAsCsv() has parameter $testtimemaxstatus with no type specified.' - identifier: missingType.parameter + rawMessage: 'Call to function in_array() requires parameter #3 to be set.' + identifier: function.strict count: 1 - path: app/cdash/app/Controller/Api/ViewTest.php + path: app/cdash/app/Model/Build.php - - rawMessage: 'Method CDash\Controller\Api\ViewTest::exportAsCsv() should return string but returns (string|false).' - identifier: return.type + rawMessage: Cannot access offset 'status' on mixed. + identifier: offsetAccess.nonOffsetAccessible + count: 3 + path: app/cdash/app/Model/Build.php + + - + rawMessage: Cannot access property $measurements on mixed. + identifier: property.nonObject count: 1 - path: app/cdash/app/Controller/Api/ViewTest.php + path: app/cdash/app/Model/Build.php - - rawMessage: 'Method CDash\Controller\Api\ViewTest::getResponse() has no return type specified.' - identifier: missingType.return + rawMessage: Cannot access property $time on mixed. + identifier: property.nonObject count: 1 - path: app/cdash/app/Controller/Api/ViewTest.php + path: app/cdash/app/Model/Build.php - - rawMessage: 'Method CDash\Controller\Api\ViewTest::getTestHistory() has parameter $previous_buildids with no type specified.' - identifier: missingType.parameter + rawMessage: 'Casting to int something that''s already int<1, max>.' + identifier: cast.useless count: 1 - path: app/cdash/app/Controller/Api/ViewTest.php + path: app/cdash/app/Model/Build.php - - rawMessage: 'Method CDash\Controller\Api\ViewTest::getTestHistory() has parameter $testname with no type specified.' - identifier: missingType.parameter + rawMessage: Class CDash\Model\Build has an uninitialized property $BeginningOfDay. Give it default value or assign it in the constructor. + identifier: property.uninitialized count: 1 - path: app/cdash/app/Controller/Api/ViewTest.php + path: app/cdash/app/Model/Build.php - - rawMessage: 'Method CDash\Controller\Api\ViewTest::getTestHistory() return type has no value type specified in iterable type array.' - identifier: missingType.iterableValue + rawMessage: Class CDash\Model\Build has an uninitialized property $BuildEmailCollection. Give it default value or assign it in the constructor. + identifier: property.uninitialized count: 1 - path: app/cdash/app/Controller/Api/ViewTest.php + path: app/cdash/app/Model/Build.php - - rawMessage: 'Method CDash\Controller\Api\ViewTest::getTestSummary() has parameter $begin with no type specified.' - identifier: missingType.parameter + rawMessage: Class CDash\Model\Build has an uninitialized property $BuildErrorCount. Give it default value or assign it in the constructor. + identifier: property.uninitialized count: 1 - path: app/cdash/app/Controller/Api/ViewTest.php + path: app/cdash/app/Model/Build.php - - rawMessage: 'Method CDash\Controller\Api\ViewTest::getTestSummary() has parameter $end with no type specified.' - identifier: missingType.parameter + rawMessage: Class CDash\Model\Build has an uninitialized property $Done. Give it default value or assign it in the constructor. + identifier: property.uninitialized count: 1 - path: app/cdash/app/Controller/Api/ViewTest.php + path: app/cdash/app/Model/Build.php - - rawMessage: 'Method CDash\Controller\Api\ViewTest::getTestSummary() has parameter $groupid with no type specified.' - identifier: missingType.parameter + rawMessage: Class CDash\Model\Build has an uninitialized property $DynamicAnalysisCollection. Give it default value or assign it in the constructor. + identifier: property.uninitialized count: 1 - path: app/cdash/app/Controller/Api/ViewTest.php + path: app/cdash/app/Model/Build.php - - rawMessage: 'Method CDash\Controller\Api\ViewTest::getTestSummary() has parameter $projectid with no type specified.' - identifier: missingType.parameter + rawMessage: Class CDash\Model\Build has an uninitialized property $EndOfDay. Give it default value or assign it in the constructor. + identifier: property.uninitialized count: 1 - path: app/cdash/app/Controller/Api/ViewTest.php + path: app/cdash/app/Model/Build.php - - rawMessage: 'Method CDash\Controller\Api\ViewTest::getTestSummary() has parameter $testname with no type specified.' - identifier: missingType.parameter + rawMessage: Class CDash\Model\Build has an uninitialized property $ErrorDifferences. Give it default value or assign it in the constructor. + identifier: property.uninitialized count: 1 - path: app/cdash/app/Controller/Api/ViewTest.php + path: app/cdash/app/Model/Build.php - - rawMessage: 'Method CDash\Controller\Api\ViewTest::getTestSummary() return type has no value type specified in iterable type array.' - identifier: missingType.iterableValue + rawMessage: Class CDash\Model\Build has an uninitialized property $MissingTests. Give it default value or assign it in the constructor. + identifier: property.uninitialized count: 1 - path: app/cdash/app/Controller/Api/ViewTest.php + path: app/cdash/app/Model/Build.php - - rawMessage: 'Method CDash\Controller\Api\ViewTest::marshal() has parameter $buildid with no type specified.' - identifier: missingType.parameter + rawMessage: Class CDash\Model\Build has an uninitialized property $Project. Give it default value or assign it in the constructor. + identifier: property.uninitialized count: 1 - path: app/cdash/app/Controller/Api/ViewTest.php + path: app/cdash/app/Model/Build.php - - rawMessage: 'Method CDash\Controller\Api\ViewTest::marshal() has parameter $data with no type specified.' - identifier: missingType.parameter + rawMessage: Class CDash\Model\Build has an uninitialized property $TestFailedCount. Give it default value or assign it in the constructor. + identifier: property.uninitialized count: 1 - path: app/cdash/app/Controller/Api/ViewTest.php + path: app/cdash/app/Model/Build.php - - rawMessage: 'Method CDash\Controller\Api\ViewTest::marshal() has parameter $projectname with no type specified.' - identifier: missingType.parameter + rawMessage: 'Construct empty() is not allowed. Use more strict comparison.' + identifier: empty.notAllowed + count: 19 + path: app/cdash/app/Model/Build.php + + - + rawMessage: 'Loose comparison via "!=" between mixed and mixed is not allowed.' + identifier: notEqual.notAllowed + count: 2 + path: app/cdash/app/Model/Build.php + + - + rawMessage: 'Method CDash\Model\Build::AddBuild() throws checked exception Error but it''s missing from the PHPDoc @throws tag.' + identifier: missingType.checkedException count: 1 - path: app/cdash/app/Controller/Api/ViewTest.php + path: app/cdash/app/Model/Build.php - - rawMessage: 'Method CDash\Controller\Api\ViewTest::marshal() has parameter $projectshowtesttime with no type specified.' + rawMessage: 'Method CDash\Model\Build::AddError() has parameter $error with no type specified.' identifier: missingType.parameter count: 1 - path: app/cdash/app/Controller/Api/ViewTest.php + path: app/cdash/app/Model/Build.php - - rawMessage: 'Method CDash\Controller\Api\ViewTest::marshal() has parameter $testdate with no type specified.' + rawMessage: 'Method CDash\Model\Build::AddLabel() has parameter $label with no type specified.' identifier: missingType.parameter count: 1 - path: app/cdash/app/Controller/Api/ViewTest.php + path: app/cdash/app/Model/Build.php - - rawMessage: 'Method CDash\Controller\Api\ViewTest::marshal() has parameter $testtimemaxstatus with no type specified.' + rawMessage: 'Method CDash\Model\Build::ConvertMissingToZero() has parameter $value with no type specified.' identifier: missingType.parameter count: 1 - path: app/cdash/app/Controller/Api/ViewTest.php + path: app/cdash/app/Model/Build.php - - rawMessage: 'Method CDash\Controller\Api\ViewTest::marshal() return type has no value type specified in iterable type array.' - identifier: missingType.iterableValue + rawMessage: 'Method CDash\Model\Build::CreateParentBuild() throws checked exception TypeError but it''s missing from the PHPDoc @throws tag.' + identifier: missingType.checkedException count: 1 - path: app/cdash/app/Controller/Api/ViewTest.php + path: app/cdash/app/Model/Build.php - - rawMessage: 'Method CDash\Controller\Api\ViewTest::marshalMissing() has parameter $buildid with no type specified.' + rawMessage: 'Method CDash\Model\Build::FillFromId() has parameter $buildid with no type specified.' identifier: missingType.parameter count: 1 - path: app/cdash/app/Controller/Api/ViewTest.php + path: app/cdash/app/Model/Build.php - - rawMessage: 'Method CDash\Controller\Api\ViewTest::marshalMissing() has parameter $name with no type specified.' - identifier: missingType.parameter - count: 1 - path: app/cdash/app/Controller/Api/ViewTest.php + rawMessage: 'Method CDash\Model\Build::FillFromId() throws checked exception TypeError but it''s missing from the PHPDoc @throws tag.' + identifier: missingType.checkedException + count: 3 + path: app/cdash/app/Model/Build.php - - rawMessage: 'Method CDash\Controller\Api\ViewTest::marshalMissing() has parameter $projectname with no type specified.' + rawMessage: 'Method CDash\Model\Build::GenerateUuid() has parameter $name with no type specified.' identifier: missingType.parameter count: 1 - path: app/cdash/app/Controller/Api/ViewTest.php + path: app/cdash/app/Model/Build.php - - rawMessage: 'Method CDash\Controller\Api\ViewTest::marshalMissing() has parameter $projectshowtesttime with no type specified.' + rawMessage: 'Method CDash\Model\Build::GenerateUuid() has parameter $projectid with no type specified.' identifier: missingType.parameter count: 1 - path: app/cdash/app/Controller/Api/ViewTest.php + path: app/cdash/app/Model/Build.php - - rawMessage: 'Method CDash\Controller\Api\ViewTest::marshalMissing() has parameter $testdate with no type specified.' + rawMessage: 'Method CDash\Model\Build::GenerateUuid() has parameter $siteid with no type specified.' identifier: missingType.parameter count: 1 - path: app/cdash/app/Controller/Api/ViewTest.php + path: app/cdash/app/Model/Build.php - - rawMessage: 'Method CDash\Controller\Api\ViewTest::marshalMissing() has parameter $testtimemaxstatus with no type specified.' + rawMessage: 'Method CDash\Model\Build::GenerateUuid() has parameter $stamp with no type specified.' identifier: missingType.parameter count: 1 - path: app/cdash/app/Controller/Api/ViewTest.php + path: app/cdash/app/Model/Build.php - - rawMessage: 'Method CDash\Controller\Api\ViewTest::marshalMissing() return type has no value type specified in iterable type array.' - identifier: missingType.iterableValue + rawMessage: 'Method CDash\Model\Build::GenerateUuid() has parameter $subprojectname with no type specified.' + identifier: missingType.parameter count: 1 - path: app/cdash/app/Controller/Api/ViewTest.php + path: app/cdash/app/Model/Build.php - - rawMessage: 'Method CDash\Controller\Api\ViewTest::marshalStatus() has parameter $status with no type specified.' - identifier: missingType.parameter + rawMessage: 'Method CDash\Model\Build::GetCommitAuthors() return type has no value type specified in iterable type array.' + identifier: missingType.iterableValue count: 1 - path: app/cdash/app/Controller/Api/ViewTest.php + path: app/cdash/app/Model/Build.php - - rawMessage: 'Method CDash\Controller\Api\ViewTest::marshalStatus() return type has no value type specified in iterable type array.' + rawMessage: 'Method CDash\Model\Build::GetDiffWithPreviousBuild() return type has no value type specified in iterable type array.' identifier: missingType.iterableValue count: 1 - path: app/cdash/app/Controller/Api/ViewTest.php + path: app/cdash/app/Model/Build.php - - rawMessage: 'Only booleans are allowed in &&, string given on the left side.' - identifier: booleanAnd.leftNotBoolean + rawMessage: 'Method CDash\Model\Build::GetErrorDifferences() should return array{builderrorspositive: int, builderrorsnegative: int, buildwarningspositive: int, buildwarningsnegative: int, configureerrors: int, configurewarnings: int, testpassedpositive: int, testpassednegative: int, ...}|false but returns non-empty-array<''builderrorsnegative''|''builderrorspositive''|''buildwarningsnegati…''|''buildwarningspositi…''|''configureerrors''|''configurewarnings''|''testfailednegative''|''testfailedpositive''|''testnotrunnegative''|''testnotrunpositive''|''testpassednegative''|''testpassedpositive'', int>.' + identifier: return.type count: 1 - path: app/cdash/app/Controller/Api/ViewTest.php - - - - rawMessage: 'Only booleans are allowed in &&, string given on the right side.' - identifier: booleanAnd.rightNotBoolean - count: 1 - path: app/cdash/app/Controller/Api/ViewTest.php - - - - rawMessage: 'Only booleans are allowed in an elseif condition, int given.' - identifier: elseif.condNotBoolean - count: 5 - path: app/cdash/app/Controller/Api/ViewTest.php - - - - rawMessage: 'Only booleans are allowed in an if condition, int given.' - identifier: if.condNotBoolean - count: 3 - path: app/cdash/app/Controller/Api/ViewTest.php - - - - rawMessage: 'Only booleans are allowed in an if condition, string given.' - identifier: if.condNotBoolean - count: 1 - path: app/cdash/app/Controller/Api/ViewTest.php - - - - rawMessage: 'Parameter #1 $stream of function fclose expects resource, resource|false given.' - identifier: argument.type - count: 1 - path: app/cdash/app/Controller/Api/ViewTest.php - - - - rawMessage: 'Parameter #1 $stream of function fputcsv expects resource, resource|false given.' - identifier: argument.type - count: 1 - path: app/cdash/app/Controller/Api/ViewTest.php - - - - rawMessage: 'Parameter #1 $stream of function rewind expects resource, resource|false given.' - identifier: argument.type - count: 1 - path: app/cdash/app/Controller/Api/ViewTest.php - - - - rawMessage: 'Parameter #1 $stream of function stream_get_contents expects resource, resource|false given.' - identifier: argument.type - count: 1 - path: app/cdash/app/Controller/Api/ViewTest.php - - - - rawMessage: 'Parameter #2 $timestamp of function gmdate expects int|null, (float|int) given.' - identifier: argument.type - count: 1 - path: app/cdash/app/Controller/Api/ViewTest.php - - - - rawMessage: Possibly invalid array key type int|string|false. - identifier: offsetAccess.invalidOffset - count: 1 - path: app/cdash/app/Controller/Api/ViewTest.php - - - - rawMessage: Property CDash\Controller\Api\ViewTest::$JSONEncodeResponse has no type specified. - identifier: missingType.property - count: 1 - path: app/cdash/app/Controller/Api/ViewTest.php - - - - rawMessage: Property CDash\Controller\Api\ViewTest::$extraMeasurements has no type specified. - identifier: missingType.property - count: 1 - path: app/cdash/app/Controller/Api/ViewTest.php - - - - rawMessage: Property CDash\Controller\Api\ViewTest::$numExtraMeasurements has no type specified. - identifier: missingType.property - count: 1 - path: app/cdash/app/Controller/Api/ViewTest.php - - - - rawMessage: Variable $current_buildid might not be defined. - identifier: variable.undefined - count: 1 - path: app/cdash/app/Controller/Api/ViewTest.php - - - - rawMessage: Variable $next_buildid might not be defined. - identifier: variable.undefined - count: 1 - path: app/cdash/app/Controller/Api/ViewTest.php - - - - rawMessage: Comparison operation ">" between 0 and 0 is always false. - identifier: greater.alwaysFalse - count: 2 - path: app/cdash/app/Lib/Repository/GitHub.php - - - - rawMessage: If condition is always false. - identifier: if.alwaysFalse - count: 3 - path: app/cdash/app/Lib/Repository/GitHub.php - - - - rawMessage: 'Method CDash\Lib\Repository\GitHub::__construct() throws checked exception TypeError but it''s missing from the PHPDoc @throws tag.' - identifier: missingType.checkedException - count: 2 - path: app/cdash/app/Lib/Repository/GitHub.php - - - - rawMessage: 'Method CDash\Lib\Repository\GitHub::authenticate() throws checked exception Lcobucci\JWT\Encoding\CannotEncodeContent but it''s missing from the PHPDoc @throws tag.' - identifier: missingType.checkedException - count: 1 - path: app/cdash/app/Lib/Repository/GitHub.php - - - - rawMessage: 'Method CDash\Lib\Repository\GitHub::authenticate() throws checked exception Lcobucci\JWT\Signer\CannotSignPayload but it''s missing from the PHPDoc @throws tag.' - identifier: missingType.checkedException - count: 1 - path: app/cdash/app/Lib/Repository/GitHub.php - - - - rawMessage: 'Method CDash\Lib\Repository\GitHub::authenticate() throws checked exception Lcobucci\JWT\Signer\Ecdsa\ConversionFailed but it''s missing from the PHPDoc @throws tag.' - identifier: missingType.checkedException - count: 1 - path: app/cdash/app/Lib/Repository/GitHub.php - - - - rawMessage: 'Method CDash\Lib\Repository\GitHub::authenticate() throws checked exception Lcobucci\JWT\Signer\InvalidKeyProvided but it''s missing from the PHPDoc @throws tag.' - identifier: missingType.checkedException - count: 1 - path: app/cdash/app/Lib/Repository/GitHub.php - - - - rawMessage: 'Method CDash\Lib\Repository\GitHub::authenticate() throws checked exception Lcobucci\JWT\Signer\Key\FileCouldNotBeRead but it''s missing from the PHPDoc @throws tag.' - identifier: missingType.checkedException - count: 1 - path: app/cdash/app/Lib/Repository/GitHub.php - - - - rawMessage: 'Only booleans are allowed in a negated boolean, bool|string given.' - identifier: booleanNot.exprNotBoolean - count: 2 - path: app/cdash/app/Lib/Repository/GitHub.php - - - - rawMessage: 'Parameter #1 $filename of function file_exists expects string, bool|string|null given.' - identifier: argument.type - count: 1 - path: app/cdash/app/Lib/Repository/GitHub.php - - - - rawMessage: 'Parameter #1 $issuer of method Lcobucci\JWT\Builder::issuedBy() expects non-empty-string, bool|string given.' - identifier: argument.type - count: 1 - path: app/cdash/app/Lib/Repository/GitHub.php - - - - rawMessage: 'Possibly invalid array key type int<0, max>|false.' - identifier: offsetAccess.invalidOffset - count: 1 - path: app/cdash/app/Lib/Repository/GitHub.php - - - - rawMessage: Property CDash\Lib\Repository\GitHub::$apiClient has no type specified. - identifier: missingType.property - count: 1 - path: app/cdash/app/Lib/Repository/GitHub.php - - - - rawMessage: 'Property CDash\Lib\Repository\GitHub::$baseUrl (string) does not accept bool|string.' - identifier: assign.propertyType - count: 1 - path: app/cdash/app/Lib/Repository/GitHub.php - - - - rawMessage: Property CDash\Lib\Repository\GitHub::$check has no type specified. - identifier: missingType.property - count: 1 - path: app/cdash/app/Lib/Repository/GitHub.php - - - - rawMessage: Property CDash\Lib\Repository\GitHub::$db has no type specified. - identifier: missingType.property - count: 1 - path: app/cdash/app/Lib/Repository/GitHub.php - - - - rawMessage: 'Strict comparison using === between 0 and 0 will always evaluate to true.' - identifier: identical.alwaysTrue - count: 1 - path: app/cdash/app/Lib/Repository/GitHub.php - - - - rawMessage: Property CDash\Model\ActionableTypes::$categories has no type specified. - identifier: missingType.property - count: 1 - path: app/cdash/app/Model/ActionableTypes.php - - - - rawMessage: ''' - Call to deprecated function pdo_execute(): - v2.5.0 01/22/2018 - ''' - identifier: function.deprecated - count: 13 - path: app/cdash/app/Model/Build.php - - - - rawMessage: ''' - Call to deprecated method getPdo() of class CDash\Database: - 04/22/2023 Use Laravel query builder or Eloquent instead - ''' - identifier: method.deprecated - count: 1 - path: app/cdash/app/Model/Build.php - - - - rawMessage: 'Call to function in_array() requires parameter #3 to be set.' - identifier: function.strict - count: 1 - path: app/cdash/app/Model/Build.php - - - - rawMessage: Cannot access offset 'status' on mixed. - identifier: offsetAccess.nonOffsetAccessible - count: 3 - path: app/cdash/app/Model/Build.php - - - - rawMessage: Cannot access property $measurements on mixed. - identifier: property.nonObject - count: 1 - path: app/cdash/app/Model/Build.php - - - - rawMessage: Cannot access property $time on mixed. - identifier: property.nonObject - count: 1 - path: app/cdash/app/Model/Build.php - - - - rawMessage: 'Casting to int something that''s already int<1, max>.' - identifier: cast.useless - count: 1 - path: app/cdash/app/Model/Build.php - - - - rawMessage: Class CDash\Model\Build has an uninitialized property $BeginningOfDay. Give it default value or assign it in the constructor. - identifier: property.uninitialized - count: 1 - path: app/cdash/app/Model/Build.php - - - - rawMessage: Class CDash\Model\Build has an uninitialized property $BuildEmailCollection. Give it default value or assign it in the constructor. - identifier: property.uninitialized - count: 1 - path: app/cdash/app/Model/Build.php - - - - rawMessage: Class CDash\Model\Build has an uninitialized property $BuildErrorCount. Give it default value or assign it in the constructor. - identifier: property.uninitialized - count: 1 - path: app/cdash/app/Model/Build.php - - - - rawMessage: Class CDash\Model\Build has an uninitialized property $Done. Give it default value or assign it in the constructor. - identifier: property.uninitialized - count: 1 - path: app/cdash/app/Model/Build.php - - - - rawMessage: Class CDash\Model\Build has an uninitialized property $DynamicAnalysisCollection. Give it default value or assign it in the constructor. - identifier: property.uninitialized - count: 1 - path: app/cdash/app/Model/Build.php - - - - rawMessage: Class CDash\Model\Build has an uninitialized property $EndOfDay. Give it default value or assign it in the constructor. - identifier: property.uninitialized - count: 1 - path: app/cdash/app/Model/Build.php - - - - rawMessage: Class CDash\Model\Build has an uninitialized property $ErrorDifferences. Give it default value or assign it in the constructor. - identifier: property.uninitialized - count: 1 - path: app/cdash/app/Model/Build.php - - - - rawMessage: Class CDash\Model\Build has an uninitialized property $MissingTests. Give it default value or assign it in the constructor. - identifier: property.uninitialized - count: 1 - path: app/cdash/app/Model/Build.php - - - - rawMessage: Class CDash\Model\Build has an uninitialized property $Project. Give it default value or assign it in the constructor. - identifier: property.uninitialized - count: 1 - path: app/cdash/app/Model/Build.php - - - - rawMessage: Class CDash\Model\Build has an uninitialized property $TestFailedCount. Give it default value or assign it in the constructor. - identifier: property.uninitialized - count: 1 - path: app/cdash/app/Model/Build.php - - - - rawMessage: 'Construct empty() is not allowed. Use more strict comparison.' - identifier: empty.notAllowed - count: 19 - path: app/cdash/app/Model/Build.php - - - - rawMessage: 'Loose comparison via "!=" between mixed and mixed is not allowed.' - identifier: notEqual.notAllowed - count: 2 - path: app/cdash/app/Model/Build.php - - - - rawMessage: 'Method CDash\Model\Build::AddBuild() throws checked exception Error but it''s missing from the PHPDoc @throws tag.' - identifier: missingType.checkedException - count: 1 - path: app/cdash/app/Model/Build.php - - - - rawMessage: 'Method CDash\Model\Build::AddError() has parameter $error with no type specified.' - identifier: missingType.parameter - count: 1 - path: app/cdash/app/Model/Build.php - - - - rawMessage: 'Method CDash\Model\Build::AddLabel() has parameter $label with no type specified.' - identifier: missingType.parameter - count: 1 - path: app/cdash/app/Model/Build.php - - - - rawMessage: 'Method CDash\Model\Build::ConvertMissingToZero() has parameter $value with no type specified.' - identifier: missingType.parameter - count: 1 - path: app/cdash/app/Model/Build.php - - - - rawMessage: 'Method CDash\Model\Build::CreateParentBuild() throws checked exception TypeError but it''s missing from the PHPDoc @throws tag.' - identifier: missingType.checkedException - count: 1 - path: app/cdash/app/Model/Build.php - - - - rawMessage: 'Method CDash\Model\Build::FillFromId() has parameter $buildid with no type specified.' - identifier: missingType.parameter - count: 1 - path: app/cdash/app/Model/Build.php - - - - rawMessage: 'Method CDash\Model\Build::FillFromId() throws checked exception TypeError but it''s missing from the PHPDoc @throws tag.' - identifier: missingType.checkedException - count: 3 - path: app/cdash/app/Model/Build.php - - - - rawMessage: 'Method CDash\Model\Build::GenerateUuid() has parameter $name with no type specified.' - identifier: missingType.parameter - count: 1 - path: app/cdash/app/Model/Build.php - - - - rawMessage: 'Method CDash\Model\Build::GenerateUuid() has parameter $projectid with no type specified.' - identifier: missingType.parameter - count: 1 - path: app/cdash/app/Model/Build.php - - - - rawMessage: 'Method CDash\Model\Build::GenerateUuid() has parameter $siteid with no type specified.' - identifier: missingType.parameter - count: 1 - path: app/cdash/app/Model/Build.php - - - - rawMessage: 'Method CDash\Model\Build::GenerateUuid() has parameter $stamp with no type specified.' - identifier: missingType.parameter - count: 1 - path: app/cdash/app/Model/Build.php - - - - rawMessage: 'Method CDash\Model\Build::GenerateUuid() has parameter $subprojectname with no type specified.' - identifier: missingType.parameter - count: 1 - path: app/cdash/app/Model/Build.php - - - - rawMessage: 'Method CDash\Model\Build::GetCommitAuthors() return type has no value type specified in iterable type array.' - identifier: missingType.iterableValue - count: 1 - path: app/cdash/app/Model/Build.php - - - - rawMessage: 'Method CDash\Model\Build::GetDiffWithPreviousBuild() return type has no value type specified in iterable type array.' - identifier: missingType.iterableValue - count: 1 - path: app/cdash/app/Model/Build.php - - - - rawMessage: 'Method CDash\Model\Build::GetErrorDifferences() should return array{builderrorspositive: int, builderrorsnegative: int, buildwarningspositive: int, buildwarningsnegative: int, configureerrors: int, configurewarnings: int, testpassedpositive: int, testpassednegative: int, ...}|false but returns non-empty-array<''builderrorsnegative''|''builderrorspositive''|''buildwarningsnegati…''|''buildwarningspositi…''|''configureerrors''|''configurewarnings''|''testfailednegative''|''testfailedpositive''|''testnotrunnegative''|''testnotrunpositive''|''testpassednegative''|''testpassedpositive'', int>.' - identifier: return.type - count: 1 - path: app/cdash/app/Model/Build.php + path: app/cdash/app/Model/Build.php - rawMessage: 'Method CDash\Model\Build::GetErrors() has parameter $propertyFilters with no value type specified in iterable type array.' @@ -8154,18 +7767,6 @@ parameters: count: 1 path: app/cdash/app/Model/Build.php - - - rawMessage: 'Method CDash\Model\Build::MarshalResponseArray() has parameter $optional_values with no value type specified in iterable type array.' - identifier: missingType.iterableValue - count: 1 - path: app/cdash/app/Model/Build.php - - - - rawMessage: 'Method CDash\Model\Build::MarshalResponseArray() return type has no value type specified in iterable type array.' - identifier: missingType.iterableValue - count: 1 - path: app/cdash/app/Model/Build.php - - rawMessage: 'Method CDash\Model\Build::PropertyFilter() has parameter $rows with no value type specified in iterable type array.' identifier: missingType.iterableValue @@ -8259,7 +7860,7 @@ parameters: - rawMessage: 'Only booleans are allowed in an if condition, string|false given.' identifier: if.condNotBoolean - count: 2 + count: 1 path: app/cdash/app/Model/Build.php - @@ -12723,12 +12324,6 @@ parameters: count: 1 path: app/cdash/include/filterdataFunctions.php - - - rawMessage: Access to an undefined property ViewTestPhpFilters::$TextConcat. - identifier: property.notFound - count: 1 - path: app/cdash/include/filterdataFunctions.php - - rawMessage: ''' Call to deprecated function pdo_fetch_array(): @@ -13014,18 +12609,6 @@ parameters: count: 1 path: app/cdash/include/filterdataFunctions.php - - - rawMessage: 'Method ViewTestPhpFilters::getDefaultFilter() return type has no value type specified in iterable type array.' - identifier: missingType.iterableValue - count: 1 - path: app/cdash/include/filterdataFunctions.php - - - - rawMessage: 'Method ViewTestPhpFilters::getSqlField() has parameter $field with no type specified.' - identifier: missingType.parameter - count: 1 - path: app/cdash/include/filterdataFunctions.php - - rawMessage: 'Only booleans are allowed in a while condition, array|false|null given.' identifier: while.condNotBoolean @@ -13083,7 +12666,7 @@ parameters: - rawMessage: Unreachable statement - code above always terminates. identifier: deadCode.unreachable - count: 5 + count: 4 path: app/cdash/include/filterdataFunctions.php - @@ -16878,117 +16461,6 @@ parameters: count: 1 path: app/cdash/tests/test_buildconfigure.php - - - rawMessage: ''' - Call to deprecated function pdo_fetch_array(): - 04/01/2023 - ''' - identifier: function.deprecated - count: 1 - path: app/cdash/tests/test_builddetails.php - - - - rawMessage: ''' - Call to deprecated function pdo_query(): - 04/01/2023 - ''' - identifier: function.deprecated - count: 1 - path: app/cdash/tests/test_builddetails.php - - - - rawMessage: ''' - Call to deprecated method submission() of class KWWebTestCase: - 12/09/2024 Use \Test\Traits\CreatesSubmissions instead - ''' - identifier: method.deprecated - count: 3 - path: app/cdash/tests/test_builddetails.php - - - - rawMessage: Cannot access property $numFailed on mixed. - identifier: property.nonObject - count: 2 - path: app/cdash/tests/test_builddetails.php - - - - rawMessage: Cannot access property $numNotRun on mixed. - identifier: property.nonObject - count: 2 - path: app/cdash/tests/test_builddetails.php - - - - rawMessage: Cannot access property $numPassed on mixed. - identifier: property.nonObject - count: 2 - path: app/cdash/tests/test_builddetails.php - - - - rawMessage: Cannot access property $numTimeFailed on mixed. - identifier: property.nonObject - count: 2 - path: app/cdash/tests/test_builddetails.php - - - - rawMessage: Cannot access property $parentBuild on mixed. - identifier: property.nonObject - count: 1 - path: app/cdash/tests/test_builddetails.php - - - - rawMessage: Cannot access property $tests on mixed. - identifier: property.nonObject - count: 3 - path: app/cdash/tests/test_builddetails.php - - - - rawMessage: 'Method BuildDetailsTestCase::__construct() with return type void returns int but should not return anything.' - identifier: return.void - count: 1 - path: app/cdash/tests/test_builddetails.php - - - - rawMessage: 'Method BuildDetailsTestCase::testViewTestReturnsProperFormat() has no return type specified.' - identifier: missingType.return - count: 1 - path: app/cdash/tests/test_builddetails.php - - - - rawMessage: 'Method BuildDetailsTestCase::testViewTestReturnsProperFormatForParentBuilds() has no return type specified.' - identifier: missingType.return - count: 1 - path: app/cdash/tests/test_builddetails.php - - - - rawMessage: 'Only booleans are allowed in a while condition, array|false|null given.' - identifier: while.condNotBoolean - count: 1 - path: app/cdash/tests/test_builddetails.php - - - - rawMessage: 'Parameter #1 $json of function json_decode expects string, string|false given.' - identifier: argument.type - count: 1 - path: app/cdash/tests/test_builddetails.php - - - - rawMessage: Property BuildDetailsTestCase::$builds has no type specified. - identifier: missingType.property - count: 1 - path: app/cdash/tests/test_builddetails.php - - - - rawMessage: Property BuildDetailsTestCase::$testDataDir has no type specified. - identifier: missingType.property - count: 1 - path: app/cdash/tests/test_builddetails.php - - - - rawMessage: Property BuildDetailsTestCase::$testDataFiles has no type specified. - identifier: missingType.property - count: 1 - path: app/cdash/tests/test_builddetails.php - - rawMessage: ''' Call to deprecated function pdo_fetch_array(): @@ -17907,39 +17379,6 @@ parameters: count: 1 path: app/cdash/tests/test_crosssubprojectcoverage.php - - - rawMessage: ''' - Call to deprecated method prepare() of class CDash\Database: - 04/22/2023 Use Laravel query builder or Eloquent instead - ''' - identifier: method.deprecated - count: 1 - path: app/cdash/tests/test_csvexport.php - - - - rawMessage: Cannot access offset 'id' on mixed. - identifier: offsetAccess.nonOffsetAccessible - count: 1 - path: app/cdash/tests/test_csvexport.php - - - - rawMessage: 'Cannot call method execute() on PDOStatement|false.' - identifier: method.nonObject - count: 1 - path: app/cdash/tests/test_csvexport.php - - - - rawMessage: 'Cannot call method fetch() on PDOStatement|false.' - identifier: method.nonObject - count: 1 - path: app/cdash/tests/test_csvexport.php - - - - rawMessage: 'Part $buildid (mixed) of encapsed string cannot be cast to string.' - identifier: encapsedStringPart.nonString - count: 1 - path: app/cdash/tests/test_csvexport.php - - rawMessage: ''' Call to deprecated method submission() of class KWWebTestCase: @@ -18054,12 +17493,6 @@ parameters: count: 1 path: app/cdash/tests/test_deletesubproject.php - - - rawMessage: 'Argument of an invalid type mixed supplied for foreach, only iterables are supported.' - identifier: foreach.nonIterable - count: 1 - path: app/cdash/tests/test_disabledtests.php - - rawMessage: ''' Call to deprecated method getPdo() of class CDash\Database: @@ -18078,36 +17511,12 @@ parameters: count: 1 path: app/cdash/tests/test_disabledtests.php - - - rawMessage: Cannot access offset 'details' on mixed. - identifier: offsetAccess.nonOffsetAccessible - count: 1 - path: app/cdash/tests/test_disabledtests.php - - rawMessage: Cannot access offset 'id' on mixed. identifier: offsetAccess.nonOffsetAccessible count: 1 path: app/cdash/tests/test_disabledtests.php - - - rawMessage: Cannot access offset 'numFailed' on mixed. - identifier: offsetAccess.nonOffsetAccessible - count: 1 - path: app/cdash/tests/test_disabledtests.php - - - - rawMessage: Cannot access offset 'numNotRun' on mixed. - identifier: offsetAccess.nonOffsetAccessible - count: 1 - path: app/cdash/tests/test_disabledtests.php - - - - rawMessage: Cannot access offset 'tests' on mixed. - identifier: offsetAccess.nonOffsetAccessible - count: 1 - path: app/cdash/tests/test_disabledtests.php - - rawMessage: 'Cannot call method fetch() on PDOStatement|false.' identifier: method.nonObject @@ -18126,12 +17535,6 @@ parameters: count: 2 path: app/cdash/tests/test_disabledtests.php - - - rawMessage: 'Part $buildid (mixed) of encapsed string cannot be cast to string.' - identifier: encapsedStringPart.nonString - count: 1 - path: app/cdash/tests/test_disabledtests.php - - rawMessage: 'Call to deprecated method pass() of class SimpleTestCase.' identifier: method.deprecated @@ -19488,36 +18891,6 @@ parameters: count: 1 path: app/cdash/tests/test_junithandler.php - - - rawMessage: Cannot access offset 'numFailed' on mixed. - identifier: offsetAccess.nonOffsetAccessible - count: 1 - path: app/cdash/tests/test_junithandler.php - - - - rawMessage: Cannot access offset 'numNotRun' on mixed. - identifier: offsetAccess.nonOffsetAccessible - count: 1 - path: app/cdash/tests/test_junithandler.php - - - - rawMessage: Cannot access offset 'numPassed' on mixed. - identifier: offsetAccess.nonOffsetAccessible - count: 1 - path: app/cdash/tests/test_junithandler.php - - - - rawMessage: Cannot access offset 'totaltime' on mixed. - identifier: offsetAccess.nonOffsetAccessible - count: 1 - path: app/cdash/tests/test_junithandler.php - - - - rawMessage: 'Parameter #1 $string of function trim expects string, mixed given.' - identifier: argument.type - count: 1 - path: app/cdash/tests/test_junithandler.php - - rawMessage: Property JUnitHandlerTestCase::$PDO has no type specified. identifier: missingType.property @@ -19608,7 +18981,7 @@ parameters: - rawMessage: 'Argument of an invalid type mixed supplied for foreach, only iterables are supported.' identifier: foreach.nonIterable - count: 5 + count: 3 path: app/cdash/tests/test_managemeasurements.php - @@ -19641,24 +19014,6 @@ parameters: count: 4 path: app/cdash/tests/test_managemeasurements.php - - - rawMessage: Cannot access offset 'columncount' on mixed. - identifier: offsetAccess.nonOffsetAccessible - count: 2 - path: app/cdash/tests/test_managemeasurements.php - - - - rawMessage: Cannot access offset 'columnnames' on mixed. - identifier: offsetAccess.nonOffsetAccessible - count: 6 - path: app/cdash/tests/test_managemeasurements.php - - - - rawMessage: Cannot access offset 'data' on mixed. - identifier: offsetAccess.nonOffsetAccessible - count: 2 - path: app/cdash/tests/test_managemeasurements.php - - rawMessage: Cannot access offset 'extrameasurements' on mixed. identifier: offsetAccess.nonOffsetAccessible @@ -19680,13 +19035,7 @@ parameters: - rawMessage: Cannot access offset 'measurements' on mixed. identifier: offsetAccess.nonOffsetAccessible - count: 4 - path: app/cdash/tests/test_managemeasurements.php - - - - rawMessage: Cannot access offset 'name' on mixed. - identifier: offsetAccess.nonOffsetAccessible - count: 3 + count: 1 path: app/cdash/tests/test_managemeasurements.php - @@ -19704,7 +19053,7 @@ parameters: - rawMessage: Cannot access offset 'procTimeFull' on mixed. identifier: offsetAccess.nonOffsetAccessible - count: 3 + count: 1 path: app/cdash/tests/test_managemeasurements.php - @@ -19719,34 +19068,16 @@ parameters: count: 2 path: app/cdash/tests/test_managemeasurements.php - - - rawMessage: Cannot access offset 'tests' on mixed. - identifier: offsetAccess.nonOffsetAccessible - count: 4 - path: app/cdash/tests/test_managemeasurements.php - - - - rawMessage: Cannot access offset 'y' on mixed. - identifier: offsetAccess.nonOffsetAccessible - count: 1 - path: app/cdash/tests/test_managemeasurements.php - - rawMessage: Cannot access offset 0 on mixed. identifier: offsetAccess.nonOffsetAccessible - count: 9 + count: 2 path: app/cdash/tests/test_managemeasurements.php - rawMessage: Cannot access offset 1 on mixed. identifier: offsetAccess.nonOffsetAccessible - count: 4 - path: app/cdash/tests/test_managemeasurements.php - - - - rawMessage: Cannot access offset 2 on mixed. - identifier: offsetAccess.nonOffsetAccessible - count: 2 + count: 1 path: app/cdash/tests/test_managemeasurements.php - @@ -19767,12 +19098,6 @@ parameters: count: 9 path: app/cdash/tests/test_managemeasurements.php - - - rawMessage: 'Loose comparison via "==" between mixed and mixed is not allowed.' - identifier: equal.notAllowed - count: 1 - path: app/cdash/tests/test_managemeasurements.php - - rawMessage: 'Method ManageMeasurementsTestCase::testManageMeasurements() has no return type specified.' identifier: missingType.return @@ -19833,12 +19158,6 @@ parameters: count: 1 path: app/cdash/tests/test_managemeasurements.php - - - rawMessage: 'Only booleans are allowed in &&, mixed given on the right side.' - identifier: booleanAnd.rightNotBoolean - count: 1 - path: app/cdash/tests/test_managemeasurements.php - - rawMessage: 'Parameter #1 $array of function array_pop expects array, mixed given.' identifier: argument.type @@ -19848,7 +19167,7 @@ parameters: - rawMessage: 'Parameter #1 $value of function count expects array|Countable, mixed given.' identifier: argument.type - count: 5 + count: 2 path: app/cdash/tests/test_managemeasurements.php - @@ -19863,12 +19182,6 @@ parameters: count: 2 path: app/cdash/tests/test_managemeasurements.php - - - rawMessage: 'Part $selected_test_name (mixed) of encapsed string cannot be cast to string.' - identifier: encapsedStringPart.nonString - count: 1 - path: app/cdash/tests/test_managemeasurements.php - - rawMessage: Property ManageMeasurementsTestCase::$BuildId has no type specified. identifier: missingType.property @@ -19905,18 +19218,6 @@ parameters: count: 1 path: app/cdash/tests/test_managemeasurements.php - - - rawMessage: Variable $selected_nprocs might not be defined. - identifier: variable.undefined - count: 1 - path: app/cdash/tests/test_managemeasurements.php - - - - rawMessage: Variable $selected_test_name might not be defined. - identifier: variable.undefined - count: 1 - path: app/cdash/tests/test_managemeasurements.php - - rawMessage: ''' Call to deprecated method submission() of class KWWebTestCase: @@ -20073,36 +19374,12 @@ parameters: count: 1 path: app/cdash/tests/test_multiplelabelsfortests.php - - - rawMessage: Cannot access offset 'labels' on mixed. - identifier: offsetAccess.nonOffsetAccessible - count: 1 - path: app/cdash/tests/test_multiplelabelsfortests.php - - - - rawMessage: Cannot access offset 'tests' on mixed. - identifier: offsetAccess.nonOffsetAccessible - count: 1 - path: app/cdash/tests/test_multiplelabelsfortests.php - - - - rawMessage: Cannot access offset 0 on mixed. - identifier: offsetAccess.nonOffsetAccessible - count: 1 - path: app/cdash/tests/test_multiplelabelsfortests.php - - rawMessage: 'Cannot call method labels() on App\Models\Test|null.' identifier: method.nonObject count: 1 path: app/cdash/tests/test_multiplelabelsfortests.php - - - rawMessage: 'Parameter #1 $value of function count expects array|Countable, mixed given.' - identifier: argument.type - count: 1 - path: app/cdash/tests/test_multiplelabelsfortests.php - - rawMessage: 'Argument of an invalid type mixed supplied for foreach, only iterables are supported.' identifier: foreach.nonIterable @@ -21465,12 +20742,6 @@ parameters: count: 1 path: app/cdash/tests/test_recoverpassword.php - - - rawMessage: 'Argument of an invalid type mixed supplied for foreach, only iterables are supported.' - identifier: foreach.nonIterable - count: 1 - path: app/cdash/tests/test_redundanttests.php - - rawMessage: ''' Call to deprecated method submission() of class KWWebTestCase: @@ -21480,30 +20751,6 @@ parameters: count: 1 path: app/cdash/tests/test_redundanttests.php - - - rawMessage: Cannot access offset 'measurements' on mixed. - identifier: offsetAccess.nonOffsetAccessible - count: 2 - path: app/cdash/tests/test_redundanttests.php - - - - rawMessage: Cannot access offset 'tests' on mixed. - identifier: offsetAccess.nonOffsetAccessible - count: 2 - path: app/cdash/tests/test_redundanttests.php - - - - rawMessage: Cannot access offset 0 on mixed. - identifier: offsetAccess.nonOffsetAccessible - count: 1 - path: app/cdash/tests/test_redundanttests.php - - - - rawMessage: 'Parameter #1 $value of function count expects array|Countable, mixed given.' - identifier: argument.type - count: 1 - path: app/cdash/tests/test_redundanttests.php - - rawMessage: 'Parameter #1 $string of function base64_encode expects string, string|false given.' identifier: argument.type @@ -22011,126 +21258,6 @@ parameters: count: 1 path: app/cdash/tests/test_subprojectorder.php - - - rawMessage: 'Argument of an invalid type mixed supplied for foreach, only iterables are supported.' - identifier: foreach.nonIterable - count: 2 - path: app/cdash/tests/test_subprojecttestfilters.php - - - - rawMessage: Cannot access offset 'buildgroups' on mixed. - identifier: offsetAccess.nonOffsetAccessible - count: 2 - path: app/cdash/tests/test_subprojecttestfilters.php - - - - rawMessage: Cannot access offset 'builds' on mixed. - identifier: offsetAccess.nonOffsetAccessible - count: 4 - path: app/cdash/tests/test_subprojecttestfilters.php - - - - rawMessage: Cannot access offset 'fail' on mixed. - identifier: offsetAccess.nonOffsetAccessible - count: 2 - path: app/cdash/tests/test_subprojecttestfilters.php - - - - rawMessage: Cannot access offset 'id' on mixed. - identifier: offsetAccess.nonOffsetAccessible - count: 3 - path: app/cdash/tests/test_subprojecttestfilters.php - - - - rawMessage: Cannot access offset 'notrun' on mixed. - identifier: offsetAccess.nonOffsetAccessible - count: 2 - path: app/cdash/tests/test_subprojecttestfilters.php - - - - rawMessage: Cannot access offset 'numFailed' on mixed. - identifier: offsetAccess.nonOffsetAccessible - count: 2 - path: app/cdash/tests/test_subprojecttestfilters.php - - - - rawMessage: Cannot access offset 'numNotRun' on mixed. - identifier: offsetAccess.nonOffsetAccessible - count: 2 - path: app/cdash/tests/test_subprojecttestfilters.php - - - - rawMessage: Cannot access offset 'numPassed' on mixed. - identifier: offsetAccess.nonOffsetAccessible - count: 2 - path: app/cdash/tests/test_subprojecttestfilters.php - - - - rawMessage: Cannot access offset 'pass' on mixed. - identifier: offsetAccess.nonOffsetAccessible - count: 2 - path: app/cdash/tests/test_subprojecttestfilters.php - - - - rawMessage: Cannot access offset 'subprojectname' on mixed. - identifier: offsetAccess.nonOffsetAccessible - count: 3 - path: app/cdash/tests/test_subprojecttestfilters.php - - - - rawMessage: Cannot access offset 'test' on mixed. - identifier: offsetAccess.nonOffsetAccessible - count: 6 - path: app/cdash/tests/test_subprojecttestfilters.php - - - - rawMessage: Cannot access offset 'testfilters' on mixed. - identifier: offsetAccess.nonOffsetAccessible - count: 3 - path: app/cdash/tests/test_subprojecttestfilters.php - - - - rawMessage: Cannot access offset 'tests' on mixed. - identifier: offsetAccess.nonOffsetAccessible - count: 2 - path: app/cdash/tests/test_subprojecttestfilters.php - - - - rawMessage: Cannot access offset 0 on mixed. - identifier: offsetAccess.nonOffsetAccessible - count: 2 - path: app/cdash/tests/test_subprojecttestfilters.php - - - - rawMessage: 'Parameter #1 $array of function array_pop expects array, mixed given.' - identifier: argument.type - count: 2 - path: app/cdash/tests/test_subprojecttestfilters.php - - - - rawMessage: 'Parameter #1 $value of function count expects array|Countable, mixed given.' - identifier: argument.type - count: 2 - path: app/cdash/tests/test_subprojecttestfilters.php - - - - rawMessage: 'Part $build[''id''] (mixed) of encapsed string cannot be cast to string.' - identifier: encapsedStringPart.nonString - count: 3 - path: app/cdash/tests/test_subprojecttestfilters.php - - - - rawMessage: 'Part $test[''subprojectname''] (mixed) of encapsed string cannot be cast to string.' - identifier: encapsedStringPart.nonString - count: 1 - path: app/cdash/tests/test_subprojecttestfilters.php - - - - rawMessage: 'Part $testfilters (mixed) of encapsed string cannot be cast to string.' - identifier: encapsedStringPart.nonString - count: 2 - path: app/cdash/tests/test_subprojecttestfilters.php - - rawMessage: ''' Call to deprecated method submission() of class KWWebTestCase: @@ -22218,12 +21345,6 @@ parameters: count: 1 path: app/cdash/tests/test_testgraphpermissions.php - - - rawMessage: 'Argument of an invalid type mixed supplied for foreach, only iterables are supported.' - identifier: foreach.nonIterable - count: 1 - path: app/cdash/tests/test_testhistory.php - - rawMessage: ''' Call to deprecated method submission() of class KWWebTestCase: @@ -22245,30 +21366,12 @@ parameters: count: 17 path: app/cdash/tests/test_testhistory.php - - - rawMessage: Cannot access offset 'history' on mixed. - identifier: offsetAccess.nonOffsetAccessible - count: 1 - path: app/cdash/tests/test_testhistory.php - - rawMessage: Cannot access offset 'label' on mixed. identifier: offsetAccess.nonOffsetAccessible count: 4 path: app/cdash/tests/test_testhistory.php - - - rawMessage: Cannot access offset 'name' on mixed. - identifier: offsetAccess.nonOffsetAccessible - count: 2 - path: app/cdash/tests/test_testhistory.php - - - - rawMessage: Cannot access offset 'tests' on mixed. - identifier: offsetAccess.nonOffsetAccessible - count: 1 - path: app/cdash/tests/test_testhistory.php - - rawMessage: Cannot access offset 'y' on mixed. identifier: offsetAccess.nonOffsetAccessible @@ -22305,12 +21408,6 @@ parameters: count: 2 path: app/cdash/tests/test_testhistory.php - - - rawMessage: Left side of && is always true. - identifier: booleanAnd.leftAlwaysTrue - count: 2 - path: app/cdash/tests/test_testhistory.php - - rawMessage: 'Method TestHistoryTestCase::generateXML() has no return type specified.' identifier: missingType.return @@ -22341,12 +21438,6 @@ parameters: count: 1 path: app/cdash/tests/test_testhistory.php - - - rawMessage: 'Only booleans are allowed in &&, string given on the left side.' - identifier: booleanAnd.leftNotBoolean - count: 2 - path: app/cdash/tests/test_testhistory.php - - rawMessage: 'Only booleans are allowed in a negated boolean, int given.' identifier: booleanNot.exprNotBoolean @@ -22359,18 +21450,6 @@ parameters: count: 2 path: app/cdash/tests/test_testhistory.php - - - rawMessage: 'Part $history (mixed) of encapsed string cannot be cast to string.' - identifier: encapsedStringPart.nonString - count: 5 - path: app/cdash/tests/test_testhistory.php - - - - rawMessage: 'Part $test[''name''] (mixed) of encapsed string cannot be cast to string.' - identifier: encapsedStringPart.nonString - count: 1 - path: app/cdash/tests/test_testhistory.php - - rawMessage: Property TestHistoryTestCase::$project has no type specified. identifier: missingType.property @@ -22572,12 +21651,6 @@ parameters: count: 1 path: app/cdash/tests/test_timeline.php - - - rawMessage: 'Argument of an invalid type mixed supplied for foreach, only iterables are supported.' - identifier: foreach.nonIterable - count: 1 - path: app/cdash/tests/test_timeoutsandmissingtests.php - - rawMessage: 'Call to deprecated method pass() of class SimpleTestCase.' identifier: method.deprecated @@ -22594,44 +21667,14 @@ parameters: path: app/cdash/tests/test_timeoutsandmissingtests.php - - rawMessage: Cannot access offset 'name' on mixed. - identifier: offsetAccess.nonOffsetAccessible - count: 1 - path: app/cdash/tests/test_timeoutsandmissingtests.php - - - - rawMessage: Cannot access offset 'numMissing' on mixed. - identifier: offsetAccess.nonOffsetAccessible - count: 1 - path: app/cdash/tests/test_timeoutsandmissingtests.php - - - - rawMessage: Cannot access offset 'status' on mixed. - identifier: offsetAccess.nonOffsetAccessible - count: 7 - path: app/cdash/tests/test_timeoutsandmissingtests.php - - - - rawMessage: Cannot access offset 'tests' on mixed. - identifier: offsetAccess.nonOffsetAccessible - count: 1 - path: app/cdash/tests/test_timeoutsandmissingtests.php - - - - rawMessage: 'Method TimeoutsAndMissingTestsTestCase::getLastBuildId() has no return type specified.' - identifier: missingType.return - count: 1 - path: app/cdash/tests/test_timeoutsandmissingtests.php - - - - rawMessage: Possibly invalid array key type mixed. - identifier: offsetAccess.invalidOffset + rawMessage: Property TimeoutsAndMissingTestsTestCase::$buildName has no type specified. + identifier: missingType.property count: 1 path: app/cdash/tests/test_timeoutsandmissingtests.php - - rawMessage: Property TimeoutsAndMissingTestsTestCase::$buildName has no type specified. - identifier: missingType.property + rawMessage: 'Property TimeoutsAndMissingTestsTestCase::$buildName is never read, only written.' + identifier: property.onlyWritten count: 1 path: app/cdash/tests/test_timeoutsandmissingtests.php diff --git a/routes/api.php b/routes/api.php index bff0781b05..738508f94e 100755 --- a/routes/api.php +++ b/routes/api.php @@ -15,8 +15,6 @@ // NOTE: All routes listed in this file will be prefixed with /api -Route::get('/v1/viewTest.php', 'ViewTestController@fetchPageContent'); - Route::get('/v1/testDetails.php', 'TestDetailsController@apiTestDetails'); Route::match(['get', 'post', 'delete'], '/v1/build.php', 'BuildController@restApi'); diff --git a/tests/cypress/e2e/manage-build-group.cy.js b/tests/cypress/e2e/manage-build-group.cy.js index 58154bc5de..d4bd86b742 100644 --- a/tests/cypress/e2e/manage-build-group.cy.js +++ b/tests/cypress/e2e/manage-build-group.cy.js @@ -51,7 +51,7 @@ describe('manageBuildGroup', () => { // switch project from the drop down at the top of the page cy.get('select[name="projectSelection"]').select('TestHistory'); - cy.url().should('contain', 'manageBuildGroup.php?projectid=14'); + cy.url().should('contain', 'manageBuildGroup.php?projectid=13'); // switch back to original project cy.get('select[name="projectSelection"]').select('InsightExample'); diff --git a/tests/cypress/e2e/manage-sub-project.cy.js b/tests/cypress/e2e/manage-sub-project.cy.js index 797b2a25e1..519eb19131 100644 --- a/tests/cypress/e2e/manage-sub-project.cy.js +++ b/tests/cypress/e2e/manage-sub-project.cy.js @@ -16,7 +16,7 @@ describe('manageSubProject', () => { // switch project from the drop down at the top of the page cy.get('select[name="projectSelection"]').select('TestHistory'); - cy.url().should('contain', 'manageSubProject.php?projectid=14'); + cy.url().should('contain', 'manageSubProject.php?projectid=13'); // switch back to original project cy.get('select[name="projectSelection"]').select('Trilinos'); diff --git a/tests/cypress/e2e/sub-project-group-order.cy.js b/tests/cypress/e2e/sub-project-group-order.cy.js index 3dfc29f095..d1877c4fb7 100644 --- a/tests/cypress/e2e/sub-project-group-order.cy.js +++ b/tests/cypress/e2e/sub-project-group-order.cy.js @@ -2,7 +2,7 @@ describe('subProjectGroupOrder', () => { it('can change the group order', () => { cy.login(); - cy.visit('manageSubProject.php?projectid=15'); + cy.visit('manageSubProject.php?projectid=14'); // navigate to the 'SubProjects Groups' tab cy.get('[data-test="subproject-groups"]').click(); @@ -34,13 +34,13 @@ describe('subProjectGroupOrder', () => { // cy.get('#sortable').find('tr').first().find('input[name="group_name"]').should('contain', 'Production'); // navigate to our example of coverage across groups - cy.visit('index.php?project=CrossSubProjectExample&parentid=121'); + cy.visit('index.php?project=CrossSubProjectExample&parentid=124'); // make sure that Production is the first group listed after Total cy.get('#coveragetable').find('tbody').eq(1).should('contain', 'Production'); // this page has some cursed html // restore group order - cy.visit('manageSubProject.php?projectid=15'); + cy.visit('manageSubProject.php?projectid=14'); cy.get('a').contains('SubProject Groups').click(); // cy.get('tbody#sortable').contains('tr', 'Production').as('prod_group_tr'); // TODO: (sbelsk) this too cy.get('tbody#sortable').find('tr').first().find('td').eq(1).as('prod_group_tr'); @@ -58,7 +58,7 @@ describe('subProjectGroupOrder', () => { cy.get('@save_order_button').click(); // verify that we restored it - cy.visit('index.php?project=CrossSubProjectExample&parentid=121'); + cy.visit('index.php?project=CrossSubProjectExample&parentid=124'); cy.get('#coveragetable').find('tbody').eq(3).should('contain', 'Production'); }); });