public static function __event_run_error($error_obj) { list($test_run_manager, $test_run_request, $error_msg) = $error_obj; if (stripos('Download Failed', $error_msg) !== false || stripos('check-sum of the downloaded file failed', $error_msg) !== false || stripos('attempting', $error_msg) !== false) { return false; } $server_response = phoromatic::upload_to_remote_server(array('r' => 'error_report', 'sched' => self::$p_schedule_id, 'ts' => self::$p_trigger_id, 'err' => $error_msg, 'ti' => $test_run_request->test_profile->get_identifier(), 'o' => $test_run_request->get_arguments_description())); //pts_client::$pts_logger && pts_client::$pts_logger->log('TEMP DEBUG MESSAGE: ' . $server_response); }
protected static function upload_unscheduled_test_results($save_identifier) { $composite_xml = file_get_contents(PTS_SAVE_RESULTS_PATH . $save_identifier . '/composite.xml'); $logs = self::capture_test_logs($save_identifier); $server_response = phoromatic::upload_to_remote_server(array('r' => 'upload_test_results_unscheduled', 'c' => $composite_xml, 'i' => 0, 'ti' => 'Unknown', 'sl' => $logs['system-logs'], 'tl' => $logs['test-logs'])); $xml_parser = new nye_XmlReader($server_response); switch ($xml_parser->getXMLValue(M_PHOROMATIC_GEN_RESPONSE)) { case M_PHOROMATIC_RESPONSE_TRUE: echo PHP_EOL . 'Uploaded To Phoromatic.' . PHP_EOL; break; case M_PHOROMATIC_RESPONSE_ERROR: echo PHP_EOL . 'An Error Occurred.' . PHP_EOL; break; case M_PHOROMATIC_RESPONSE_SETTING_DISABLED: echo PHP_EOL . 'You need to enable this support from your Phoromatic account web interface.' . PHP_EOL; break; } return $xml_parser->getXMLValue(M_PHOROMATIC_GEN_RESPONSE) == M_PHOROMATIC_RESPONSE_TRUE; }