Allow unit test duration to be submitted as a float or an int
Summary: Fixes T8736. It's OK for duration to be something that comes out of JSON as an int, like `1`. Test Plan: Will make @hach-que verify. Reviewers: btrahan Reviewed By: btrahan Subscribers: epriestley, hach-que Maniphest Tasks: T8736 Differential Revision: https://secure.phabricator.com/D13531
This commit is contained in:
@@ -30,7 +30,7 @@ final class HarbormasterBuildUnitMessage
|
|||||||
'namespace' => 'optional string',
|
'namespace' => 'optional string',
|
||||||
'name' => 'string',
|
'name' => 'string',
|
||||||
'result' => 'string',
|
'result' => 'string',
|
||||||
'duration' => 'optional float',
|
'duration' => 'optional float|int',
|
||||||
'path' => 'optional string',
|
'path' => 'optional string',
|
||||||
'coverage' => 'optional map<string, wild>',
|
'coverage' => 'optional map<string, wild>',
|
||||||
);
|
);
|
||||||
@@ -44,7 +44,7 @@ final class HarbormasterBuildUnitMessage
|
|||||||
$obj->setNamespace(idx($dict, 'namespace', ''));
|
$obj->setNamespace(idx($dict, 'namespace', ''));
|
||||||
$obj->setName($dict['name']);
|
$obj->setName($dict['name']);
|
||||||
$obj->setResult($dict['result']);
|
$obj->setResult($dict['result']);
|
||||||
$obj->setDuration(idx($dict, 'duration'));
|
$obj->setDuration((float)idx($dict, 'duration'));
|
||||||
|
|
||||||
$path = idx($dict, 'path');
|
$path = idx($dict, 'path');
|
||||||
if (strlen($path)) {
|
if (strlen($path)) {
|
||||||
|
|||||||
Reference in New Issue
Block a user