1
0
Fork 0
mirror of https://we.phorge.it/source/phorge.git synced 2024-12-20 20:40:56 +01:00

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
This commit is contained in:
Andrew Gallagher 2012-01-10 16:32:49 -08:00
parent 48f53ba095
commit 840eb46d03

View file

@ -77,7 +77,9 @@ extends ConduitAPIMethod {
// If the test result already exists, then update it with // If the test result already exists, then update it with
// the new info. // the new info.
foreach ($unit_results as &$unit_result) { 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['file'] = $file;
$unit_result['result'] = $result; $unit_result['result'] = $result;
$unit_result['userdata'] = $message; $unit_result['userdata'] = $message;