Skip to content

Commit 2803ef1

Browse files
Remove unused /api/v1/computeClassifier.php endpoint (Kitware#3604)
This endpoint is no longer used, and exposes no useful information. The entire operation can be done from the client side.
1 parent 4e752b3 commit 2803ef1

3 files changed

Lines changed: 1 addition & 432 deletions

File tree

app/cdash/public/api/v1/computeClassifier.php

Lines changed: 0 additions & 186 deletions
This file was deleted.

app/cdash/tests/test_buildproperties.php

Lines changed: 0 additions & 47 deletions
Original file line numberDiff line numberDiff line change
@@ -133,53 +133,6 @@ public function testListDefects(): void
133133
}
134134
}
135135

136-
public function testComputeClassifiers(): void
137-
{
138-
$this->get($this->url . '/api/v1/buildProperties.php?project=' . $this->Project->name . '&begin=2017-05-26&end=2017-05-29');
139-
$content = $this->getBrowser()->getContent();
140-
$jsonobj = json_decode($content, true);
141-
$builds = [];
142-
foreach ($jsonobj['builds'] as $build) {
143-
if ($build['testfailed'] > 0) {
144-
$build['success'] = false;
145-
} else {
146-
$build['success'] = true;
147-
}
148-
$builds[] = json_encode($build);
149-
}
150-
151-
$query_string = http_build_query(['builds' => $builds]);
152-
$this->get($this->url . "/api/v1/computeClassifier.php?$query_string");
153-
$content = $this->getBrowser()->getContent();
154-
$jsonobj = json_decode($content, true);
155-
$num_classifiers = count($jsonobj);
156-
if ($num_classifiers !== 3) {
157-
$this->fail("Expected 3 classifiers, found $num_classifiers");
158-
}
159-
foreach ($jsonobj as $entry) {
160-
$classifier = $entry['classifier'];
161-
$found = $entry['accuracy'];
162-
$expected = 0;
163-
switch ($classifier) {
164-
case 'debug == true':
165-
$expected = 77.8;
166-
break;
167-
case 'debug == false':
168-
$expected = 77.8;
169-
break;
170-
case 'buildtime > 7.02':
171-
$expected = 100;
172-
break;
173-
default:
174-
$this->fail("Unexpected classifier $classifier");
175-
break;
176-
}
177-
if ($found != $expected) {
178-
$this->fail("Expected $expected but found $found for $classifier");
179-
}
180-
}
181-
}
182-
183136
private function create_build($buildname, $filename, $date, $md5): void
184137
{
185138
$timestamp = strtotime($date);

0 commit comments

Comments
 (0)