fix(ci): satisfy rtt lint rules

This commit is contained in:
Vincent Koc
2026-05-01 08:25:52 -07:00
parent c1f31f3870
commit 8751464cb9
2 changed files with 10 additions and 9 deletions

View File

@@ -16,12 +16,13 @@ const maxWarmFailures = Number(
process.env.OPENCLAW_NPM_TELEGRAM_MAX_FAILURES ?? String(warmSampleCount),
);
const successMarker = process.env.OPENCLAW_NPM_TELEGRAM_SUCCESS_MARKER ?? "OPENCLAW_E2E_OK";
const scenarioIds = (
process.env.OPENCLAW_NPM_TELEGRAM_SCENARIOS ?? "telegram-mentioned-message-reply"
)
.split(",")
.map((value) => value.trim())
.filter(Boolean);
const scenarioIds = new Set(
process.env.OPENCLAW_NPM_TELEGRAM_SCENARIOS ??
"telegram-mentioned-message-reply"
.split(",")
.map((value) => value.trim())
.filter(Boolean),
);
if (!groupId || !driverToken || !sutToken) {
throw new Error(
@@ -203,7 +204,7 @@ function percentile(sortedValues, percentileValue) {
function summarizeSamples(samples) {
const passed = samples.filter((sample) => sample.status === "pass" && sample.rttMs !== undefined);
const sorted = passed.map((sample) => sample.rttMs).sort((a, b) => a - b);
const sorted = passed.map((sample) => sample.rttMs).toSorted((a, b) => a - b);
const sum = sorted.reduce((total, value) => total + value, 0);
return {
total: samples.length,
@@ -309,7 +310,7 @@ async function main() {
});
scenarios.push(canary);
if (scenarioIds.includes("telegram-mentioned-message-reply")) {
if (scenarioIds.has("telegram-mentioned-message-reply")) {
scenarios.push(
await runWarmScenario({
id: "telegram-mentioned-message-reply",

View File

@@ -107,7 +107,7 @@ export function extractRtt(summary: TelegramQaSummary) {
const mention = scenarios.find((scenario) => scenario.id === "telegram-mentioned-message-reply");
const warmSamples = mention?.samples
?.filter((sample) => sample.status === "pass" && sample.rttMs !== undefined)
.sort((left, right) => (left.index ?? 0) - (right.index ?? 0))
.toSorted((left, right) => (left.index ?? 0) - (right.index ?? 0))
.flatMap((sample) => (sample.rttMs === undefined ? [] : [sample.rttMs]));
const rtt: RttResult["rtt"] = {
canaryMs: scenarios.find((scenario) => scenario.id === "telegram-canary")?.rttMs,