From d51015d0a59f2aa38bf8618bfb3f61a0ba8a9298 Mon Sep 17 00:00:00 2001 From: jdamore-linode <97627410+jdamore-linode@users.noreply.github.com> Date: Wed, 15 Jan 2025 18:33:06 -0500 Subject: [PATCH] fix: [M3-9073] - Fix duplicate specs in Cypress Slack / GH notifications (#11489) * Avoid duplicating specs in run command output, reduce Slack failure list to 4 * Add changeset --- packages/manager/.changeset/pr-11489-tests-1736348080190.md | 5 +++++ scripts/junit-summary/formatters/slack-formatter.ts | 2 +- scripts/junit-summary/util/cypress.ts | 3 ++- 3 files changed, 8 insertions(+), 2 deletions(-) create mode 100644 packages/manager/.changeset/pr-11489-tests-1736348080190.md diff --git a/packages/manager/.changeset/pr-11489-tests-1736348080190.md b/packages/manager/.changeset/pr-11489-tests-1736348080190.md new file mode 100644 index 00000000000..3f5de239a65 --- /dev/null +++ b/packages/manager/.changeset/pr-11489-tests-1736348080190.md @@ -0,0 +1,5 @@ +--- +"@linode/manager": Tests +--- + +Fix test notification formatting and output issues ([#11489](https://github.com/linode/manager/pull/11489)) diff --git a/scripts/junit-summary/formatters/slack-formatter.ts b/scripts/junit-summary/formatters/slack-formatter.ts index 65b2b3dda1f..0e8123d5f71 100644 --- a/scripts/junit-summary/formatters/slack-formatter.ts +++ b/scripts/junit-summary/formatters/slack-formatter.ts @@ -14,7 +14,7 @@ import { cypressRunCommand } from '../util/cypress'; * The Slack notification has a maximum character limit, so we must truncate * the failure results to reduce the risk of hitting that limit. */ -const FAILURE_SUMMARY_LIMIT = 6; +const FAILURE_SUMMARY_LIMIT = 4; /** * Outputs test result summary formatted as a Slack message. diff --git a/scripts/junit-summary/util/cypress.ts b/scripts/junit-summary/util/cypress.ts index e55e3e78d0d..0f345f39eb7 100644 --- a/scripts/junit-summary/util/cypress.ts +++ b/scripts/junit-summary/util/cypress.ts @@ -6,6 +6,7 @@ * @returns Cypress run command to run `testFiles`. */ export const cypressRunCommand = (testFiles: string[]): string => { - const testFilesList = testFiles.join(','); + const dedupedTestFiles = Array.from(new Set(testFiles)); + const testFilesList = dedupedTestFiles.join(','); return `yarn cy:run -s "${testFilesList}"`; };