diff --git a/pts-core/objects/pts_test_profile.php b/pts-core/objects/pts_test_profile.php index b65b68b1d9..82a4531205 100644 --- a/pts-core/objects/pts_test_profile.php +++ b/pts-core/objects/pts_test_profile.php @@ -611,7 +611,8 @@ public function get_results_definition($limit = null) $dob = isset($i->DeleteOutputBefore) ? $i->DeleteOutputBefore->__toString() : null; $doa = isset($i->DeleteOutputAfter) ? $i->DeleteOutputAfter->__toString() : null; $df = isset($i->DisplayFormat) ? $i->DisplayFormat->__toString() : null; - $results_definition->add_result_parser_definition($ot, $mtta, $rk, $lh, $lbh, $lah, $rbs, $ras, $sfr, $srp, $mm, $drb, $mrb, $rs, $rpro, $rpre, $ad, $atad, $ff, $tcts, $dob, $doa, $df, $drd); + $ri = isset($i->Importance) ? $i->Importance->__toString() : null; + $results_definition->add_result_parser_definition($ot, $mtta, $rk, $lh, $lbh, $lah, $rbs, $ras, $sfr, $srp, $mm, $drb, $mrb, $rs, $rpro, $rpre, $ad, $atad, $ff, $tcts, $dob, $doa, $df, $drd, $ri); } } } diff --git a/pts-core/objects/pts_test_profile_results_definition.php b/pts-core/objects/pts_test_profile_results_definition.php index 2a8532880d..96703ff79f 100644 --- a/pts-core/objects/pts_test_profile_results_definition.php +++ b/pts-core/objects/pts_test_profile_results_definition.php @@ -58,9 +58,9 @@ public function get_image_parser_definitions() { return $this->image_parsers; } - public function add_result_parser_definition($ot, $mtta, $rk, $lh, $lbh, $lah, $rbs, $ras, $sfr, $srp, $mm, $drb, $mrb, $rs, $rpro, $rpre, $ad, $atad, $ff, $tcts, $dob, $doa, $df, $drd) + public function add_result_parser_definition($ot, $mtta, $rk, $lh, $lbh, $lah, $rbs, $ras, $sfr, $srp, $mm, $drb, $mrb, $rs, $rpro, $rpre, $ad, $atad, $ff, $tcts, $dob, $doa, $df, $drd, $ri) { - $this->result_parsers[] = new pts_test_profile_results_definition_result_parser($ot, $mtta, $rk, $lh, $lbh, $lah, $rbs, $ras, $sfr, $srp, $mm, $drb, $mrb, $rs, $rpro, $rpre, $ad, $atad, $ff, $tcts, $dob, $doa, $df, $drd); + $this->result_parsers[] = new pts_test_profile_results_definition_result_parser($ot, $mtta, $rk, $lh, $lbh, $lah, $rbs, $ras, $sfr, $srp, $mm, $drb, $mrb, $rs, $rpro, $rpre, $ad, $atad, $ff, $tcts, $dob, $doa, $df, $drd, $ri); } public function get_result_parser_definitions() { @@ -174,8 +174,9 @@ class pts_test_profile_results_definition_result_parser private $delete_output_before; private $delete_output_after; private $display_format; + private $result_importance; - public function __construct($ot, $mtta, $rk, $lh, $lbh, $lah, $rbs, $ras, $sfr, $srp, $mm, $drb, $mrb, $rs, $rpro, $rpre, $ad, $atad, $ff, $tcts, $dob, $doa, $df, $drd) + public function __construct($ot, $mtta, $rk, $lh, $lbh, $lah, $rbs, $ras, $sfr, $srp, $mm, $drb, $mrb, $rs, $rpro, $rpre, $ad, $atad, $ff, $tcts, $dob, $doa, $df, $drd, $ri) { $this->output_template = $ot; $this->match_to_test_args = $mtta; @@ -201,6 +202,7 @@ public function __construct($ot, $mtta, $rk, $lh, $lbh, $lah, $rbs, $ras, $sfr, $this->delete_output_before = $dob; $this->delete_output_after = $doa; $this->display_format = $df; + $this->result_importance = $ri; } public function get_output_template() { @@ -294,6 +296,10 @@ public function get_delete_output_after() { return $this->delete_output_after; } + public function get_result_importance() + { + return $this->result_importance; + } public function get_display_format() { return $this->display_format; diff --git a/pts-core/objects/pts_test_result_parser.php b/pts-core/objects/pts_test_result_parser.php index 6792afac83..3cdb7bb1fb 100644 --- a/pts-core/objects/pts_test_result_parser.php +++ b/pts-core/objects/pts_test_result_parser.php @@ -450,6 +450,7 @@ protected static function parse_result_process(&$test_run_request, $log_file, $p $definitions = $test_run_request->test_profile->get_results_definition('ResultsParser'); $all_parser_entries = $definitions->get_result_parser_definitions(); $avoid_duplicates = array(); + $primary_result = null; foreach($all_parser_entries as $entry) { $tr = clone $test_run_request; @@ -463,7 +464,7 @@ protected static function parse_result_process(&$test_run_request, $log_file, $p $max_result = null; $min_test_result = false; $max_test_result = false; - $test_result = self::parse_result_process_entry($tr, $log_file, $pts_test_arguments, $extra_arguments, $prefix, $entry, $is_pass_fail_test, $is_numeric_check, $all_parser_entries, $min_test_result, $max_test_result); + $test_result = self::parse_result_process_entry($tr, $log_file, $pts_test_arguments, $extra_arguments, $prefix, $entry, $is_pass_fail_test, $is_numeric_check, $all_parser_entries, $min_test_result, $max_test_result, $primary_result); if($test_result != false) { // Result found @@ -482,12 +483,16 @@ protected static function parse_result_process(&$test_run_request, $log_file, $p } self::gen_result_active_handle($test_run_request, $tr)->add_trial_run_result($test_result, $min_result, $max_result); $produced_result = true; + if($primary_result == null) + { + $primary_result = $tr; + } } } return $produced_result; } - protected static function parse_result_process_entry(&$test_run_request, $log_file, $pts_test_arguments, $extra_arguments, $prefix, &$e, $is_pass_fail_test, $is_numeric_check, &$all_parser_entries, &$min_test_result = false, &$max_test_result = false) + protected static function parse_result_process_entry(&$test_run_request, $log_file, $pts_test_arguments, $extra_arguments, $prefix, &$e, $is_pass_fail_test, $is_numeric_check, &$all_parser_entries, &$min_test_result = false, &$max_test_result = false, $primary_result = null) { $test_result = false; $match_test_arguments = $e->get_match_to_test_args(); @@ -904,6 +909,10 @@ protected static function parse_result_process_entry(&$test_run_request, $log_fi { $test_run_request->set_used_arguments_description($e->get_arguments_description()); } + if($e->get_result_importance() != null && strtolower($e->get_result_importance()) == 'secondary' && !empty($primary_result)) + { + $test_run_request->set_parent_hash_from_result($primary_result); + } if($e->get_append_to_arguments_description() != null) { foreach($all_parser_entries as $parser_entry) diff --git a/pts-core/openbenchmarking.org/schemas/results-parser.xsd b/pts-core/openbenchmarking.org/schemas/results-parser.xsd index f8d1d1c883..6826bf854f 100644 --- a/pts-core/openbenchmarking.org/schemas/results-parser.xsd +++ b/pts-core/openbenchmarking.org/schemas/results-parser.xsd @@ -270,6 +270,16 @@ If wishing to trim the log file that will be parsed for the test result, a unique string can be specified here and the result parser will drop any text after the match. + + + + get_result_importance + + + + If the result is less important, the Importance can be set to 'Secondary' to indicate it is of less importance / subordinate to other result metrics. Otherwise it's assumed to be a 'Primary' result. This can affect how 'secondary' results are shown on the result viewer such as behind a tabbed view or shown in a smaller manner than the main results. + +