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',
|
||||
'name' => 'string',
|
||||
'result' => 'string',
|
||||
'duration' => 'optional float',
|
||||
'duration' => 'optional float|int',
|
||||
'path' => 'optional string',
|
||||
'coverage' => 'optional map<string, wild>',
|
||||
);
|
||||
@@ -44,7 +44,7 @@ final class HarbormasterBuildUnitMessage
|
||||
$obj->setNamespace(idx($dict, 'namespace', ''));
|
||||
$obj->setName($dict['name']);
|
||||
$obj->setResult($dict['result']);
|
||||
$obj->setDuration(idx($dict, 'duration'));
|
||||
$obj->setDuration((float)idx($dict, 'duration'));
|
||||
|
||||
$path = idx($dict, 'path');
|
||||
if (strlen($path)) {
|
||||
|
||||
Reference in New Issue
Block a user