From 596d2d78ff3c544874d045b76f1ae7459da44ec5 Mon Sep 17 00:00:00 2001 From: yasserfaraazkhan Date: Sun, 16 Feb 2025 12:06:41 +0530 Subject: [PATCH] Fix comment body --- .github/workflows/e2e-functional-template.yml | 36 ++++++++++++++++++- e2e/utils/analyze-flaky-test.js | 36 +++++++++---------- 2 files changed, 53 insertions(+), 19 deletions(-) diff --git a/.github/workflows/e2e-functional-template.yml b/.github/workflows/e2e-functional-template.yml index 007188182eb..a1352ffe593 100644 --- a/.github/workflows/e2e-functional-template.yml +++ b/.github/workflows/e2e-functional-template.yml @@ -42,8 +42,42 @@ on: outputs: COMMENT_BODY: description: "The output to comment" - value: ${{ jobs.e2e.outputs.COMMENT_BODY }} + value: ${{ jobs.e2e.outputs.COMMENT_BODY_LINUX }} + workflow_dispatch: + inputs: + MM_TEST_SERVER_URL: + description: "The test server URL" + required: false + type: string + MM_TEST_USER_NAME: + description: "The admin username of the test instance" + required: false + type: string + MM_TEST_PASSWORD: + description: "The admin password of the test instance" + required: false + type: string + DESKTOP_VERSION: + description: "The desktop version to test" + required: false + type: string + runs-on: + description: "The E2E tests underlying OS" + required: false + type: string + nightly: + description: "True if this is nightly build" + required: false + type: boolean + cmt: + description: "True if this is Compatibility Matrix Testing" + required: false + type: boolean + MM_SERVER_VERSION: + description: "The Mattermost server version" + required: false + type: string env: AWS_S3_BUCKET: "mattermost-cypress-report" BRANCH: ${{ github.head_ref || github.ref_name }} diff --git a/e2e/utils/analyze-flaky-test.js b/e2e/utils/analyze-flaky-test.js index 5632e9a9f77..fdca2d8e424 100644 --- a/e2e/utils/analyze-flaky-test.js +++ b/e2e/utils/analyze-flaky-test.js @@ -19,13 +19,13 @@ function analyzeFlakyTests() { const platforms = { linux: 'linux', macos: 'darwin', - windows: 'win32' + windows: 'win32', }; - let results = { - linux: "Linux Results:\n", - macos: "macOS Results:\n", - windows: "Windows Results:\n" + const results = { + linux: 'Linux Results:\n', + macos: 'macOS Results:\n', + windows: 'Windows Results:\n', }; let newFailedTests = []; @@ -37,9 +37,9 @@ function analyzeFlakyTests() { const failedTestsForOS = failedFullTitles; const newFailures = failedTestsForOS.filter((test) => !knownFlakyTestsForOS.has(test)); - results[key] += failedTestsForOS.length - ? failedTestsForOS.join('\n') - : "All stable tests passed."; + results[key] += failedTestsForOS.length ? + failedTestsForOS.join('\n') : + 'All stable tests passed.'; newFailedTests = [...newFailedTests, ...newFailures]; @@ -48,20 +48,20 @@ function analyzeFlakyTests() { } return { - COMMENT_BODY_LINUX: results.linux || "No results for Linux.", - COMMENT_BODY_MACOS: results.macos || "No results for macOS.", - COMMENT_BODY_WINDOWS: results.windows || "No results for Windows.", - newFailedTests + COMMENT_BODY_LINUX: results.linux || 'No results for Linux.', + COMMENT_BODY_MACOS: results.macos || 'No results for macOS.', + COMMENT_BODY_WINDOWS: results.windows || 'No results for Windows.', + newFailedTests, }; } catch (error) { - console.error("Error analyzing flaky tests:", error); + console.error('Error analyzing flaky tests:', error); return { - COMMENT_BODY_LINUX: "Error analyzing Linux tests.", - COMMENT_BODY_MACOS: "Error analyzing macOS tests.", - COMMENT_BODY_WINDOWS: "Error analyzing Windows tests.", - newFailedTests: [] + COMMENT_BODY_LINUX: 'Error analyzing Linux tests.', + COMMENT_BODY_MACOS: 'Error analyzing macOS tests.', + COMMENT_BODY_WINDOWS: 'Error analyzing Windows tests.', + newFailedTests: [], }; } } -module.exports = { analyzeFlakyTests }; +module.exports = {analyzeFlakyTests};