Пример #1
0
 public static function regenerate_graphs($result_file_identifier, $full_process_string = false, $extra_graph_attributes = null)
 {
     $save_to_dir = pts_client::setup_test_result_directory($result_file_identifier);
     $generated_graphs = pts_client::generate_result_file_graphs($result_file_identifier, $save_to_dir, $extra_graph_attributes);
     $generated = count($generated_graphs) > 0;
     if ($generated && $full_process_string) {
         echo PHP_EOL . $full_process_string . PHP_EOL;
         pts_client::display_web_page(PTS_SAVE_RESULTS_PATH . $result_file_identifier . '/index.html');
     }
     return $generated;
 }
 public function pre_execution_process()
 {
     if ($this->do_save_results()) {
         if ($this->is_new_result_file || $this->result_already_contains_identifier() == false) {
             $this->result_file->set_title($this->file_name_title);
             $this->result_file->set_description($this->run_description);
             $this->result_file->set_notes($this->get_notes());
             $this->result_file->set_internal_tags($this->get_internal_tags());
             $this->result_file->set_reference_id($this->get_reference_id());
             $this->result_file->set_preset_environment_variables($this->get_preset_environment_variables());
             // TODO XXX JSON In null and notes
             $sys = new pts_result_file_system($this->results_identifier, phodevi::system_hardware(true), phodevi::system_software(true), $this->generate_json_system_attributes(), pts_client::current_user(), pts_test_notes_manager::generate_test_notes($this->tests_to_run), date('Y-m-d H:i:s'), PTS_VERSION);
             $this->result_file->add_system($sys);
         }
         pts_client::setup_test_result_directory($this->get_file_name());
     }
 }
 public function pre_execution_process()
 {
     if ($this->do_save_results()) {
         $this->result_file_writer = new pts_result_file_writer($this->get_results_identifier());
         if (pts_c::$test_flags ^ pts_c::is_recovering && (!pts_result_file::is_test_result_file($this->get_file_name()) || $this->result_already_contains_identifier() == false)) {
             $this->result_file_writer->add_result_file_meta_data($this);
             $this->result_file_writer->add_current_system_information();
         }
         pts_client::setup_test_result_directory($this->get_file_name());
     }
 }
 public static function clone_openbenchmarking_result(&$id, $return_xml = false)
 {
     if (!pts_network::internet_support_available()) {
         return false;
     }
     $json_response = pts_openbenchmarking::make_openbenchmarking_request('clone_openbenchmarking_result', array('i' => $id));
     $json_response = json_decode($json_response, true);
     $valid = false;
     if (is_array($json_response) && isset($json_response['openbenchmarking']['result']['composite_xml'])) {
         $composite_xml = $json_response['openbenchmarking']['result']['composite_xml'];
         $result_file = new pts_result_file($composite_xml);
         $result_file_writer = new pts_result_file_writer();
         $result_file_writer->add_result_file_meta_data($result_file, $id);
         $result_file_writer->add_system_information_from_result_file($result_file);
         $result_file_writer->add_results_from_result_file($result_file);
         //$id = strtolower($id);
         $valid = $return_xml ? $result_file_writer->get_xml() : pts_client::save_test_result($id . '/composite.xml', $result_file_writer->get_xml(), true);
         if (PTS_IS_CLIENT && $json_response['openbenchmarking']['result']['system_logs_available']) {
             // Fetch the system logs and toss them into the results directory system-logs/
             pts_openbenchmarking::clone_openbenchmarking_result_system_logs($id, pts_client::setup_test_result_directory($id), $json_response['openbenchmarking']['result']['system_logs_available']);
         }
     } else {
         if (PTS_IS_CLIENT && isset($json_response['openbenchmarking']['result']['error'])) {
             trigger_error($json_response['openbenchmarking']['result']['error'], E_USER_ERROR);
         }
     }
     return $valid;
 }
 public function pre_execution_process()
 {
     if ($this->do_save_results()) {
         if ($this->is_new_result_file || $this->result_already_contains_identifier() == false) {
             $this->result_file->set_title($this->file_name_title);
             $this->result_file->set_description($this->run_description);
             $this->result_file->set_notes($this->get_notes());
             $this->result_file->set_internal_tags($this->get_internal_tags());
             $this->result_file->set_reference_id($this->get_reference_id());
             $this->result_file->set_preset_environment_variables($this->get_preset_environment_variables());
         }
         pts_client::setup_test_result_directory($this->get_file_name());
     }
 }