From 840eb46d03d01ab9f956cb2a130968c8663f53f6 Mon Sep 17 00:00:00 2001 From: Andrew Gallagher Date: Tue, 10 Jan 2012 16:32:49 -0800 Subject: [PATCH] Match unittest results by name or file Summary: Just talked to @tuomaspelkonen, and turns out there is a case where postponed tests results use the filepath for both the name and file parameters. Then, after the tests have completed, the unittest results are updated with the class name as the test name. To handle this, this diff matches the stored unittest results name against either the name or file component of the updated unittest info. Not sure of great way to generally handle these situations. Perhaps, long term, we can just use a placeholder unittest result, mark that as passed (or delete it?) then add a new test result with the correct name. Test Plan: updated unittest result with new name (but file was the same). Reviewers: epriestley, tuomaspelkonen Reviewed By: epriestley CC: aran, epriestley, andrewjcg Differential Revision: https://secure.phabricator.com/D1356 --- .../ConduitAPI_differential_updateunitresults_Method.php | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/applications/conduit/method/differential/updateunitresults/ConduitAPI_differential_updateunitresults_Method.php b/src/applications/conduit/method/differential/updateunitresults/ConduitAPI_differential_updateunitresults_Method.php index 01f0f1fa9c..bc6c12daf8 100644 --- a/src/applications/conduit/method/differential/updateunitresults/ConduitAPI_differential_updateunitresults_Method.php +++ b/src/applications/conduit/method/differential/updateunitresults/ConduitAPI_differential_updateunitresults_Method.php @@ -77,7 +77,9 @@ extends ConduitAPIMethod { // If the test result already exists, then update it with // the new info. foreach ($unit_results as &$unit_result) { - if ($unit_result['name'] === $name) { + if ($unit_result['name'] === $name || + $unit_result['name'] === $file) { + $unit_result['name'] = $name; $unit_result['file'] = $file; $unit_result['result'] = $result; $unit_result['userdata'] = $message;