Skip to content

Commit

Permalink
Fix comment body
Browse files Browse the repository at this point in the history
  • Loading branch information
yasserfaraazkhan committed Feb 16, 2025
1 parent 9658441 commit 596d2d7
Show file tree
Hide file tree
Showing 2 changed files with 53 additions and 19 deletions.
36 changes: 35 additions & 1 deletion .github/workflows/e2e-functional-template.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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 }}
Expand Down
36 changes: 18 additions & 18 deletions e2e/utils/analyze-flaky-test.js
Original file line number Diff line number Diff line change
Expand Up @@ -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 = [];
Expand All @@ -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];

Expand All @@ -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};

0 comments on commit 596d2d7

Please sign in to comment.