From ad6b7e096e8878d6151517981228645fcbe08538 Mon Sep 17 00:00:00 2001 From: Sahan Paliskara Date: Fri, 13 Sep 2024 17:07:24 -0700 Subject: [PATCH] [inductor] fix spurious errors (#5666) --- torchci/lib/bot/index.ts | 2 ++ torchci/lib/bot/triggerInductorTestsBot.ts | 2 +- torchci/test/triggerInductorTestsBot.test.ts | 8 ++++---- 3 files changed, 7 insertions(+), 5 deletions(-) diff --git a/torchci/lib/bot/index.ts b/torchci/lib/bot/index.ts index c564ee667d..6fae9364ad 100644 --- a/torchci/lib/bot/index.ts +++ b/torchci/lib/bot/index.ts @@ -9,6 +9,7 @@ import pytorchBot from "./pytorchBot"; import retryBot from "./retryBot"; import stripApprovalBot from "./stripApprovalBot"; import triggerCircleCIWorkflows from "./triggerCircleCIWorkflows"; +import triggerInductorTestsBot from "./triggerInductorTestsBot"; import verifyDisableTestIssueBot from "./verifyDisableTestIssueBot"; import webhookToDynamo from "./webhookToDynamo"; @@ -25,4 +26,5 @@ export default function bot(app: Probot) { triggerCircleCIWorkflows(app); verifyDisableTestIssueBot(app); webhookToDynamo(app); + triggerInductorTestsBot(app); } diff --git a/torchci/lib/bot/triggerInductorTestsBot.ts b/torchci/lib/bot/triggerInductorTestsBot.ts index 8eb3fd711d..6603d3ece0 100644 --- a/torchci/lib/bot/triggerInductorTestsBot.ts +++ b/torchci/lib/bot/triggerInductorTestsBot.ts @@ -14,7 +14,7 @@ export default function triggerInductorTestsBot(app: Probot): void { const commenter = ctx.payload.comment.user.login; const orgRepo = `${ctx.payload.repository.owner.login}/${ctx.payload.repository.name}`; if ( - commentBody.includes("@pytorchbot run pytorch tests") && + commentBody.includes("@pytorch run pytorch tests") && preapprovedUsers.includes(commenter) && preapprovedRepos.includes(orgRepo) ) { diff --git a/torchci/test/triggerInductorTestsBot.test.ts b/torchci/test/triggerInductorTestsBot.test.ts index 672f8a1dba..922757b290 100644 --- a/torchci/test/triggerInductorTestsBot.test.ts +++ b/torchci/test/triggerInductorTestsBot.test.ts @@ -21,7 +21,7 @@ describe("trigger-inductor-tests-bot", () => { test("triggers inductor tests for preapproved user and repo", async () => { const event = requireDeepCopy("./fixtures/pull_request_comment.json"); - event.payload.comment.body = "@pytorchbot run pytorch tests"; + event.payload.comment.body = "@pytorch run pytorch tests"; event.payload.comment.user.login = "pytorchbot"; event.payload.repository.owner.login = "malfet"; event.payload.repository.name = "deleteme"; @@ -52,7 +52,7 @@ describe("trigger-inductor-tests-bot", () => { test("triggers inductor tests for triton repo", async () => { const event = requireDeepCopy("./fixtures/pull_request_comment.json"); - event.payload.comment.body = "@pytorchbot run pytorch tests"; + event.payload.comment.body = "@pytorch run pytorch tests"; event.payload.comment.user.login = "pytorchbot"; event.payload.repository.owner.login = "triton-lang-test"; event.payload.repository.name = "triton"; @@ -89,7 +89,7 @@ describe("trigger-inductor-tests-bot", () => { test("does not trigger for non-preapproved user", async () => { const event = requireDeepCopy("./fixtures/pull_request_comment.json"); - event.payload.comment.body = "@pytorchbot run pytorch tests"; + event.payload.comment.body = "@pytorch run pytorch tests"; event.payload.comment.user.login = "nonApprovedUser"; event.payload.repository.owner.login = "malfet"; event.payload.repository.name = "deleteme"; @@ -103,7 +103,7 @@ describe("trigger-inductor-tests-bot", () => { test("does not trigger for non-preapproved repo", async () => { const event = requireDeepCopy("./fixtures/pull_request_comment.json"); - event.payload.comment.body = "@pytorchbot run pytorch tests"; + event.payload.comment.body = "@pytorch run pytorch tests"; event.payload.comment.user.login = "pytorchbot"; event.payload.repository.owner.login = "fakeorg"; event.payload.repository.name = "fakerepo";