Fixing typos

This commit is contained in:
Pavel Shevaev 2023-11-07 16:08:42 +03:00
parent 2e2446e4c5
commit 548f6b2f16
4 changed files with 13 additions and 11 deletions

View File

@ -53,7 +53,7 @@ function host_put_file_async(string $atf_host, string $local_path, string $remot
return taskman\deploy_rsync_async($atf_host, $local_path, $remote_path); return taskman\deploy_rsync_async($atf_host, $local_path, $remote_path);
} }
function _spread(array $items, $num) function spread(array $items, $num)
{ {
$k = sizeof($items) / $num; $k = sizeof($items) / $num;
@ -66,7 +66,7 @@ function _spread(array $items, $num)
return $res; return $res;
} }
function _slice(array $items, $max) function slice(array $items, $max)
{ {
$sliced = array(); $sliced = array();

View File

@ -2,6 +2,7 @@
namespace ATF; namespace ATF;
use Exception; use Exception;
use Amp;
interface IDevicePool interface IDevicePool
{ {

View File

@ -2,6 +2,7 @@
namespace ATF; namespace ATF;
use Exception; use Exception;
use Amp;
interface IMChan interface IMChan
{ {
@ -72,7 +73,7 @@ class MattermostChan implements IMChan
function mm_post(string $server, string $token, string $chan, string $message, $fields = array()) function mm_post(string $server, string $token, string $chan, string $message, $fields = array())
{ {
$ch = _atf_mm_post_curl($server, $token, $chan, $message, $fields); $ch = _mm_post_curl($server, $token, $chan, $message, $fields);
$result = curl_exec($ch); $result = curl_exec($ch);
curl_close($ch); curl_close($ch);
@ -86,8 +87,8 @@ function mm_post_async(string $server, string $token, string $chan, string $mess
{ {
return Amp\call(function() use($server, $token, $chan, $message, $fields) { return Amp\call(function() use($server, $token, $chan, $message, $fields) {
$ch = _atf_mm_post_curl($server, $token, $chan, $message, $fields); $ch = _mm_post_curl($server, $token, $chan, $message, $fields);
$result = yield _atf_multi_curl_async($ch, true); $result = yield _multi_curl_async($ch, true);
curl_close($ch); curl_close($ch);
$json = json_decode($result, true); $json = json_decode($result, true);
@ -160,7 +161,7 @@ function mm_get_permalink(string $server, string $team, string $msg_id)
return "$server/$team/pl/$msg_id"; return "$server/$team/pl/$msg_id";
} }
function _atf_mm_post_curl(string $server, string $token, string $chan, string $message, $fields = array()) function _mm_post_curl(string $server, string $token, string $chan, string $message, $fields = array())
{ {
$ch = curl_init("$server/api/v4/posts"); $ch = curl_init("$server/api/v4/posts");

View File

@ -353,7 +353,7 @@ class Plan
$task->getLastFatalProblem() == Task::CODE_HUNG) $task->getLastFatalProblem() == Task::CODE_HUNG)
{ {
$app_log = get_logcat_unity($this->session->conf->atf_host, $task->device, 300); $app_log = get_logcat_unity($this->session->conf->atf_host, $task->device, 300);
$app_log = _atf_trim_start($app_log, 2000); $app_log = _trim_start($app_log, 2000);
$this->post("Last logs: \n```\n$app_log\n```\n *{$task->device}*"); $this->post("Last logs: \n```\n$app_log\n```\n *{$task->device}*");
} }
@ -528,7 +528,7 @@ class Plan
static function _printToShellExtItem(Task $task, array $item) static function _printToShellExtItem(Task $task, array $item)
{ {
$shell_msg = _atf_trim($item['message'], 200); $shell_msg = _trim($item['message'], 200);
if(Task::isProblemCode($item['error'])) if(Task::isProblemCode($item['error']))
$shell_msg = "[PRB] Code:{$item['error']}, $shell_msg"; $shell_msg = "[PRB] Code:{$item['error']}, $shell_msg";
$shell_msg = "(".round($item['time'],1)."s) {$shell_msg} *{$task->device}*"; $shell_msg = "(".round($item['time'],1)."s) {$shell_msg} *{$task->device}*";
@ -538,7 +538,7 @@ class Plan
function _postToMessengerExtStatusItem(Task $task, array $item) function _postToMessengerExtStatusItem(Task $task, array $item)
{ {
$orig_msg = _atf_trim($item['message'], 3000); $orig_msg = _trim($item['message'], 3000);
$mm_msg = $orig_msg; $mm_msg = $orig_msg;
if($item['error'] == Task::CODE_EXCEPTION) if($item['error'] == Task::CODE_EXCEPTION)
@ -628,13 +628,13 @@ class Plan
function _postReplayToMessenger(Task $task, $repl_txt) function _postReplayToMessenger(Task $task, $repl_txt)
{ {
$repl_txt = _atf_try_lz4_replay($repl_txt); $repl_txt = _try_lz4_replay($repl_txt);
$this->post("Last Replay: \n```\n$repl_txt\n```\n *{$task->device}*"); $this->post("Last Replay: \n```\n$repl_txt\n```\n *{$task->device}*");
} }
function _reportErrorFromLogcatToMessenger(Task $task, $limit) function _reportErrorFromLogcatToMessenger(Task $task, $limit)
{ {
$errors_log = _atf_trim(get_logcat_errors($task->device, $limit), 3950); $errors_log = _trim(get_logcat_errors($task->device, $limit), 3950);
if($errors_log) if($errors_log)
$this->post("\n```\n$errors_log\n```\n *{$task->device}*"); $this->post("\n```\n$errors_log\n```\n *{$task->device}*");
} }