From 806478efbdfb92e9cb866b9e95e44b70f9046cd7 Mon Sep 17 00:00:00 2001 From: Yauheni Pasiukevich Date: Wed, 20 Mar 2024 12:13:45 +0100 Subject: [PATCH 1/2] [TS migration] Migrate 'mocks' workflow test to TypeScript --- workflow_tests/mocks/authorChecklistMocks.js | 10 -- workflow_tests/mocks/authorChecklistMocks.ts | 11 ++ ...{cherryPickMocks.js => cherryPickMocks.ts} | 42 +++-- workflow_tests/mocks/claMocks.js | 25 --- workflow_tests/mocks/claMocks.ts | 22 +++ ...rsionMocks.js => createNewVersionMocks.ts} | 37 ++--- ...yBlockerMocks.js => deployBlockerMocks.ts} | 26 ++- workflow_tests/mocks/deployMocks.js | 55 ------- workflow_tests/mocks/deployMocks.ts | 53 +++++++ ...tifierMocks.js => failureNotifierMocks.ts} | 10 +- ...cleMocks.js => finishReleaseCycleMocks.ts} | 47 +++--- workflow_tests/mocks/lintMocks.js | 19 --- workflow_tests/mocks/lintMocks.ts | 20 +++ ...ockDeploysMocks.js => lockDeploysMocks.ts} | 15 +- ...mDeployMocks.js => platformDeployMocks.ts} | 148 +++++++++--------- .../{preDeployMocks.js => preDeployMocks.ts} | 45 +++--- ...listMocks.js => reviewerChecklistMocks.ts} | 7 +- .../{testBuildMocks.js => testBuildMocks.ts} | 114 +++++++------- workflow_tests/mocks/testMocks.js | 26 --- workflow_tests/mocks/testMocks.ts | 24 +++ .../mocks/validateGithubActionsMocks.js | 23 --- .../mocks/validateGithubActionsMocks.ts | 18 +++ workflow_tests/mocks/verifyPodfileMocks.js | 11 -- workflow_tests/mocks/verifyPodfileMocks.ts | 12 ++ ...tsMocks.js => verifySignedCommitsMocks.ts} | 7 +- workflow_tests/utils/utils.ts | 2 +- 26 files changed, 388 insertions(+), 441 deletions(-) delete mode 100644 workflow_tests/mocks/authorChecklistMocks.js create mode 100644 workflow_tests/mocks/authorChecklistMocks.ts rename workflow_tests/mocks/{cherryPickMocks.js => cherryPickMocks.ts} (73%) delete mode 100644 workflow_tests/mocks/claMocks.js create mode 100644 workflow_tests/mocks/claMocks.ts rename workflow_tests/mocks/{createNewVersionMocks.js => createNewVersionMocks.ts} (63%) rename workflow_tests/mocks/{deployBlockerMocks.js => deployBlockerMocks.ts} (62%) delete mode 100644 workflow_tests/mocks/deployMocks.js create mode 100644 workflow_tests/mocks/deployMocks.ts rename workflow_tests/mocks/{failureNotifierMocks.js => failureNotifierMocks.ts} (56%) rename workflow_tests/mocks/{finishReleaseCycleMocks.js => finishReleaseCycleMocks.ts} (85%) delete mode 100644 workflow_tests/mocks/lintMocks.js create mode 100644 workflow_tests/mocks/lintMocks.ts rename workflow_tests/mocks/{lockDeploysMocks.js => lockDeploysMocks.ts} (69%) rename workflow_tests/mocks/{platformDeployMocks.js => platformDeployMocks.ts} (55%) rename workflow_tests/mocks/{preDeployMocks.js => preDeployMocks.ts} (51%) rename workflow_tests/mocks/{reviewerChecklistMocks.js => reviewerChecklistMocks.ts} (51%) rename workflow_tests/mocks/{testBuildMocks.js => testBuildMocks.ts} (59%) delete mode 100644 workflow_tests/mocks/testMocks.js create mode 100644 workflow_tests/mocks/testMocks.ts delete mode 100644 workflow_tests/mocks/validateGithubActionsMocks.js create mode 100644 workflow_tests/mocks/validateGithubActionsMocks.ts delete mode 100644 workflow_tests/mocks/verifyPodfileMocks.js create mode 100644 workflow_tests/mocks/verifyPodfileMocks.ts rename workflow_tests/mocks/{verifySignedCommitsMocks.js => verifySignedCommitsMocks.ts} (72%) diff --git a/workflow_tests/mocks/authorChecklistMocks.js b/workflow_tests/mocks/authorChecklistMocks.js deleted file mode 100644 index b0fda86815db..000000000000 --- a/workflow_tests/mocks/authorChecklistMocks.js +++ /dev/null @@ -1,10 +0,0 @@ -const utils = require('../utils/utils'); - -// checklist -const AUTHORCHECKLIST__CHECKLIST__CHECKOUT__STEP_MOCK = utils.createMockStep('Checkout', 'Checkout', 'CHECKLIST'); -const AUTHORCHECKLIST__CHECKLIST__AUTHORCHECKLIST_JS__STEP_MOCK = utils.createMockStep('authorChecklist.js', 'Running authorChecklist.js', 'CHECKLIST', ['GITHUB_TOKEN'], []); -const AUTHORCHECKLIST__CHECKLIST__STEP_MOCKS = [AUTHORCHECKLIST__CHECKLIST__CHECKOUT__STEP_MOCK, AUTHORCHECKLIST__CHECKLIST__AUTHORCHECKLIST_JS__STEP_MOCK]; - -module.exports = { - AUTHORCHECKLIST__CHECKLIST__STEP_MOCKS, -}; diff --git a/workflow_tests/mocks/authorChecklistMocks.ts b/workflow_tests/mocks/authorChecklistMocks.ts new file mode 100644 index 000000000000..3a7f49783111 --- /dev/null +++ b/workflow_tests/mocks/authorChecklistMocks.ts @@ -0,0 +1,11 @@ +/* eslint-disable @typescript-eslint/naming-convention */ +import {createMockStep} from '../utils/utils'; + +// checklist +const AUTHORCHECKLIST__CHECKLIST__CHECKOUT__STEP_MOCK = createMockStep('Checkout', 'Checkout', 'CHECKLIST'); +const AUTHORCHECKLIST__CHECKLIST__AUTHORCHECKLIST_JS__STEP_MOCK = createMockStep('authorChecklist.js', 'Running authorChecklist.js', 'CHECKLIST', ['GITHUB_TOKEN'], []); +const AUTHORCHECKLIST__CHECKLIST__STEP_MOCKS = [AUTHORCHECKLIST__CHECKLIST__CHECKOUT__STEP_MOCK, AUTHORCHECKLIST__CHECKLIST__AUTHORCHECKLIST_JS__STEP_MOCK]; + +export default { + AUTHORCHECKLIST__CHECKLIST__STEP_MOCKS, +}; diff --git a/workflow_tests/mocks/cherryPickMocks.js b/workflow_tests/mocks/cherryPickMocks.ts similarity index 73% rename from workflow_tests/mocks/cherryPickMocks.js rename to workflow_tests/mocks/cherryPickMocks.ts index 5ce9b2ecccfb..5791d903e416 100644 --- a/workflow_tests/mocks/cherryPickMocks.js +++ b/workflow_tests/mocks/cherryPickMocks.ts @@ -1,7 +1,8 @@ -const utils = require('../utils/utils'); +/* eslint-disable @typescript-eslint/naming-convention */ +import {createMockStep} from '../utils/utils'; // validateactor -const CHERRYPICK__VALIDATEACTOR__CHECK_IF_USER_IS_DEPLOYER_TRUE__STEP_MOCK = utils.createMockStep( +const CHERRYPICK__VALIDATEACTOR__CHECK_IF_USER_IS_DEPLOYER_TRUE__STEP_MOCK = createMockStep( 'Check if user is deployer', 'Checking if user is a deployer', 'VALIDATEACTOR', @@ -9,7 +10,7 @@ const CHERRYPICK__VALIDATEACTOR__CHECK_IF_USER_IS_DEPLOYER_TRUE__STEP_MOCK = uti ['GITHUB_TOKEN'], {IS_DEPLOYER: true}, ); -const CHERRYPICK__VALIDATEACTOR__CHECK_IF_USER_IS_DEPLOYER_FALSE__STEP_MOCK = utils.createMockStep( +const CHERRYPICK__VALIDATEACTOR__CHECK_IF_USER_IS_DEPLOYER_FALSE__STEP_MOCK = createMockStep( 'Check if user is deployer', 'Checking if user is a deployer', 'VALIDATEACTOR', @@ -21,7 +22,7 @@ const CHERRYPICK__VALIDATEACTOR__TRUE__STEP_MOCKS = [CHERRYPICK__VALIDATEACTOR__ const CHERRYPICK__VALIDATEACTOR__FALSE__STEP_MOCKS = [CHERRYPICK__VALIDATEACTOR__CHECK_IF_USER_IS_DEPLOYER_FALSE__STEP_MOCK]; // createnewversion -const CHERRYPICK__CREATENEWVERSION__CREATE_NEW_VERSION__STEP_MOCK = utils.createMockStep( +const CHERRYPICK__CREATENEWVERSION__CREATE_NEW_VERSION__STEP_MOCK = createMockStep( 'Create new version', 'Creating new version', 'CREATENEWVERSION', @@ -35,16 +36,16 @@ const CHERRYPICK__CREATENEWVERSION__CREATE_NEW_VERSION__STEP_MOCK = utils.create const CHERRYPICK__CREATENEWVERSION__STEP_MOCKS = [CHERRYPICK__CREATENEWVERSION__CREATE_NEW_VERSION__STEP_MOCK]; // cherrypick -const CHERRYPICK__CHERRYPICK__CHECKOUT_STAGING_BRANCH__STEP_MOCK = utils.createMockStep('Checkout staging branch', 'Checking out staging branch', 'CHERRYPICK', ['ref', 'token'], []); -const CHERRYPICK__CHERRYPICK__SET_UP_GIT_FOR_OSBOTIFY__STEP_MOCK = utils.createMockStep('Set up git for OSBotify', 'Setting up git for OSBotify', 'CHERRYPICK', ['GPG_PASSPHRASE'], [], { +const CHERRYPICK__CHERRYPICK__CHECKOUT_STAGING_BRANCH__STEP_MOCK = createMockStep('Checkout staging branch', 'Checking out staging branch', 'CHERRYPICK', ['ref', 'token'], []); +const CHERRYPICK__CHERRYPICK__SET_UP_GIT_FOR_OSBOTIFY__STEP_MOCK = createMockStep('Set up git for OSBotify', 'Setting up git for OSBotify', 'CHERRYPICK', ['GPG_PASSPHRASE'], [], { OS_BOTIFY_API_TOKEN: 'os_botify_api_token', }); -const CHERRYPICK__CHERRYPICK__GET_PREVIOUS_APP_VERSION__STEP_MOCK = utils.createMockStep('Get previous app version', 'Get previous app version', 'CHERRYPICK', ['SEMVER_LEVEL']); -const CHERRYPICK__CHERRYPICK__FETCH_HISTORY_OF_RELEVANT_REFS__STEP_MOCK = utils.createMockStep('Fetch history of relevant refs', 'Fetch history of relevant refs', 'CHERRYPICK'); -const CHERRYPICK__CHERRYPICK__GET_VERSION_BUMP_COMMIT__STEP_MOCK = utils.createMockStep('Get version bump commit', 'Get version bump commit', 'CHERRYPICK', [], [], { +const CHERRYPICK__CHERRYPICK__GET_PREVIOUS_APP_VERSION__STEP_MOCK = createMockStep('Get previous app version', 'Get previous app version', 'CHERRYPICK', ['SEMVER_LEVEL']); +const CHERRYPICK__CHERRYPICK__FETCH_HISTORY_OF_RELEVANT_REFS__STEP_MOCK = createMockStep('Fetch history of relevant refs', 'Fetch history of relevant refs', 'CHERRYPICK'); +const CHERRYPICK__CHERRYPICK__GET_VERSION_BUMP_COMMIT__STEP_MOCK = createMockStep('Get version bump commit', 'Get version bump commit', 'CHERRYPICK', [], [], { VERSION_BUMP_SHA: 'version_bump_sha', }); -const CHERRYPICK__CHERRYPICK__GET_MERGE_COMMIT_FOR_PULL_REQUEST_TO_CP__STEP_MOCK = utils.createMockStep( +const CHERRYPICK__CHERRYPICK__GET_MERGE_COMMIT_FOR_PULL_REQUEST_TO_CP__STEP_MOCK = createMockStep( 'Get merge commit for pull request to CP', 'Get merge commit for pull request to CP', 'CHERRYPICK', @@ -52,14 +53,14 @@ const CHERRYPICK__CHERRYPICK__GET_MERGE_COMMIT_FOR_PULL_REQUEST_TO_CP__STEP_MOCK [], {MERGE_ACTOR: '@dummyauthor'}, ); -const CHERRYPICK__CHERRYPICK__CHERRY_PICK_THE_VERSION_BUMP_TO_STAGING__STEP_MOCK = utils.createMockStep( +const CHERRYPICK__CHERRYPICK__CHERRY_PICK_THE_VERSION_BUMP_TO_STAGING__STEP_MOCK = createMockStep( 'Cherry-pick the version-bump to staging', 'Cherry-picking the version-bump to staging', 'CHERRYPICK', [], [], ); -const CHERRYPICK__CHERRYPICK__CHERRY_PICK_THE_MERGE_COMMIT_OF_TARGET_PR_TO_NEW_BRANCH__HAS_NO_CONFLICTS__STEP_MOCK = utils.createMockStep( +const CHERRYPICK__CHERRYPICK__CHERRY_PICK_THE_MERGE_COMMIT_OF_TARGET_PR_TO_NEW_BRANCH__HAS_NO_CONFLICTS__STEP_MOCK = createMockStep( 'Cherry-pick the merge commit of target PR', 'Cherry-picking the merge commit of target PR', 'CHERRYPICK', @@ -68,7 +69,7 @@ const CHERRYPICK__CHERRYPICK__CHERRY_PICK_THE_MERGE_COMMIT_OF_TARGET_PR_TO_NEW_B {HAS_CONFLICTS: false}, ); // eslint-disable-next-line rulesdir/no-negated-variables -const CHERRYPICK__CHERRYPICK__CHERRY_PICK_THE_MERGE_COMMIT_OF_TARGET_PR_TO_NEW_BRANCH__HAS_CONFLICTS__STEP_MOCK = utils.createMockStep( +const CHERRYPICK__CHERRYPICK__CHERRY_PICK_THE_MERGE_COMMIT_OF_TARGET_PR_TO_NEW_BRANCH__HAS_CONFLICTS__STEP_MOCK = createMockStep( 'Cherry-pick the merge commit of target PR', 'Cherry-picking the merge commit of target PR', 'CHERRYPICK', @@ -76,15 +77,15 @@ const CHERRYPICK__CHERRYPICK__CHERRY_PICK_THE_MERGE_COMMIT_OF_TARGET_PR_TO_NEW_B [], {HAS_CONFLICTS: true}, ); -const CHERRYPICK__CHERRYPICK__PUSH_CHANGES__STEP_MOCK = utils.createMockStep('Push changes', 'Pushing changes', 'CHERRYPICK', [], []); -const CHERRYPICK__CHERRYPICK__CREATE_PULL_REQUEST_TO_MANUALLY_FINISH_CP__STEP_MOCK = utils.createMockStep( +const CHERRYPICK__CHERRYPICK__PUSH_CHANGES__STEP_MOCK = createMockStep('Push changes', 'Pushing changes', 'CHERRYPICK', [], []); +const CHERRYPICK__CHERRYPICK__CREATE_PULL_REQUEST_TO_MANUALLY_FINISH_CP__STEP_MOCK = createMockStep( 'Create Pull Request to manually finish CP', 'Creating Pull Request to manually finish CP', 'CHERRYPICK', [], ['GITHUB_TOKEN'], ); -const CHERRYPICK__CHERRYPICK__ANNOUNCES_A_CP_FAILURE_IN_THE_ANNOUNCE_SLACK_ROOM__STEP_MOCK = utils.createMockStep( +const CHERRYPICK__CHERRYPICK__ANNOUNCES_A_CP_FAILURE_IN_THE_ANNOUNCE_SLACK_ROOM__STEP_MOCK = createMockStep( 'Announces a CP failure in the #announce Slack room', 'Announcing a CP failure', 'CHERRYPICK', @@ -92,7 +93,7 @@ const CHERRYPICK__CHERRYPICK__ANNOUNCES_A_CP_FAILURE_IN_THE_ANNOUNCE_SLACK_ROOM_ ['GITHUB_TOKEN', 'SLACK_WEBHOOK_URL'], ); -const getCherryPickMockSteps = (upToDate, hasConflicts) => [ +const getCherryPickMockSteps = (upToDate: boolean, hasConflicts: boolean) => [ CHERRYPICK__CHERRYPICK__CHECKOUT_STAGING_BRANCH__STEP_MOCK, CHERRYPICK__CHERRYPICK__SET_UP_GIT_FOR_OSBOTIFY__STEP_MOCK, CHERRYPICK__CHERRYPICK__GET_PREVIOUS_APP_VERSION__STEP_MOCK, @@ -108,9 +109,4 @@ const getCherryPickMockSteps = (upToDate, hasConflicts) => [ CHERRYPICK__CHERRYPICK__ANNOUNCES_A_CP_FAILURE_IN_THE_ANNOUNCE_SLACK_ROOM__STEP_MOCK, ]; -module.exports = { - CHERRYPICK__VALIDATEACTOR__TRUE__STEP_MOCKS, - CHERRYPICK__VALIDATEACTOR__FALSE__STEP_MOCKS, - CHERRYPICK__CREATENEWVERSION__STEP_MOCKS, - getCherryPickMockSteps, -}; +export {CHERRYPICK__VALIDATEACTOR__TRUE__STEP_MOCKS, CHERRYPICK__VALIDATEACTOR__FALSE__STEP_MOCKS, CHERRYPICK__CREATENEWVERSION__STEP_MOCKS, getCherryPickMockSteps}; diff --git a/workflow_tests/mocks/claMocks.js b/workflow_tests/mocks/claMocks.js deleted file mode 100644 index d0a6793b93e6..000000000000 --- a/workflow_tests/mocks/claMocks.js +++ /dev/null @@ -1,25 +0,0 @@ -const utils = require('../utils/utils'); - -// cla -const CLA__CLA__CLA_COMMENT_CHECK__NO_MATCH__STEP_MOCK = utils.createMockStep('CLA comment check', 'CLA comment check', 'CLA', ['text', 'regex'], [], {match: ''}); -const CLA__CLA__CLA_COMMENT_CHECK__MATCH__STEP_MOCK = utils.createMockStep('CLA comment check', 'CLA comment check', 'CLA', ['text', 'regex'], [], { - match: 'I have read the CLA Document and I hereby sign the CLA', -}); -const CLA__CLA__CLA_COMMENT_RE_CHECK__NO_MATCH__STEP_MOCK = utils.createMockStep('CLA comment re-check', 'CLA comment re-check', 'CLA', ['text', 'regex'], [], {match: ''}); -const CLA__CLA__CLA_COMMENT_RE_CHECK__MATCH__STEP_MOCK = utils.createMockStep('CLA comment re-check', 'CLA comment re-check', 'CLA', ['text', 'regex'], [], {match: 'recheck'}); -const CLA__CLA__CLA_ASSISTANT__STEP_MOCK = utils.createMockStep( - 'CLA Assistant', - 'CLA Assistant', - 'CLA', - ['path-to-signatures', 'path-to-document', 'branch', 'remote-organization-name', 'remote-repository-name', 'lock-pullrequest-aftermerge', 'allowlist'], - ['GITHUB_TOKEN', 'PERSONAL_ACCESS_TOKEN'], -); -const CLA__CLA__NO_MATCHES__STEP_MOCKS = [CLA__CLA__CLA_COMMENT_CHECK__NO_MATCH__STEP_MOCK, CLA__CLA__CLA_COMMENT_RE_CHECK__NO_MATCH__STEP_MOCK, CLA__CLA__CLA_ASSISTANT__STEP_MOCK]; -const CLA__CLA__CHECK_MATCH__STEP_MOCKS = [CLA__CLA__CLA_COMMENT_CHECK__MATCH__STEP_MOCK, CLA__CLA__CLA_COMMENT_RE_CHECK__NO_MATCH__STEP_MOCK, CLA__CLA__CLA_ASSISTANT__STEP_MOCK]; -const CLA__CLA__RECHECK_MATCH__STEP_MOCKS = [CLA__CLA__CLA_COMMENT_CHECK__NO_MATCH__STEP_MOCK, CLA__CLA__CLA_COMMENT_RE_CHECK__MATCH__STEP_MOCK, CLA__CLA__CLA_ASSISTANT__STEP_MOCK]; - -module.exports = { - CLA__CLA__NO_MATCHES__STEP_MOCKS, - CLA__CLA__CHECK_MATCH__STEP_MOCKS, - CLA__CLA__RECHECK_MATCH__STEP_MOCKS, -}; diff --git a/workflow_tests/mocks/claMocks.ts b/workflow_tests/mocks/claMocks.ts new file mode 100644 index 000000000000..ca065510cd4a --- /dev/null +++ b/workflow_tests/mocks/claMocks.ts @@ -0,0 +1,22 @@ +/* eslint-disable @typescript-eslint/naming-convention */ +import {createMockStep} from '../utils/utils'; + +// cla +const CLA__CLA__CLA_COMMENT_CHECK__NO_MATCH__STEP_MOCK = createMockStep('CLA comment check', 'CLA comment check', 'CLA', ['text', 'regex'], [], {match: ''}); +const CLA__CLA__CLA_COMMENT_CHECK__MATCH__STEP_MOCK = createMockStep('CLA comment check', 'CLA comment check', 'CLA', ['text', 'regex'], [], { + match: 'I have read the CLA Document and I hereby sign the CLA', +}); +const CLA__CLA__CLA_COMMENT_RE_CHECK__NO_MATCH__STEP_MOCK = createMockStep('CLA comment re-check', 'CLA comment re-check', 'CLA', ['text', 'regex'], [], {match: ''}); +const CLA__CLA__CLA_COMMENT_RE_CHECK__MATCH__STEP_MOCK = createMockStep('CLA comment re-check', 'CLA comment re-check', 'CLA', ['text', 'regex'], [], {match: 'recheck'}); +const CLA__CLA__CLA_ASSISTANT__STEP_MOCK = createMockStep( + 'CLA Assistant', + 'CLA Assistant', + 'CLA', + ['path-to-signatures', 'path-to-document', 'branch', 'remote-organization-name', 'remote-repository-name', 'lock-pullrequest-aftermerge', 'allowlist'], + ['GITHUB_TOKEN', 'PERSONAL_ACCESS_TOKEN'], +); +const CLA__CLA__NO_MATCHES__STEP_MOCKS = [CLA__CLA__CLA_COMMENT_CHECK__NO_MATCH__STEP_MOCK, CLA__CLA__CLA_COMMENT_RE_CHECK__NO_MATCH__STEP_MOCK, CLA__CLA__CLA_ASSISTANT__STEP_MOCK]; +const CLA__CLA__CHECK_MATCH__STEP_MOCKS = [CLA__CLA__CLA_COMMENT_CHECK__MATCH__STEP_MOCK, CLA__CLA__CLA_COMMENT_RE_CHECK__NO_MATCH__STEP_MOCK, CLA__CLA__CLA_ASSISTANT__STEP_MOCK]; +const CLA__CLA__RECHECK_MATCH__STEP_MOCKS = [CLA__CLA__CLA_COMMENT_CHECK__NO_MATCH__STEP_MOCK, CLA__CLA__CLA_COMMENT_RE_CHECK__MATCH__STEP_MOCK, CLA__CLA__CLA_ASSISTANT__STEP_MOCK]; + +export {CLA__CLA__NO_MATCHES__STEP_MOCKS, CLA__CLA__CHECK_MATCH__STEP_MOCKS, CLA__CLA__RECHECK_MATCH__STEP_MOCKS}; diff --git a/workflow_tests/mocks/createNewVersionMocks.js b/workflow_tests/mocks/createNewVersionMocks.ts similarity index 63% rename from workflow_tests/mocks/createNewVersionMocks.js rename to workflow_tests/mocks/createNewVersionMocks.ts index a1f601aef47f..d3ebdfa57734 100644 --- a/workflow_tests/mocks/createNewVersionMocks.js +++ b/workflow_tests/mocks/createNewVersionMocks.ts @@ -1,13 +1,14 @@ -const utils = require('../utils/utils'); +/* eslint-disable @typescript-eslint/naming-convention */ +import {createMockStep} from '../utils/utils'; // validateactor -const CREATENEWVERSION__VALIDATEACTOR__GET_USER_PERMISSIONS__ADMIN__STEP_MOCK = utils.createMockStep('Get user permissions', 'Get user permissions', 'VALIDATEACTOR', [], ['GITHUB_TOKEN'], { +const CREATENEWVERSION__VALIDATEACTOR__GET_USER_PERMISSIONS__ADMIN__STEP_MOCK = createMockStep('Get user permissions', 'Get user permissions', 'VALIDATEACTOR', [], ['GITHUB_TOKEN'], { PERMISSION: 'admin', }); -const CREATENEWVERSION__VALIDATEACTOR__GET_USER_PERMISSIONS__WRITE__STEP_MOCK = utils.createMockStep('Get user permissions', 'Get user permissions', 'VALIDATEACTOR', [], ['GITHUB_TOKEN'], { +const CREATENEWVERSION__VALIDATEACTOR__GET_USER_PERMISSIONS__WRITE__STEP_MOCK = createMockStep('Get user permissions', 'Get user permissions', 'VALIDATEACTOR', [], ['GITHUB_TOKEN'], { PERMISSION: 'write', }); -const CREATENEWVERSION__VALIDATEACTOR__GET_USER_PERMISSIONS__NONE__STEP_MOCK = utils.createMockStep('Get user permissions', 'Get user permissions', 'VALIDATEACTOR', [], ['GITHUB_TOKEN'], { +const CREATENEWVERSION__VALIDATEACTOR__GET_USER_PERMISSIONS__NONE__STEP_MOCK = createMockStep('Get user permissions', 'Get user permissions', 'VALIDATEACTOR', [], ['GITHUB_TOKEN'], { PERMISSION: 'read', }); const CREATENEWVERSION__VALIDATEACTOR__ADMIN__STEP_MOCKS = [CREATENEWVERSION__VALIDATEACTOR__GET_USER_PERMISSIONS__ADMIN__STEP_MOCK]; @@ -15,25 +16,13 @@ const CREATENEWVERSION__VALIDATEACTOR__WRITER__STEP_MOCKS = [CREATENEWVERSION__V const CREATENEWVERSION__VALIDATEACTOR__NO_PERMISSION__STEP_MOCKS = [CREATENEWVERSION__VALIDATEACTOR__GET_USER_PERMISSIONS__NONE__STEP_MOCK]; // createnewversion -const CREATENEWVERSION__CREATENEWVERSION__RUN_TURNSTYLE__STEP_MOCK = utils.createMockStep('Run turnstyle', 'Run turnstyle', 'CREATENEWVERSION', ['poll-interval-seconds'], ['GITHUB_TOKEN']); -const CREATENEWVERSION__CREATENEWVERSION__CHECK_OUT__STEP_MOCK = utils.createMockStep('Check out', 'Check out', 'CREATENEWVERSION', ['ref', 'token'], []); -const CREATENEWVERSION__CREATENEWVERSION__SETUP_GIT_FOR_OSBOTIFY__STEP_MOCK = utils.createMockStep( - 'Setup git for OSBotify', - 'Setup git for OSBotify', - 'CREATENEWVERSION', - ['GPG_PASSPHRASE'], - [], -); -const CREATENEWVERSION__CREATENEWVERSION__GENERATE_VERSION__STEP_MOCK = utils.createMockStep( - 'Generate version', - 'Generate version', - 'CREATENEWVERSION', - ['GITHUB_TOKEN', 'SEMVER_LEVEL'], - [], -); -const CREATENEWVERSION__CREATENEWVERSION__COMMIT_NEW_VERSION__STEP_MOCK = utils.createMockStep('Commit new version', 'Commit new version', 'CREATENEWVERSION', [], []); -const CREATENEWVERSION__CREATENEWVERSION__UPDATE_MAIN_BRANCH__STEP_MOCK = utils.createMockStep('Update main branch', 'Update main branch', 'CREATENEWVERSION', [], []); -const CREATENEWVERSION__CREATENEWVERSION__ANNOUNCE_FAILED_WORKFLOW_IN_SLACK__STEP_MOCK = utils.createMockStep( +const CREATENEWVERSION__CREATENEWVERSION__RUN_TURNSTYLE__STEP_MOCK = createMockStep('Run turnstyle', 'Run turnstyle', 'CREATENEWVERSION', ['poll-interval-seconds'], ['GITHUB_TOKEN']); +const CREATENEWVERSION__CREATENEWVERSION__CHECK_OUT__STEP_MOCK = createMockStep('Check out', 'Check out', 'CREATENEWVERSION', ['ref', 'token'], []); +const CREATENEWVERSION__CREATENEWVERSION__SETUP_GIT_FOR_OSBOTIFY__STEP_MOCK = createMockStep('Setup git for OSBotify', 'Setup git for OSBotify', 'CREATENEWVERSION', ['GPG_PASSPHRASE'], []); +const CREATENEWVERSION__CREATENEWVERSION__GENERATE_VERSION__STEP_MOCK = createMockStep('Generate version', 'Generate version', 'CREATENEWVERSION', ['GITHUB_TOKEN', 'SEMVER_LEVEL'], []); +const CREATENEWVERSION__CREATENEWVERSION__COMMIT_NEW_VERSION__STEP_MOCK = createMockStep('Commit new version', 'Commit new version', 'CREATENEWVERSION', [], []); +const CREATENEWVERSION__CREATENEWVERSION__UPDATE_MAIN_BRANCH__STEP_MOCK = createMockStep('Update main branch', 'Update main branch', 'CREATENEWVERSION', [], []); +const CREATENEWVERSION__CREATENEWVERSION__ANNOUNCE_FAILED_WORKFLOW_IN_SLACK__STEP_MOCK = createMockStep( 'Announce failed workflow in Slack', 'Announce failed workflow in Slack', 'CREATENEWVERSION', @@ -50,7 +39,7 @@ const CREATENEWVERSION__CREATENEWVERSION__STEP_MOCKS = [ CREATENEWVERSION__CREATENEWVERSION__ANNOUNCE_FAILED_WORKFLOW_IN_SLACK__STEP_MOCK, ]; -module.exports = { +export { CREATENEWVERSION__VALIDATEACTOR__ADMIN__STEP_MOCKS, CREATENEWVERSION__VALIDATEACTOR__WRITER__STEP_MOCKS, CREATENEWVERSION__VALIDATEACTOR__NO_PERMISSION__STEP_MOCKS, diff --git a/workflow_tests/mocks/deployBlockerMocks.js b/workflow_tests/mocks/deployBlockerMocks.ts similarity index 62% rename from workflow_tests/mocks/deployBlockerMocks.js rename to workflow_tests/mocks/deployBlockerMocks.ts index 4f74e0b91ebb..2280950890a0 100644 --- a/workflow_tests/mocks/deployBlockerMocks.js +++ b/workflow_tests/mocks/deployBlockerMocks.ts @@ -1,33 +1,28 @@ -const utils = require('../utils/utils'); +/* eslint-disable @typescript-eslint/naming-convention */ +import {createMockStep} from '../utils/utils'; // updateChecklist -const DEPLOYBLOCKER__UPDATECHECKLIST__STEP_MOCK = utils.createMockStep('updateChecklist', 'Run updateChecklist', 'UPDATECHECKLIST'); +const DEPLOYBLOCKER__UPDATECHECKLIST__STEP_MOCK = createMockStep('updateChecklist', 'Run updateChecklist', 'UPDATECHECKLIST'); const DEPLOYBLOCKER__UPDATECHECKLIST__STEP_MOCKS = [DEPLOYBLOCKER__UPDATECHECKLIST__STEP_MOCK]; // deployblocker -const DEPLOYBLOCKER__DEPLOYBLOCKER__CHECKOUT__STEP_MOCK = utils.createMockStep('Checkout', 'Checkout', 'DEPLOYBLOCKER'); -const DEPLOYBLOCKER__DEPLOYBLOCKER__GIVE_LABELS__STEP_MOCK = utils.createMockStep( +const DEPLOYBLOCKER__DEPLOYBLOCKER__CHECKOUT__STEP_MOCK = createMockStep('Checkout', 'Checkout', 'DEPLOYBLOCKER'); +const DEPLOYBLOCKER__DEPLOYBLOCKER__GIVE_LABELS__STEP_MOCK = createMockStep( 'Give the issue/PR the Hourly, Engineering labels', 'Give the issue/PR the Hourly, Engineering labels', 'DEPLOYBLOCKER', [], ['GITHUB_TOKEN'], ); -const DEPLOYBLOCKER__DEPLOYBLOCKER__POST_THE_ISSUE_IN_THE_EXPENSIFY_OPEN_SOURCE_SLACK_ROOM__STEP_MOCK = utils.createMockStep( +const DEPLOYBLOCKER__DEPLOYBLOCKER__POST_THE_ISSUE_IN_THE_EXPENSIFY_OPEN_SOURCE_SLACK_ROOM__STEP_MOCK = createMockStep( 'Post the issue in the #expensify-open-source slack room', 'Post the issue in the expensify-open-source slack room', 'DEPLOYBLOCKER', ['status'], ['GITHUB_TOKEN', 'SLACK_WEBHOOK_URL'], ); -const DEPLOYBLOCKER__DEPLOYBLOCKER__COMMENT_ON_DEPLOY_BLOCKER__STEP_MOCK = utils.createMockStep( - 'Comment on deploy blocker', - 'Comment on deploy blocker', - 'DEPLOYBLOCKER', - [], - ['GITHUB_TOKEN'], -); -const DEPLOYBLOCKER__DEPLOYBLOCKER__ANNOUNCE_FAILED_WORKFLOW_IN_SLACK__STEP_MOCK = utils.createMockStep( +const DEPLOYBLOCKER__DEPLOYBLOCKER__COMMENT_ON_DEPLOY_BLOCKER__STEP_MOCK = createMockStep('Comment on deploy blocker', 'Comment on deploy blocker', 'DEPLOYBLOCKER', [], ['GITHUB_TOKEN']); +const DEPLOYBLOCKER__DEPLOYBLOCKER__ANNOUNCE_FAILED_WORKFLOW_IN_SLACK__STEP_MOCK = createMockStep( 'Announce failed workflow in Slack', 'Announce failed workflow in Slack', 'DEPLOYBLOCKER', @@ -42,7 +37,4 @@ const DEPLOYBLOCKER__DEPLOYBLOCKER__STEP_MOCKS = [ DEPLOYBLOCKER__DEPLOYBLOCKER__ANNOUNCE_FAILED_WORKFLOW_IN_SLACK__STEP_MOCK, ]; -module.exports = { - DEPLOYBLOCKER__UPDATECHECKLIST__STEP_MOCKS, - DEPLOYBLOCKER__DEPLOYBLOCKER__STEP_MOCKS, -}; +export {DEPLOYBLOCKER__UPDATECHECKLIST__STEP_MOCKS, DEPLOYBLOCKER__DEPLOYBLOCKER__STEP_MOCKS}; diff --git a/workflow_tests/mocks/deployMocks.js b/workflow_tests/mocks/deployMocks.js deleted file mode 100644 index 9e8b978f05ac..000000000000 --- a/workflow_tests/mocks/deployMocks.js +++ /dev/null @@ -1,55 +0,0 @@ -const utils = require('../utils/utils'); - -const DEPLOY_STAGING__CHECKOUT__STEP_MOCK = utils.createMockStep('Checkout staging branch', 'Checking out staging branch', 'DEPLOY_STAGING', ['ref', 'token']); -const DEPLOY_STAGING__SETUP_GIT__STEP_MOCK = utils.createMockStep('Setup git for OSBotify', 'Setting up git for OSBotify', 'DEPLOY_STAGING', [ - 'GPG_PASSPHRASE', - 'OS_BOTIFY_APP_ID', - 'OS_BOTIFY_PRIVATE_KEY', -]); -const DEPLOY_STAGING__TAG_VERSION__STEP_MOCK = utils.createMockStep('Tag version', 'Tagging new version', 'DEPLOY_STAGING'); -const DEPLOY_STAGING__PUSH_TAG__STEP_MOCK = utils.createMockStep('🚀 Push tags to trigger staging deploy 🚀', 'Pushing tag to trigger staging deploy', 'DEPLOY_STAGING'); -const DEPLOY_STAGING_STEP_MOCKS = [DEPLOY_STAGING__CHECKOUT__STEP_MOCK, DEPLOY_STAGING__SETUP_GIT__STEP_MOCK, DEPLOY_STAGING__TAG_VERSION__STEP_MOCK, DEPLOY_STAGING__PUSH_TAG__STEP_MOCK]; - -const DEPLOY_PRODUCTION__CHECKOUT__STEP_MOCK = utils.createMockStep('Checkout', 'Checking out', 'DEPLOY_PRODUCTION', ['ref', 'token']); -const DEPLOY_PRODUCTION__SETUP_GIT__STEP_MOCK = utils.createMockStep( - 'Setup git for OSBotify', - 'Setting up git for OSBotify', - 'DEPLOY_PRODUCTION', - ['GPG_PASSPHRASE', 'OS_BOTIFY_APP_ID', 'OS_BOTIFY_PRIVATE_KEY'], - null, - {OS_BOTIFY_API_TOKEN: 'os_botify_api_token'}, -); -const DEPLOY_PRODUCTION__CURRENT_APP_VERSION__STEP_MOCK = utils.createMockStep('Get current app version', 'Getting current app version', 'DEPLOY_PRODUCTION', null, null, null, { - PRODUCTION_VERSION: '1.2.3', -}); -const DEPLOY_PRODUCTION__RELEASE_PR_LIST__STEP_MOCK = utils.createMockStep( - 'Get Release Pull Request List', - 'Getting release PR list', - 'DEPLOY_PRODUCTION', - ['TAG', 'GITHUB_TOKEN', 'IS_PRODUCTION_DEPLOY'], - null, - {PR_LIST: '["1.2.1", "1.2.2"]'}, -); -const DEPLOY_PRODUCTION__GENERATE_RELEASE_BODY__STEP_MOCK = utils.createMockStep('Generate Release Body', 'Generating release body', 'DEPLOY_PRODUCTION', ['PR_LIST'], null, { - RELEASE_BODY: 'Release body', -}); -const DEPLOY_PRODUCTION__CREATE_RELEASE__STEP_MOCK = utils.createMockStep( - '🚀 Create release to trigger production deploy 🚀', - 'Creating release to trigger production deploy', - 'DEPLOY_PRODUCTION', - ['tag_name', 'body'], - ['GITHUB_TOKEN'], -); -const DEPLOY_PRODUCTION_STEP_MOCKS = [ - DEPLOY_PRODUCTION__CHECKOUT__STEP_MOCK, - DEPLOY_PRODUCTION__SETUP_GIT__STEP_MOCK, - DEPLOY_PRODUCTION__CURRENT_APP_VERSION__STEP_MOCK, - DEPLOY_PRODUCTION__RELEASE_PR_LIST__STEP_MOCK, - DEPLOY_PRODUCTION__GENERATE_RELEASE_BODY__STEP_MOCK, - DEPLOY_PRODUCTION__CREATE_RELEASE__STEP_MOCK, -]; - -module.exports = { - DEPLOY_STAGING_STEP_MOCKS, - DEPLOY_PRODUCTION_STEP_MOCKS, -}; diff --git a/workflow_tests/mocks/deployMocks.ts b/workflow_tests/mocks/deployMocks.ts new file mode 100644 index 000000000000..5888320a87b2 --- /dev/null +++ b/workflow_tests/mocks/deployMocks.ts @@ -0,0 +1,53 @@ +/* eslint-disable @typescript-eslint/naming-convention */ +import {createMockStep} from '../utils/utils'; + +const DEPLOY_STAGING__CHECKOUT__STEP_MOCK = createMockStep('Checkout staging branch', 'Checking out staging branch', 'DEPLOY_STAGING', ['ref', 'token']); +const DEPLOY_STAGING__SETUP_GIT__STEP_MOCK = createMockStep('Setup git for OSBotify', 'Setting up git for OSBotify', 'DEPLOY_STAGING', [ + 'GPG_PASSPHRASE', + 'OS_BOTIFY_APP_ID', + 'OS_BOTIFY_PRIVATE_KEY', +]); +const DEPLOY_STAGING__TAG_VERSION__STEP_MOCK = createMockStep('Tag version', 'Tagging new version', 'DEPLOY_STAGING'); +const DEPLOY_STAGING__PUSH_TAG__STEP_MOCK = createMockStep('🚀 Push tags to trigger staging deploy 🚀', 'Pushing tag to trigger staging deploy', 'DEPLOY_STAGING'); +const DEPLOY_STAGING_STEP_MOCKS = [DEPLOY_STAGING__CHECKOUT__STEP_MOCK, DEPLOY_STAGING__SETUP_GIT__STEP_MOCK, DEPLOY_STAGING__TAG_VERSION__STEP_MOCK, DEPLOY_STAGING__PUSH_TAG__STEP_MOCK]; + +const DEPLOY_PRODUCTION__CHECKOUT__STEP_MOCK = createMockStep('Checkout', 'Checking out', 'DEPLOY_PRODUCTION', ['ref', 'token']); +const DEPLOY_PRODUCTION__SETUP_GIT__STEP_MOCK = createMockStep( + 'Setup git for OSBotify', + 'Setting up git for OSBotify', + 'DEPLOY_PRODUCTION', + ['GPG_PASSPHRASE', 'OS_BOTIFY_APP_ID', 'OS_BOTIFY_PRIVATE_KEY'], + null, + {OS_BOTIFY_API_TOKEN: 'os_botify_api_token'}, +); +const DEPLOY_PRODUCTION__CURRENT_APP_VERSION__STEP_MOCK = createMockStep('Get current app version', 'Getting current app version', 'DEPLOY_PRODUCTION', null, null, null, { + PRODUCTION_VERSION: '1.2.3', +}); +const DEPLOY_PRODUCTION__RELEASE_PR_LIST__STEP_MOCK = createMockStep( + 'Get Release Pull Request List', + 'Getting release PR list', + 'DEPLOY_PRODUCTION', + ['TAG', 'GITHUB_TOKEN', 'IS_PRODUCTION_DEPLOY'], + null, + {PR_LIST: '["1.2.1", "1.2.2"]'}, +); +const DEPLOY_PRODUCTION__GENERATE_RELEASE_BODY__STEP_MOCK = createMockStep('Generate Release Body', 'Generating release body', 'DEPLOY_PRODUCTION', ['PR_LIST'], null, { + RELEASE_BODY: 'Release body', +}); +const DEPLOY_PRODUCTION__CREATE_RELEASE__STEP_MOCK = createMockStep( + '🚀 Create release to trigger production deploy 🚀', + 'Creating release to trigger production deploy', + 'DEPLOY_PRODUCTION', + ['tag_name', 'body'], + ['GITHUB_TOKEN'], +); +const DEPLOY_PRODUCTION_STEP_MOCKS = [ + DEPLOY_PRODUCTION__CHECKOUT__STEP_MOCK, + DEPLOY_PRODUCTION__SETUP_GIT__STEP_MOCK, + DEPLOY_PRODUCTION__CURRENT_APP_VERSION__STEP_MOCK, + DEPLOY_PRODUCTION__RELEASE_PR_LIST__STEP_MOCK, + DEPLOY_PRODUCTION__GENERATE_RELEASE_BODY__STEP_MOCK, + DEPLOY_PRODUCTION__CREATE_RELEASE__STEP_MOCK, +]; + +export {DEPLOY_STAGING_STEP_MOCKS, DEPLOY_PRODUCTION_STEP_MOCKS}; diff --git a/workflow_tests/mocks/failureNotifierMocks.js b/workflow_tests/mocks/failureNotifierMocks.ts similarity index 56% rename from workflow_tests/mocks/failureNotifierMocks.js rename to workflow_tests/mocks/failureNotifierMocks.ts index 6d37f08ff7ac..cbea6fce95ae 100644 --- a/workflow_tests/mocks/failureNotifierMocks.js +++ b/workflow_tests/mocks/failureNotifierMocks.ts @@ -1,11 +1,13 @@ +/* eslint-disable @typescript-eslint/naming-convention */ + /* eslint-disable rulesdir/no-negated-variables */ -const utils = require('../utils/utils'); +import {createMockStep} from '../utils/utils'; // notifyfailure -const FAILURENOTIFIER__NOTIFYFAILURE__FETCH_WORKFLOW_RUN_JOBS__STEP_MOCK = utils.createMockStep('Fetch Workflow Run Jobs', 'Fetch Workflow Run Jobs', 'NOTIFYFAILURE', [], []); -const FAILURENOTIFIER__NOTIFYFAILURE__PROCESS_EACH_FAILED_JOB__STEP_MOCK = utils.createMockStep('Process Each Failed Job', 'Process Each Failed Job', 'NOTIFYFAILURE', [], []); +const FAILURENOTIFIER__NOTIFYFAILURE__FETCH_WORKFLOW_RUN_JOBS__STEP_MOCK = createMockStep('Fetch Workflow Run Jobs', 'Fetch Workflow Run Jobs', 'NOTIFYFAILURE', [], []); +const FAILURENOTIFIER__NOTIFYFAILURE__PROCESS_EACH_FAILED_JOB__STEP_MOCK = createMockStep('Process Each Failed Job', 'Process Each Failed Job', 'NOTIFYFAILURE', [], []); const FAILURENOTIFIER__NOTIFYFAILURE__STEP_MOCKS = [FAILURENOTIFIER__NOTIFYFAILURE__FETCH_WORKFLOW_RUN_JOBS__STEP_MOCK, FAILURENOTIFIER__NOTIFYFAILURE__PROCESS_EACH_FAILED_JOB__STEP_MOCK]; -module.exports = { +export default { FAILURENOTIFIER__NOTIFYFAILURE__STEP_MOCKS, }; diff --git a/workflow_tests/mocks/finishReleaseCycleMocks.js b/workflow_tests/mocks/finishReleaseCycleMocks.ts similarity index 85% rename from workflow_tests/mocks/finishReleaseCycleMocks.js rename to workflow_tests/mocks/finishReleaseCycleMocks.ts index 29e0842852dc..86493fb077c9 100644 --- a/workflow_tests/mocks/finishReleaseCycleMocks.js +++ b/workflow_tests/mocks/finishReleaseCycleMocks.ts @@ -1,8 +1,9 @@ -const utils = require('../utils/utils'); +/* eslint-disable @typescript-eslint/naming-convention */ +import {createMockStep} from '../utils/utils'; // validate -const FINISHRELEASECYCLE__VALIDATE__CHECKOUT__STEP_MOCK = utils.createMockStep('Checkout', 'Checkout', 'VALIDATE', ['ref', 'token']); -const FINISHRELEASECYCLE__VALIDATE__SETUP_GIT_FOR_OSBOTIFY__STEP_MOCK = utils.createMockStep( +const FINISHRELEASECYCLE__VALIDATE__CHECKOUT__STEP_MOCK = createMockStep('Checkout', 'Checkout', 'VALIDATE', ['ref', 'token']); +const FINISHRELEASECYCLE__VALIDATE__SETUP_GIT_FOR_OSBOTIFY__STEP_MOCK = createMockStep( 'Setup git for OSBotify', 'Setup git for OSBotify', 'VALIDATE', @@ -10,7 +11,7 @@ const FINISHRELEASECYCLE__VALIDATE__SETUP_GIT_FOR_OSBOTIFY__STEP_MOCK = utils.cr [], {OS_BOTIFY_API_TOKEN: 'os_botify_api_token'}, ); -const FINISHRELEASECYCLE__VALIDATE__VALIDATE_ACTOR_IS_DEPLOYER_TRUE__STEP_MOCK = utils.createMockStep( +const FINISHRELEASECYCLE__VALIDATE__VALIDATE_ACTOR_IS_DEPLOYER_TRUE__STEP_MOCK = createMockStep( 'Validate actor is deployer', 'Validating if actor is deployer', 'VALIDATE', @@ -18,7 +19,7 @@ const FINISHRELEASECYCLE__VALIDATE__VALIDATE_ACTOR_IS_DEPLOYER_TRUE__STEP_MOCK = ['GITHUB_TOKEN'], {IS_DEPLOYER: true}, ); -const FINISHRELEASECYCLE__VALIDATE__VALIDATE_ACTOR_IS_DEPLOYER_FALSE__STEP_MOCK = utils.createMockStep( +const FINISHRELEASECYCLE__VALIDATE__VALIDATE_ACTOR_IS_DEPLOYER_FALSE__STEP_MOCK = createMockStep( 'Validate actor is deployer', 'Validating if actor is deployer', 'VALIDATE', @@ -27,14 +28,14 @@ const FINISHRELEASECYCLE__VALIDATE__VALIDATE_ACTOR_IS_DEPLOYER_FALSE__STEP_MOCK {IS_DEPLOYER: false}, ); // eslint-disable-next-line rulesdir/no-negated-variables -const FINISHRELEASECYCLE__VALIDATE__REOPEN_AND_COMMENT_ON_ISSUE_NOT_A_TEAM_MEMBER__STEP_MOCK = utils.createMockStep( +const FINISHRELEASECYCLE__VALIDATE__REOPEN_AND_COMMENT_ON_ISSUE_NOT_A_TEAM_MEMBER__STEP_MOCK = createMockStep( 'Reopen and comment on issue (not a team member)', 'Reopening issue - not a team member', 'VALIDATE', ['GITHUB_TOKEN', 'ISSUE_NUMBER', 'COMMENT'], [], ); -const FINISHRELEASECYCLE__VALIDATE__CHECK_FOR_ANY_DEPLOY_BLOCKERS_FALSE__STEP_MOCK = utils.createMockStep( +const FINISHRELEASECYCLE__VALIDATE__CHECK_FOR_ANY_DEPLOY_BLOCKERS_FALSE__STEP_MOCK = createMockStep( 'Check for any deploy blockers', 'Checking for deploy blockers', 'VALIDATE', @@ -42,7 +43,7 @@ const FINISHRELEASECYCLE__VALIDATE__CHECK_FOR_ANY_DEPLOY_BLOCKERS_FALSE__STEP_MO [], {HAS_DEPLOY_BLOCKERS: false}, ); -const FINISHRELEASECYCLE__VALIDATE__CHECK_FOR_ANY_DEPLOY_BLOCKERS_TRUE__STEP_MOCK = utils.createMockStep( +const FINISHRELEASECYCLE__VALIDATE__CHECK_FOR_ANY_DEPLOY_BLOCKERS_TRUE__STEP_MOCK = createMockStep( 'Check for any deploy blockers', 'Checking for deploy blockers', 'VALIDATE', @@ -50,14 +51,14 @@ const FINISHRELEASECYCLE__VALIDATE__CHECK_FOR_ANY_DEPLOY_BLOCKERS_TRUE__STEP_MOC [], {HAS_DEPLOY_BLOCKERS: true}, ); -const FINISHRELEASECYCLE__VALIDATE__REOPEN_AND_COMMENT_ON_ISSUE_HAS_BLOCKERS__STEP_MOCK = utils.createMockStep( +const FINISHRELEASECYCLE__VALIDATE__REOPEN_AND_COMMENT_ON_ISSUE_HAS_BLOCKERS__STEP_MOCK = createMockStep( 'Reopen and comment on issue (has blockers)', 'Reopening issue - blockers', 'VALIDATE', ['GITHUB_TOKEN', 'ISSUE_NUMBER'], [], ); -const FINISHRELEASECYCLE__VALIDATE__ANNOUNCE_FAILED_WORKFLOW_IN_SLACK__STEP_MOCK = utils.createMockStep( +const FINISHRELEASECYCLE__VALIDATE__ANNOUNCE_FAILED_WORKFLOW_IN_SLACK__STEP_MOCK = createMockStep( 'Announce failed workflow in Slack', 'Announce failed workflow in Slack', 'VALIDATE', @@ -104,16 +105,16 @@ const FINISHRELEASECYCLE__VALIDATE__NOT_TEAM_MEMBER_BLOCKERS__STEP_MOCKS = [ ]; // updateproduction -const FINISHRELEASECYCLE__UPDATEPRODUCTION__CHECKOUT__STEP_MOCK = utils.createMockStep('Checkout', 'Checkout', 'UPDATEPRODUCTION', ['ref', 'token'], []); -const FINISHRELEASECYCLE__UPDATEPRODUCTION__SETUP_GIT_FOR_OSBOTIFY__STEP_MOCK = utils.createMockStep( +const FINISHRELEASECYCLE__UPDATEPRODUCTION__CHECKOUT__STEP_MOCK = createMockStep('Checkout', 'Checkout', 'UPDATEPRODUCTION', ['ref', 'token'], []); +const FINISHRELEASECYCLE__UPDATEPRODUCTION__SETUP_GIT_FOR_OSBOTIFY__STEP_MOCK = createMockStep( 'Setup git for OSBotify', 'Setup git for OSBotify', 'UPDATEPRODUCTION', ['GPG_PASSPHRASE'], [], ); -const FINISHRELEASECYCLE__UPDATEPRODUCTION__UPDATE_PRODUCTION_BRANCH__STEP_MOCK = utils.createMockStep('Update production branch', 'Updating production branch', 'UPDATEPRODUCTION', [], []); -const FINISHRELEASECYCLE__UPDATEPRODUCTION__ANNOUNCE_FAILED_WORKFLOW_IN_SLACK__STEP_MOCK = utils.createMockStep( +const FINISHRELEASECYCLE__UPDATEPRODUCTION__UPDATE_PRODUCTION_BRANCH__STEP_MOCK = createMockStep('Update production branch', 'Updating production branch', 'UPDATEPRODUCTION', [], []); +const FINISHRELEASECYCLE__UPDATEPRODUCTION__ANNOUNCE_FAILED_WORKFLOW_IN_SLACK__STEP_MOCK = createMockStep( 'Announce failed workflow in Slack', 'Announce failed workflow in Slack', 'UPDATEPRODUCTION', @@ -128,7 +129,7 @@ const FINISHRELEASECYCLE__UPDATEPRODUCTION__STEP_MOCKS = [ ]; // createnewpatchversion -const FINISHRELEASECYCLE__CREATENEWPATCHVERSION__CREATE_NEW_VERSION__STEP_MOCK = utils.createMockStep( +const FINISHRELEASECYCLE__CREATENEWPATCHVERSION__CREATE_NEW_VERSION__STEP_MOCK = createMockStep( 'Create new version', 'Creating new version', 'CREATENEWPATCHVERSION', @@ -142,22 +143,16 @@ const FINISHRELEASECYCLE__CREATENEWPATCHVERSION__CREATE_NEW_VERSION__STEP_MOCK = const FINISHRELEASECYCLE__CREATENEWPATCHVERSION__STEP_MOCKS = [FINISHRELEASECYCLE__CREATENEWPATCHVERSION__CREATE_NEW_VERSION__STEP_MOCK]; // updatestaging -const FINISHRELEASECYCLE__UPDATESTAGING__CHECKOUT__STEP_MOCK = utils.createMockStep('Checkout', 'Checkout', 'UPDATESTAGING', ['ref', 'token'], []); -const FINISHRELEASECYCLE__UPDATESTAGING__SETUP_GIT_FOR_OSBOTIFY__STEP_MOCK = utils.createMockStep( - 'Setup git for OSBotify', - 'Setup git for OSBotify', - 'UPDATESTAGING', - ['GPG_PASSPHRASE'], - [], -); -const FINISHRELEASECYCLE__UPDATESTAGING__UPDATE_STAGING_BRANCH_TO_TRIGGER_STAGING_DEPLOY__STEP_MOCK = utils.createMockStep( +const FINISHRELEASECYCLE__UPDATESTAGING__CHECKOUT__STEP_MOCK = createMockStep('Checkout', 'Checkout', 'UPDATESTAGING', ['ref', 'token'], []); +const FINISHRELEASECYCLE__UPDATESTAGING__SETUP_GIT_FOR_OSBOTIFY__STEP_MOCK = createMockStep('Setup git for OSBotify', 'Setup git for OSBotify', 'UPDATESTAGING', ['GPG_PASSPHRASE'], []); +const FINISHRELEASECYCLE__UPDATESTAGING__UPDATE_STAGING_BRANCH_TO_TRIGGER_STAGING_DEPLOY__STEP_MOCK = createMockStep( 'Update staging branch to trigger staging deploy', 'Updating staging branch', 'UPDATESTAGING', [], [], ); -const FINISHRELEASECYCLE__UPDATESTAGING__ANNOUNCE_FAILED_WORKFLOW_IN_SLACK__STEP_MOCK = utils.createMockStep( +const FINISHRELEASECYCLE__UPDATESTAGING__ANNOUNCE_FAILED_WORKFLOW_IN_SLACK__STEP_MOCK = createMockStep( 'Announce failed workflow in Slack', 'Announce failed workflow in Slack', 'UPDATESTAGING', @@ -171,7 +166,7 @@ const FINISHRELEASECYCLE__UPDATESTAGING__STEP_MOCKS = [ FINISHRELEASECYCLE__UPDATESTAGING__ANNOUNCE_FAILED_WORKFLOW_IN_SLACK__STEP_MOCK, ]; -module.exports = { +export { FINISHRELEASECYCLE__VALIDATE__TEAM_MEMBER_NO_BLOCKERS__STEP_MOCKS, FINISHRELEASECYCLE__VALIDATE__TEAM_MEMBER_BLOCKERS__STEP_MOCKS, FINISHRELEASECYCLE__VALIDATE__NOT_TEAM_MEMBER_NO_BLOCKERS__STEP_MOCKS, diff --git a/workflow_tests/mocks/lintMocks.js b/workflow_tests/mocks/lintMocks.js deleted file mode 100644 index 1fc5dbfd526f..000000000000 --- a/workflow_tests/mocks/lintMocks.js +++ /dev/null @@ -1,19 +0,0 @@ -const utils = require('../utils/utils'); - -// lint -const LINT__LINT__CHECKOUT__STEP_MOCK = utils.createMockStep('Checkout', 'Checkout', 'LINT', [], []); -const LINT__LINT__SETUP_NODE__STEP_MOCK = utils.createMockStep('Setup Node', 'Setup Node', 'LINT', [], []); -const LINT__LINT__LINT_JAVASCRIPT_WITH_ESLINT__STEP_MOCK = utils.createMockStep('Lint JavaScript and Typescript with ESLint', 'Lint JavaScript with ESLint', 'LINT', [], ['CI']); -const LINT__LINT__VERIFY_NO_PRETTIER__STEP_MOCK = utils.createMockStep("Verify there's no Prettier diff", 'Verify theres no Prettier diff', 'LINT'); -const LINT__LINT__RUN_UNUSED_SEARCHER__STEP_MOCK = utils.createMockStep('Run unused style searcher', 'Run unused style searcher', 'LINT'); -const LINT__LINT__STEP_MOCKS = [ - LINT__LINT__CHECKOUT__STEP_MOCK, - LINT__LINT__SETUP_NODE__STEP_MOCK, - LINT__LINT__LINT_JAVASCRIPT_WITH_ESLINT__STEP_MOCK, - LINT__LINT__VERIFY_NO_PRETTIER__STEP_MOCK, - LINT__LINT__RUN_UNUSED_SEARCHER__STEP_MOCK, -]; - -module.exports = { - LINT__LINT__STEP_MOCKS, -}; diff --git a/workflow_tests/mocks/lintMocks.ts b/workflow_tests/mocks/lintMocks.ts new file mode 100644 index 000000000000..851555313cff --- /dev/null +++ b/workflow_tests/mocks/lintMocks.ts @@ -0,0 +1,20 @@ +/* eslint-disable @typescript-eslint/naming-convention */ +import {createMockStep} from '../utils/utils'; + +// lint +const LINT__LINT__CHECKOUT__STEP_MOCK = createMockStep('Checkout', 'Checkout', 'LINT', [], []); +const LINT__LINT__SETUP_NODE__STEP_MOCK = createMockStep('Setup Node', 'Setup Node', 'LINT', [], []); +const LINT__LINT__LINT_JAVASCRIPT_WITH_ESLINT__STEP_MOCK = createMockStep('Lint JavaScript and Typescript with ESLint', 'Lint JavaScript with ESLint', 'LINT', [], ['CI']); +const LINT__LINT__VERIFY_NO_PRETTIER__STEP_MOCK = createMockStep("Verify there's no Prettier diff", 'Verify theres no Prettier diff', 'LINT'); +const LINT__LINT__RUN_UNUSED_SEARCHER__STEP_MOCK = createMockStep('Run unused style searcher', 'Run unused style searcher', 'LINT'); +const LINT__LINT__STEP_MOCKS = [ + LINT__LINT__CHECKOUT__STEP_MOCK, + LINT__LINT__SETUP_NODE__STEP_MOCK, + LINT__LINT__LINT_JAVASCRIPT_WITH_ESLINT__STEP_MOCK, + LINT__LINT__VERIFY_NO_PRETTIER__STEP_MOCK, + LINT__LINT__RUN_UNUSED_SEARCHER__STEP_MOCK, +]; + +export default { + LINT__LINT__STEP_MOCKS, +}; diff --git a/workflow_tests/mocks/lockDeploysMocks.js b/workflow_tests/mocks/lockDeploysMocks.ts similarity index 69% rename from workflow_tests/mocks/lockDeploysMocks.js rename to workflow_tests/mocks/lockDeploysMocks.ts index bb6246a2e1d9..342e2315ac88 100644 --- a/workflow_tests/mocks/lockDeploysMocks.js +++ b/workflow_tests/mocks/lockDeploysMocks.ts @@ -1,22 +1,23 @@ -const utils = require('../utils/utils'); +/* eslint-disable @typescript-eslint/naming-convention */ +import {createMockStep} from '../utils/utils'; // lockstagingdeploys -const LOCKDEPLOYS__LOCKSTAGINGDEPLOYS__CHECKOUT__STEP_MOCK = utils.createMockStep('Checkout', 'Checking out', 'LOCKSTAGINGDEPLOYS', ['ref', 'token'], []); -const LOCKDEPLOYS__LOCKSTAGINGDEPLOYS__WAIT_FOR_STAGING_DEPLOYS_TO_FINISH__STEP_MOCK = utils.createMockStep( +const LOCKDEPLOYS__LOCKSTAGINGDEPLOYS__CHECKOUT__STEP_MOCK = createMockStep('Checkout', 'Checking out', 'LOCKSTAGINGDEPLOYS', ['ref', 'token'], []); +const LOCKDEPLOYS__LOCKSTAGINGDEPLOYS__WAIT_FOR_STAGING_DEPLOYS_TO_FINISH__STEP_MOCK = createMockStep( 'Wait for staging deploys to finish', 'Waiting for staging deploys to finish', 'LOCKSTAGINGDEPLOYS', ['GITHUB_TOKEN'], [], ); -const LOCKDEPLOYS__LOCKSTAGINGDEPLOYS__COMMENT_IN_STAGINGDEPLOYCASH_TO_GIVE_APPLAUSE_THE_GREEN_LIGHT_TO_BEGIN_QA__STEP_MOCK = utils.createMockStep( +const LOCKDEPLOYS__LOCKSTAGINGDEPLOYS__COMMENT_IN_STAGINGDEPLOYCASH_TO_GIVE_APPLAUSE_THE_GREEN_LIGHT_TO_BEGIN_QA__STEP_MOCK = createMockStep( 'Comment in StagingDeployCash to give Applause the 🟢 to begin QA', 'Commenting in StagingDeployCash', 'LOCKSTAGINGDEPLOYS', [], ['GITHUB_TOKEN'], ); -const LOCKDEPLOYS__LOCKSTAGINGDEPLOYS__ANNOUNCE_FAILED_WORKFLOW__STEP_MOCK = utils.createMockStep( +const LOCKDEPLOYS__LOCKSTAGINGDEPLOYS__ANNOUNCE_FAILED_WORKFLOW__STEP_MOCK = createMockStep( 'Announce failed workflow', 'Announcing failed workflow in Slack', 'LOCKSTAGINGDEPLOYS', @@ -30,6 +31,4 @@ const LOCKDEPLOYS__LOCKSTAGINGDEPLOYS__STEP_MOCKS = [ LOCKDEPLOYS__LOCKSTAGINGDEPLOYS__ANNOUNCE_FAILED_WORKFLOW__STEP_MOCK, ]; -module.exports = { - LOCKDEPLOYS__LOCKSTAGINGDEPLOYS__STEP_MOCKS, -}; +export default {LOCKDEPLOYS__LOCKSTAGINGDEPLOYS__STEP_MOCKS}; diff --git a/workflow_tests/mocks/platformDeployMocks.js b/workflow_tests/mocks/platformDeployMocks.ts similarity index 55% rename from workflow_tests/mocks/platformDeployMocks.js rename to workflow_tests/mocks/platformDeployMocks.ts index 3fe8de8cca3d..1a14f488a81d 100644 --- a/workflow_tests/mocks/platformDeployMocks.js +++ b/workflow_tests/mocks/platformDeployMocks.ts @@ -1,7 +1,8 @@ -const utils = require('../utils/utils'); +/* eslint-disable @typescript-eslint/naming-convention */ +import {createMockStep} from '../utils/utils'; // validateActor -const PLATFORM_DEPLOY__VALIDATE_ACTOR__CHECK_USER_DEPLOYER__TEAM_MEMBER__STEP_MOCK = utils.createMockStep( +const PLATFORM_DEPLOY__VALIDATE_ACTOR__CHECK_USER_DEPLOYER__TEAM_MEMBER__STEP_MOCK = createMockStep( 'Check if user is deployer', 'Checking if the user is a deployer', 'VALIDATE_ACTOR', @@ -9,7 +10,7 @@ const PLATFORM_DEPLOY__VALIDATE_ACTOR__CHECK_USER_DEPLOYER__TEAM_MEMBER__STEP_MO ['GITHUB_TOKEN'], {IS_DEPLOYER: true}, ); -const PLATFORM_DEPLOY__VALIDATE_ACTOR__CHECK_USER_DEPLOYER__OUTSIDER__STEP_MOCK = utils.createMockStep( +const PLATFORM_DEPLOY__VALIDATE_ACTOR__CHECK_USER_DEPLOYER__OUTSIDER__STEP_MOCK = createMockStep( 'Check if user is deployer', 'Checking if the user is a deployer', 'VALIDATE_ACTOR', @@ -21,38 +22,38 @@ const PLATFORM_DEPLOY__VALIDATE_ACTOR__TEAM_MEMBER__STEP_MOCKS = [PLATFORM_DEPLO const PLATFORM_DEPLOY__VALIDATE_ACTOR__OUTSIDER__STEP_MOCKS = [PLATFORM_DEPLOY__VALIDATE_ACTOR__CHECK_USER_DEPLOYER__OUTSIDER__STEP_MOCK]; // deployChecklist -const PLATFORM_DEPLOY__DEPLOY_CHECKLIST__STEP_MOCK = utils.createMockStep('deployChecklist', 'Run deployChecklist', 'DEPLOY_CHECKLIST'); +const PLATFORM_DEPLOY__DEPLOY_CHECKLIST__STEP_MOCK = createMockStep('deployChecklist', 'Run deployChecklist', 'DEPLOY_CHECKLIST'); const PLATFORM_DEPLOY__DEPLOY_CHECKLIST__STEP_MOCKS = [PLATFORM_DEPLOY__DEPLOY_CHECKLIST__STEP_MOCK]; // android -const PLATFORM_DEPLOY__ANDROID__CHECKOUT__STEP_MOCK = utils.createMockStep('Checkout', 'Checking out', 'ANDROID'); -const PLATFORM_DEPLOY__ANDROID__CONFIGURE_MAPBOX_SDK__STEP_MOCK = utils.createMockStep('Configure MapBox SDK', 'Configure MapBox SDK', 'ANDROID'); -const PLATFORM_DEPLOY__ANDROID__SETUP_NODE__STEP_MOCK = utils.createMockStep('Setup Node', 'Setting up Node', 'ANDROID'); -const PLATFORM_DEPLOY__ANDROID__SETUP_JAVA__STEP_MOCK = utils.createMockStep('Setup Java', 'Setup Java', 'ANDROID', ['distribution', 'java-version'], []); -const PLATFORM_DEPLOY__ANDROID__SETUP_RUBY__STEP_MOCK = utils.createMockStep('Setup Ruby', 'Setting up Ruby', 'ANDROID', ['ruby-version', 'bundler-cache']); -const PLATFORM_DEPLOY__ANDROID__DECRYPT_KEYSTORE__STEP_MOCK = utils.createMockStep('Decrypt keystore', 'Decrypting keystore', 'ANDROID', null, ['LARGE_SECRET_PASSPHRASE']); -const PLATFORM_DEPLOY__ANDROID__DECRYPT_JSON_KEY__STEP_MOCK = utils.createMockStep('Decrypt json key', 'Decrypting JSON key', 'ANDROID', null, ['LARGE_SECRET_PASSPHRASE']); -const PLATFORM_DEPLOY__ANDROID__SET_VERSION__STEP_MOCK = utils.createMockStep('Set version in ENV', 'Setting version in ENV', 'ANDROID', null, null, null, {VERSION_CODE: '1.2.3'}); -const PLATFORM_DEPLOY__ANDROID__FASTLANE_BETA__STEP_MOCK = utils.createMockStep('Run Fastlane beta', 'Running Fastlane beta', 'ANDROID', null, [ +const PLATFORM_DEPLOY__ANDROID__CHECKOUT__STEP_MOCK = createMockStep('Checkout', 'Checking out', 'ANDROID'); +const PLATFORM_DEPLOY__ANDROID__CONFIGURE_MAPBOX_SDK__STEP_MOCK = createMockStep('Configure MapBox SDK', 'Configure MapBox SDK', 'ANDROID'); +const PLATFORM_DEPLOY__ANDROID__SETUP_NODE__STEP_MOCK = createMockStep('Setup Node', 'Setting up Node', 'ANDROID'); +const PLATFORM_DEPLOY__ANDROID__SETUP_JAVA__STEP_MOCK = createMockStep('Setup Java', 'Setup Java', 'ANDROID', ['distribution', 'java-version'], []); +const PLATFORM_DEPLOY__ANDROID__SETUP_RUBY__STEP_MOCK = createMockStep('Setup Ruby', 'Setting up Ruby', 'ANDROID', ['ruby-version', 'bundler-cache']); +const PLATFORM_DEPLOY__ANDROID__DECRYPT_KEYSTORE__STEP_MOCK = createMockStep('Decrypt keystore', 'Decrypting keystore', 'ANDROID', null, ['LARGE_SECRET_PASSPHRASE']); +const PLATFORM_DEPLOY__ANDROID__DECRYPT_JSON_KEY__STEP_MOCK = createMockStep('Decrypt json key', 'Decrypting JSON key', 'ANDROID', null, ['LARGE_SECRET_PASSPHRASE']); +const PLATFORM_DEPLOY__ANDROID__SET_VERSION__STEP_MOCK = createMockStep('Set version in ENV', 'Setting version in ENV', 'ANDROID', null, null, null, {VERSION_CODE: '1.2.3'}); +const PLATFORM_DEPLOY__ANDROID__FASTLANE_BETA__STEP_MOCK = createMockStep('Run Fastlane beta', 'Running Fastlane beta', 'ANDROID', null, [ 'MYAPP_UPLOAD_STORE_PASSWORD', 'MYAPP_UPLOAD_KEY_PASSWORD', ]); -const PLATFORM_DEPLOY__ANDROID__FASTLANE_PRODUCTION__STEP_MOCK = utils.createMockStep('Run Fastlane production', 'Running Fastlane production', 'ANDROID', null, ['VERSION']); -const PLATFORM_DEPLOY__ANDROID__ARCHIVE_SOURCEMAPS__STEP_MOCK = utils.createMockStep('Archive Android sourcemaps', 'Archiving Android sourcemaps', 'ANDROID', ['name', 'path']); -const PLATFORM_DEPLOY__ANDROID__UPLOAD_ANDROID_VERSION_TO_GITHUB_ARTIFACTS__STEP_MOCK = utils.createMockStep( +const PLATFORM_DEPLOY__ANDROID__FASTLANE_PRODUCTION__STEP_MOCK = createMockStep('Run Fastlane production', 'Running Fastlane production', 'ANDROID', null, ['VERSION']); +const PLATFORM_DEPLOY__ANDROID__ARCHIVE_SOURCEMAPS__STEP_MOCK = createMockStep('Archive Android sourcemaps', 'Archiving Android sourcemaps', 'ANDROID', ['name', 'path']); +const PLATFORM_DEPLOY__ANDROID__UPLOAD_ANDROID_VERSION_TO_GITHUB_ARTIFACTS__STEP_MOCK = createMockStep( 'Upload Android version to GitHub artifacts', 'Upload Android version to GitHub artifacts', 'ANDROID', ['name', 'path'], ); -const PLATFORM_DEPLOY__ANDROID__UPLOAD_TO_BROWSER_STACK__STEP_MOCK = utils.createMockStep( +const PLATFORM_DEPLOY__ANDROID__UPLOAD_TO_BROWSER_STACK__STEP_MOCK = createMockStep( 'Upload Android version to Browser Stack', 'Uploading Android version to Browser Stack', 'ANDROID', null, ['BROWSERSTACK'], ); -const PLATFORM_DEPLOY__ANDROID__WARN_DEPLOYERS__STEP_MOCK = utils.createMockStep( +const PLATFORM_DEPLOY__ANDROID__WARN_DEPLOYERS__STEP_MOCK = createMockStep( 'Warn deployers if Android production deploy failed', 'Warning deployers of failed production deploy', 'ANDROID', @@ -77,12 +78,12 @@ const PLATFORM_DEPLOY__ANDROID__STEP_MOCKS = [ ]; // desktop -const PLATFORM_DEPLOY__DESKTOP__CHECKOUT__STEP_MOCK = utils.createMockStep('Checkout', 'Checking out', 'DESKTOP'); -const PLATFORM_DEPLOY__DESKTOP__SETUP_NODE__STEP_MOCK = utils.createMockStep('Setup Node', 'Setting up Node', 'DESKTOP'); -const PLATFORM_DEPLOY__DESKTOP__DECRYPT_ID__STEP_MOCK = utils.createMockStep('Decrypt Developer ID Certificate', 'Decrypting developer id certificate', 'DESKTOP', null, [ +const PLATFORM_DEPLOY__DESKTOP__CHECKOUT__STEP_MOCK = createMockStep('Checkout', 'Checking out', 'DESKTOP'); +const PLATFORM_DEPLOY__DESKTOP__SETUP_NODE__STEP_MOCK = createMockStep('Setup Node', 'Setting up Node', 'DESKTOP'); +const PLATFORM_DEPLOY__DESKTOP__DECRYPT_ID__STEP_MOCK = createMockStep('Decrypt Developer ID Certificate', 'Decrypting developer id certificate', 'DESKTOP', null, [ 'DEVELOPER_ID_SECRET_PASSPHRASE', ]); -const PLATFORM_DEPLOY__DESKTOP__BUILD_PRODUCTION__STEP_MOCK = utils.createMockStep('Build production desktop app', 'Building production desktop app', 'DESKTOP', null, [ +const PLATFORM_DEPLOY__DESKTOP__BUILD_PRODUCTION__STEP_MOCK = createMockStep('Build production desktop app', 'Building production desktop app', 'DESKTOP', null, [ 'CSC_LINK', 'CSC_KEY_PASSWORD', 'APPLE_ID', @@ -90,7 +91,7 @@ const PLATFORM_DEPLOY__DESKTOP__BUILD_PRODUCTION__STEP_MOCK = utils.createMockSt 'AWS_ACCESS_KEY_ID', 'AWS_SECRET_ACCESS_KEY', ]); -const PLATFORM_DEPLOY__DESKTOP__BUILD_STAGING__STEP_MOCK = utils.createMockStep('Build staging desktop app', 'Building staging desktop app', 'DESKTOP', null, [ +const PLATFORM_DEPLOY__DESKTOP__BUILD_STAGING__STEP_MOCK = createMockStep('Build staging desktop app', 'Building staging desktop app', 'DESKTOP', null, [ 'CSC_LINK', 'CSC_KEY_PASSWORD', 'APPLE_ID', @@ -107,47 +108,40 @@ const PLATFORM_DEPLOY__DESKTOP__STEP_MOCKS = [ ]; // ios -const PLATFORM_DEPLOY__IOS__CHECKOUT__STEP_MOCK = utils.createMockStep('Checkout', 'Checking out', 'IOS'); -const PLATFORM_DEPLOY__IOS__CONFIGURE_MAPBOX_SDK__STEP_MOCK = utils.createMockStep('Configure MapBox SDK', 'Configure MapBox SDK', 'IOS'); -const PLATFORM_DEPLOY__IOS__SETUP_NODE__STEP_MOCK = utils.createMockStep('Setup Node', 'Setting up Node', 'IOS'); -const PLATFORM_DEPLOY__IOS__SETUP_RUBY__STEP_MOCK = utils.createMockStep('Setup Ruby', 'Setting up Ruby', 'IOS', ['ruby-version', 'bundler-cache']); -const PLATFORM_DEPLOY__IOS__CACHE_POD_DEPENDENCIES__STEP_MOCK = utils.createMockStep('Cache Pod dependencies', 'Cache Pod dependencies', 'IOS', ['path', 'key', 'restore-keys'], [], { +const PLATFORM_DEPLOY__IOS__CHECKOUT__STEP_MOCK = createMockStep('Checkout', 'Checking out', 'IOS'); +const PLATFORM_DEPLOY__IOS__CONFIGURE_MAPBOX_SDK__STEP_MOCK = createMockStep('Configure MapBox SDK', 'Configure MapBox SDK', 'IOS'); +const PLATFORM_DEPLOY__IOS__SETUP_NODE__STEP_MOCK = createMockStep('Setup Node', 'Setting up Node', 'IOS'); +const PLATFORM_DEPLOY__IOS__SETUP_RUBY__STEP_MOCK = createMockStep('Setup Ruby', 'Setting up Ruby', 'IOS', ['ruby-version', 'bundler-cache']); +const PLATFORM_DEPLOY__IOS__CACHE_POD_DEPENDENCIES__STEP_MOCK = createMockStep('Cache Pod dependencies', 'Cache Pod dependencies', 'IOS', ['path', 'key', 'restore-keys'], [], { 'cache-hit': false, }); -const PLATFORM_DEPLOY__IOS__COMPARE_PODFILE_AND_MANIFEST__STEP_MOCK = utils.createMockStep( - 'Compare Podfile.lock and Manifest.lock', - 'Compare Podfile.lock and Manifest.lock', - 'IOS', - [], - [], - {IS_PODFILE_SAME_AS_MANIFEST: false}, -); -const PLATFORM_DEPLOY__IOS__COCOAPODS__STEP_MOCK = utils.createMockStep('Install cocoapods', 'Installing cocoapods', 'IOS', ['timeout_minutes', 'max_attempts', 'command']); -const PLATFORM_DEPLOY__IOS__DECRYPT_APPSTORE_PROFILE__STEP_MOCK = utils.createMockStep('Decrypt AppStore profile', 'Decrypting profile', 'IOS', null, ['LARGE_SECRET_PASSPHRASE']); -const PLATFORM_DEPLOY__IOS__DECRYPT_APPSTORE_NSE_PROFILE__STEP_MOCK = utils.createMockStep('Decrypt AppStore Notification Service profile', 'Decrypting profile', 'IOS', null, [ +const PLATFORM_DEPLOY__IOS__COMPARE_PODFILE_AND_MANIFEST__STEP_MOCK = createMockStep('Compare Podfile.lock and Manifest.lock', 'Compare Podfile.lock and Manifest.lock', 'IOS', [], [], { + IS_PODFILE_SAME_AS_MANIFEST: false, +}); +const PLATFORM_DEPLOY__IOS__COCOAPODS__STEP_MOCK = createMockStep('Install cocoapods', 'Installing cocoapods', 'IOS', ['timeout_minutes', 'max_attempts', 'command']); +const PLATFORM_DEPLOY__IOS__DECRYPT_APPSTORE_PROFILE__STEP_MOCK = createMockStep('Decrypt AppStore profile', 'Decrypting profile', 'IOS', null, ['LARGE_SECRET_PASSPHRASE']); +const PLATFORM_DEPLOY__IOS__DECRYPT_APPSTORE_NSE_PROFILE__STEP_MOCK = createMockStep('Decrypt AppStore Notification Service profile', 'Decrypting profile', 'IOS', null, [ 'LARGE_SECRET_PASSPHRASE', ]); -const PLATFORM_DEPLOY__IOS__DECRYPT_CERTIFICATE__STEP_MOCK = utils.createMockStep('Decrypt certificate', 'Decrypting certificate', 'IOS', null, ['LARGE_SECRET_PASSPHRASE']); -const PLATFORM_DEPLOY__IOS__DECRYPT_APP_STORE_API_KEY__STEP_MOCK = utils.createMockStep('Decrypt App Store Connect API key', 'Decrypting App Store API key', 'IOS', null, [ +const PLATFORM_DEPLOY__IOS__DECRYPT_CERTIFICATE__STEP_MOCK = createMockStep('Decrypt certificate', 'Decrypting certificate', 'IOS', null, ['LARGE_SECRET_PASSPHRASE']); +const PLATFORM_DEPLOY__IOS__DECRYPT_APP_STORE_API_KEY__STEP_MOCK = createMockStep('Decrypt App Store Connect API key', 'Decrypting App Store API key', 'IOS', null, [ 'LARGE_SECRET_PASSPHRASE', ]); -const PLATFORM_DEPLOY__IOS__FASTLANE__STEP_MOCK = utils.createMockStep('Run Fastlane', 'Running Fastlane', 'IOS', null, [ +const PLATFORM_DEPLOY__IOS__FASTLANE__STEP_MOCK = createMockStep('Run Fastlane', 'Running Fastlane', 'IOS', null, [ 'APPLE_CONTACT_EMAIL', 'APPLE_CONTACT_PHONE', 'APPLE_DEMO_EMAIL', 'APPLE_DEMO_PASSWORD', ]); -const PLATFORM_DEPLOY__IOS__ARCHIVE_SOURCEMAPS__STEP_MOCK = utils.createMockStep('Archive iOS sourcemaps', 'Archiving sourcemaps', 'IOS', ['name', 'path']); -const PLATFORM_DEPLOY__IOS__UPLOAD_IOS_VERSION_TO_GITHUB_ARTIFACTS__STEP_MOCK = utils.createMockStep( - 'Upload iOS version to GitHub artifacts', - 'Upload iOS version to GitHub artifacts', - 'IOS', - ['name', 'path'], -); -const PLATFORM_DEPLOY__IOS__UPLOAD_BROWSERSTACK__STEP_MOCK = utils.createMockStep('Upload iOS version to Browser Stack', 'Uploading version to Browser Stack', 'IOS', null, ['BROWSERSTACK']); -const PLATFORM_DEPLOY__IOS__SET_VERSION__STEP_MOCK = utils.createMockStep('Set iOS version in ENV', 'Setting iOS version', 'IOS', null, null, null, {IOS_VERSION: '1.2.3'}); -const PLATFORM_DEPLOY__IOS__RELEASE_FASTLANE__STEP_MOCK = utils.createMockStep('Run Fastlane for App Store release', 'Running Fastlane for release', 'IOS', null, ['VERSION']); -const PLATFORM_DEPLOY__IOS__WARN_FAIL__STEP_MOCK = utils.createMockStep( +const PLATFORM_DEPLOY__IOS__ARCHIVE_SOURCEMAPS__STEP_MOCK = createMockStep('Archive iOS sourcemaps', 'Archiving sourcemaps', 'IOS', ['name', 'path']); +const PLATFORM_DEPLOY__IOS__UPLOAD_IOS_VERSION_TO_GITHUB_ARTIFACTS__STEP_MOCK = createMockStep('Upload iOS version to GitHub artifacts', 'Upload iOS version to GitHub artifacts', 'IOS', [ + 'name', + 'path', +]); +const PLATFORM_DEPLOY__IOS__UPLOAD_BROWSERSTACK__STEP_MOCK = createMockStep('Upload iOS version to Browser Stack', 'Uploading version to Browser Stack', 'IOS', null, ['BROWSERSTACK']); +const PLATFORM_DEPLOY__IOS__SET_VERSION__STEP_MOCK = createMockStep('Set iOS version in ENV', 'Setting iOS version', 'IOS', null, null, null, {IOS_VERSION: '1.2.3'}); +const PLATFORM_DEPLOY__IOS__RELEASE_FASTLANE__STEP_MOCK = createMockStep('Run Fastlane for App Store release', 'Running Fastlane for release', 'IOS', null, ['VERSION']); +const PLATFORM_DEPLOY__IOS__WARN_FAIL__STEP_MOCK = createMockStep( 'Warn deployers if iOS production deploy failed', 'Warning developers of failed deploy', 'IOS', @@ -176,22 +170,22 @@ const PLATFORM_DEPLOY__IOS__STEP_MOCKS = [ ]; // web -const PLATFORM_DEPLOY__WEB__CHECKOUT__STEP_MOCK = utils.createMockStep('Checkout', 'Checking out', 'WEB'); -const PLATFORM_DEPLOY__WEB__SETUP_NODE__STEP_MOCK = utils.createMockStep('Setup Node', 'Setting up Node', 'WEB'); -const PLATFORM_DEPLOY__WEB__CLOUDFLARE__STEP_MOCK = utils.createMockStep('Setup Cloudflare CLI', 'Setting up Cloudflare CLI', 'WEB'); -const PLATFORM_DEPLOY__WEB__AWS_CREDENTIALS__STEP_MOCK = utils.createMockStep('Configure AWS Credentials', 'Configuring AWS credentials', 'WEB', [ +const PLATFORM_DEPLOY__WEB__CHECKOUT__STEP_MOCK = createMockStep('Checkout', 'Checking out', 'WEB'); +const PLATFORM_DEPLOY__WEB__SETUP_NODE__STEP_MOCK = createMockStep('Setup Node', 'Setting up Node', 'WEB'); +const PLATFORM_DEPLOY__WEB__CLOUDFLARE__STEP_MOCK = createMockStep('Setup Cloudflare CLI', 'Setting up Cloudflare CLI', 'WEB'); +const PLATFORM_DEPLOY__WEB__AWS_CREDENTIALS__STEP_MOCK = createMockStep('Configure AWS Credentials', 'Configuring AWS credentials', 'WEB', [ 'aws-access-key-id', 'aws-secret-access-key', 'aws-region', ]); -const PLATFORM_DEPLOY__WEB__BUILD_PRODUCTION__STEP_MOCK = utils.createMockStep('Build web for production', 'Building web for production', 'WEB'); -const PLATFORM_DEPLOY__WEB__BUILD_STAGING__STEP_MOCK = utils.createMockStep('Build web for staging', 'Building web for staging', 'WEB'); -const PLATFORM_DEPLOY__WEB__BUILD_STORYBOOK_DOCS_FOR_PRODUCTION__STEP_MOCK = utils.createMockStep('Build storybook docs for production', 'Build storybook docs for production', 'WEB'); -const PLATFORM_DEPLOY__WEB__BUILD_STORYBOOK_DOCS_FOR_STAGING__STEP_MOCK = utils.createMockStep('Build storybook docs for staging', 'Build storybook docs for staging', 'WEB'); -const PLATFORM_DEPLOY__WEB__DEPLOY_PRODUCTION_S3__STEP_MOCK = utils.createMockStep('Deploy production to S3', 'Deploying production to S3', 'WEB'); -const PLATFORM_DEPLOY__WEB__DEPLOY_STAGING_S3__STEP_MOCK = utils.createMockStep('Deploy staging to S3', 'Deploying staging to S3', 'WEB'); -const PLATFORM_DEPLOY__WEB__PURGE_PRODUCTION_CACHE__STEP_MOCK = utils.createMockStep('Purge production Cloudflare cache', 'Purging production Cloudflare cache', 'WEB', null, ['CF_API_KEY']); -const PLATFORM_DEPLOY__WEB__PURGE_STAGING_CACHE__STEP_MOCK = utils.createMockStep('Purge staging Cloudflare cache', 'Purging staging Cloudflare cache', 'WEB', null, ['CF_API_KEY']); +const PLATFORM_DEPLOY__WEB__BUILD_PRODUCTION__STEP_MOCK = createMockStep('Build web for production', 'Building web for production', 'WEB'); +const PLATFORM_DEPLOY__WEB__BUILD_STAGING__STEP_MOCK = createMockStep('Build web for staging', 'Building web for staging', 'WEB'); +const PLATFORM_DEPLOY__WEB__BUILD_STORYBOOK_DOCS_FOR_PRODUCTION__STEP_MOCK = createMockStep('Build storybook docs for production', 'Build storybook docs for production', 'WEB'); +const PLATFORM_DEPLOY__WEB__BUILD_STORYBOOK_DOCS_FOR_STAGING__STEP_MOCK = createMockStep('Build storybook docs for staging', 'Build storybook docs for staging', 'WEB'); +const PLATFORM_DEPLOY__WEB__DEPLOY_PRODUCTION_S3__STEP_MOCK = createMockStep('Deploy production to S3', 'Deploying production to S3', 'WEB'); +const PLATFORM_DEPLOY__WEB__DEPLOY_STAGING_S3__STEP_MOCK = createMockStep('Deploy staging to S3', 'Deploying staging to S3', 'WEB'); +const PLATFORM_DEPLOY__WEB__PURGE_PRODUCTION_CACHE__STEP_MOCK = createMockStep('Purge production Cloudflare cache', 'Purging production Cloudflare cache', 'WEB', null, ['CF_API_KEY']); +const PLATFORM_DEPLOY__WEB__PURGE_STAGING_CACHE__STEP_MOCK = createMockStep('Purge staging Cloudflare cache', 'Purging staging Cloudflare cache', 'WEB', null, ['CF_API_KEY']); const PLATFORM_DEPLOY__WEB__STEP_MOCKS = [ PLATFORM_DEPLOY__WEB__CHECKOUT__STEP_MOCK, PLATFORM_DEPLOY__WEB__SETUP_NODE__STEP_MOCK, @@ -208,29 +202,29 @@ const PLATFORM_DEPLOY__WEB__STEP_MOCKS = [ ]; // post slack message on failure -const PLATFORM_DEPLOY__POST_SLACK_FAIL__POST_SLACK__STEP_MOCK = utils.createMockStep('Post Slack message on failure', 'Posting Slack message on platform deploy failure', 'POST_SLACK_FAIL', [ +const PLATFORM_DEPLOY__POST_SLACK_FAIL__POST_SLACK__STEP_MOCK = createMockStep('Post Slack message on failure', 'Posting Slack message on platform deploy failure', 'POST_SLACK_FAIL', [ 'SLACK_WEBHOOK', ]); const PLATFORM_DEPLOY__POST_SLACK_FAIL__STEP_MOCKS = [PLATFORM_DEPLOY__POST_SLACK_FAIL__POST_SLACK__STEP_MOCK]; // post slack message on success -const PLATFORM_DEPLOY__POST_SLACK_SUCCESS__CHECKOUT__STEP_MOCK = utils.createMockStep('Checkout', 'Checking out', 'POST_SLACK_SUCCESS'); -const PLATFORM_DEPLOY__POST_SLACK_SUCCESS__SET_VERSION__STEP_MOCK = utils.createMockStep('Set version', 'Setting version', 'POST_SLACK_SUCCESS', null, null, null, {VERSION: '1.2.3'}); -const PLATFORM_DEPLOY__POST_SLACK_SUCCESS__ANNOUNCE_CHANNEL__STEP_MOCK = utils.createMockStep( +const PLATFORM_DEPLOY__POST_SLACK_SUCCESS__CHECKOUT__STEP_MOCK = createMockStep('Checkout', 'Checking out', 'POST_SLACK_SUCCESS'); +const PLATFORM_DEPLOY__POST_SLACK_SUCCESS__SET_VERSION__STEP_MOCK = createMockStep('Set version', 'Setting version', 'POST_SLACK_SUCCESS', null, null, null, {VERSION: '1.2.3'}); +const PLATFORM_DEPLOY__POST_SLACK_SUCCESS__ANNOUNCE_CHANNEL__STEP_MOCK = createMockStep( 'Announces the deploy in the #announce Slack room', 'Posting message to \\#announce channel', 'POST_SLACK_SUCCESS', ['status'], ['GITHUB_TOKEN', 'SLACK_WEBHOOK_URL'], ); -const PLATFORM_DEPLOY__POST_SLACK_SUCCESS__DEPLOYER_CHANNEL__STEP_MOCK = utils.createMockStep( +const PLATFORM_DEPLOY__POST_SLACK_SUCCESS__DEPLOYER_CHANNEL__STEP_MOCK = createMockStep( 'Announces the deploy in the #deployer Slack room', 'Posting message to \\#deployer channel', 'POST_SLACK_SUCCESS', ['status'], ['GITHUB_TOKEN', 'SLACK_WEBHOOK_URL'], ); -const PLATFORM_DEPLOY__POST_SLACK_SUCCESS__EXPENSIFY_CHANNEL__STEP_MOCK = utils.createMockStep( +const PLATFORM_DEPLOY__POST_SLACK_SUCCESS__EXPENSIFY_CHANNEL__STEP_MOCK = createMockStep( 'Announces a production deploy in the #expensify-open-source Slack room', 'Posting message to \\#expensify-open-source channel', 'POST_SLACK_SUCCESS', @@ -246,10 +240,10 @@ const PLATFORM_DEPLOY__POST_SLACK_SUCCESS__STEP_MOCKS = [ ]; // post github comment -const PLATFORM_DEPLOY__POST_GIHUB_COMMENT__CHECKOUT__STEP_MOCK = utils.createMockStep('Checkout', 'Checking out', 'POST_GITHUB_COMMENT'); -const PLATFORM_DEPLOY__POST_GIHUB_COMMENT__SETUP_NODE__STEP_MOCK = utils.createMockStep('Setup Node', 'Setting up Node', 'POST_GITHUB_COMMENT'); -const PLATFORM_DEPLOY__POST_GIHUB_COMMENT__SET_VERSION__STEP_MOCK = utils.createMockStep('Set version', 'Setting version', 'POST_GITHUB_COMMENT', null, null, null, {VERSION: '1.2.3'}); -const PLATFORM_DEPLOY__POST_GIHUB_COMMENT__GET_PR_LIST__STEP_MOCK = utils.createMockStep( +const PLATFORM_DEPLOY__POST_GIHUB_COMMENT__CHECKOUT__STEP_MOCK = createMockStep('Checkout', 'Checking out', 'POST_GITHUB_COMMENT'); +const PLATFORM_DEPLOY__POST_GIHUB_COMMENT__SETUP_NODE__STEP_MOCK = createMockStep('Setup Node', 'Setting up Node', 'POST_GITHUB_COMMENT'); +const PLATFORM_DEPLOY__POST_GIHUB_COMMENT__SET_VERSION__STEP_MOCK = createMockStep('Set version', 'Setting version', 'POST_GITHUB_COMMENT', null, null, null, {VERSION: '1.2.3'}); +const PLATFORM_DEPLOY__POST_GIHUB_COMMENT__GET_PR_LIST__STEP_MOCK = createMockStep( 'Get Release Pull Request List', 'Getting release pull request list', 'POST_GITHUB_COMMENT', @@ -257,7 +251,7 @@ const PLATFORM_DEPLOY__POST_GIHUB_COMMENT__GET_PR_LIST__STEP_MOCK = utils.create null, {PR_LIST: '[1.2.1, 1.2.2]'}, ); -const PLATFORM_DEPLOY__POST_GIHUB_COMMENT__COMMENT__STEP_MOCK = utils.createMockStep('Comment on issues', 'Commenting on issues', 'POST_GITHUB_COMMENT', [ +const PLATFORM_DEPLOY__POST_GIHUB_COMMENT__COMMENT__STEP_MOCK = createMockStep('Comment on issues', 'Commenting on issues', 'POST_GITHUB_COMMENT', [ 'PR_LIST', 'IS_PRODUCTION_DEPLOY', 'DEPLOY_VERSION', @@ -275,7 +269,7 @@ const PLATFORM_DEPLOY__POST_GITHUB_COMMENT__STEP_MOCKS = [ PLATFORM_DEPLOY__POST_GIHUB_COMMENT__COMMENT__STEP_MOCK, ]; -module.exports = { +export { PLATFORM_DEPLOY__VALIDATE_ACTOR__TEAM_MEMBER__STEP_MOCKS, PLATFORM_DEPLOY__VALIDATE_ACTOR__OUTSIDER__STEP_MOCKS, PLATFORM_DEPLOY__ANDROID__STEP_MOCKS, diff --git a/workflow_tests/mocks/preDeployMocks.js b/workflow_tests/mocks/preDeployMocks.ts similarity index 51% rename from workflow_tests/mocks/preDeployMocks.js rename to workflow_tests/mocks/preDeployMocks.ts index daadf3d0c743..d9da9d51bd85 100644 --- a/workflow_tests/mocks/preDeployMocks.js +++ b/workflow_tests/mocks/preDeployMocks.ts @@ -1,19 +1,20 @@ -const utils = require('../utils/utils'); +/* eslint-disable @typescript-eslint/naming-convention */ +import {createMockStep} from '../utils/utils'; // typecheck -const TYPECHECK_WORKFLOW_MOCK_STEP = utils.createMockStep('Run typecheck workflow', 'Running typecheck workflow', 'TYPECHECK'); +const TYPECHECK_WORKFLOW_MOCK_STEP = createMockStep('Run typecheck workflow', 'Running typecheck workflow', 'TYPECHECK'); const TYPECHECK_JOB_MOCK_STEPS = [TYPECHECK_WORKFLOW_MOCK_STEP]; // lint -const LINT_WORKFLOW_MOCK_STEP = utils.createMockStep('Run lint workflow', 'Running lint workflow', 'LINT'); +const LINT_WORKFLOW_MOCK_STEP = createMockStep('Run lint workflow', 'Running lint workflow', 'LINT'); const LINT_JOB_MOCK_STEPS = [LINT_WORKFLOW_MOCK_STEP]; // test -const TEST_WORKFLOW_MOCK_STEP = utils.createMockStep('Run test workflow', 'Running test workflow', 'TEST'); +const TEST_WORKFLOW_MOCK_STEP = createMockStep('Run test workflow', 'Running test workflow', 'TEST'); const TEST_JOB_MOCK_STEPS = [TEST_WORKFLOW_MOCK_STEP]; // confirm_passing_build -const ANNOUNCE_IN_SLACK_MOCK_STEP = utils.createMockStep('Announce failed workflow in Slack', 'Announcing failed workflow in slack', 'CONFIRM_PASSING_BUILD', ['SLACK_WEBHOOK']); +const ANNOUNCE_IN_SLACK_MOCK_STEP = createMockStep('Announce failed workflow in Slack', 'Announcing failed workflow in slack', 'CONFIRM_PASSING_BUILD', ['SLACK_WEBHOOK']); const CONFIRM_PASSING_BUILD_JOB_MOCK_STEPS = [ ANNOUNCE_IN_SLACK_MOCK_STEP, @@ -21,11 +22,11 @@ const CONFIRM_PASSING_BUILD_JOB_MOCK_STEPS = [ ]; // choose_deploy_actions -const GET_MERGED_PULL_REQUEST_MOCK_STEP__CHOOSE_DEPLOY = utils.createMockStep('Get merged pull request', 'Getting merged pull request', 'CHOOSE_DEPLOY_ACTIONS', ['github_token'], null, { +const GET_MERGED_PULL_REQUEST_MOCK_STEP__CHOOSE_DEPLOY = createMockStep('Get merged pull request', 'Getting merged pull request', 'CHOOSE_DEPLOY_ACTIONS', ['github_token'], null, { number: '123', labels: '[]', }); -const CHECK_IF_STAGINGDEPLOYCASH_IS_LOCKED_MOCK_STEP__LOCKED = utils.createMockStep( +const CHECK_IF_STAGINGDEPLOYCASH_IS_LOCKED_MOCK_STEP__LOCKED = createMockStep( 'Check if StagingDeployCash is locked', 'Checking StagingDeployCash', 'CHOOSE_DEPLOY_ACTIONS', @@ -33,7 +34,7 @@ const CHECK_IF_STAGINGDEPLOYCASH_IS_LOCKED_MOCK_STEP__LOCKED = utils.createMockS null, {IS_LOCKED: true}, ); -const CHECK_IF_STAGINGDEPLOYCASH_IS_LOCKED_MOCK_STEP__UNLOCKED = utils.createMockStep( +const CHECK_IF_STAGINGDEPLOYCASH_IS_LOCKED_MOCK_STEP__UNLOCKED = createMockStep( 'Check if StagingDeployCash is locked', 'Checking StagingDeployCash', 'CHOOSE_DEPLOY_ACTIONS', @@ -55,29 +56,19 @@ const CHOOSE_DEPLOY_ACTIONS_JOB_MOCK_STEPS__STAGING_UNLOCKED = [ ]; // skip_deploy -const COMMENT_ON_DEFERRED_PR_MOCK_STEP = utils.createMockStep('Comment on deferred PR', 'Skipping deploy', 'SKIP_DEPLOY', ['github_token', 'number', 'body']); +const COMMENT_ON_DEFERRED_PR_MOCK_STEP = createMockStep('Comment on deferred PR', 'Skipping deploy', 'SKIP_DEPLOY', ['github_token', 'number', 'body']); const SKIP_DEPLOY_JOB_MOCK_STEPS = [COMMENT_ON_DEFERRED_PR_MOCK_STEP]; // create_new_version -const CREATE_NEW_VERSION_MOCK_STEP = utils.createMockStep( - 'Create new version', - 'Creating new version', - 'CREATE_NEW_VERSION', - null, - null, - {NEW_VERSION: '1.2.3'}, - null, - true, - 'createNewVersion', -); +const CREATE_NEW_VERSION_MOCK_STEP = createMockStep('Create new version', 'Creating new version', 'CREATE_NEW_VERSION', null, null, {NEW_VERSION: '1.2.3'}, null, true, 'createNewVersion'); const CREATE_NEW_VERSION_JOB_MOCK_STEPS = [CREATE_NEW_VERSION_MOCK_STEP]; // update_staging -const RUN_TURNSTYLE_MOCK_STEP = utils.createMockStep('Run turnstyle', 'Running turnstyle', 'UPDATE_STAGING', ['poll-interval-seconds'], ['GITHUB_TOKEN']); -const CHECKOUT_MAIN_MOCK_STEP = utils.createMockStep('Checkout main', 'Checkout main', 'UPDATE_STAGING', ['ref', 'token']); -const SETUP_GIT_FOR_OSBOTIFY_MOCK_STEP = utils.createMockStep('Setup Git for OSBotify', 'Setup Git for OSBotify', 'UPDATE_STAGING', ['GPG_PASSPHRASE']); -const UPDATE_STAGING_BRANCH_FROM_MAIN_MOCK_STEP = utils.createMockStep('Update staging branch from main', 'Update staging branch from main', 'UPDATE_STAGING'); -const ANNOUNCE_FAILED_WORKFLOW_IN_SLACK_MOCK_STEP = utils.createMockStep('Announce failed workflow in Slack', 'Announcing failed workflow in Slack', 'UPDATE_STAGING', ['SLACK_WEBHOOK']); +const RUN_TURNSTYLE_MOCK_STEP = createMockStep('Run turnstyle', 'Running turnstyle', 'UPDATE_STAGING', ['poll-interval-seconds'], ['GITHUB_TOKEN']); +const CHECKOUT_MAIN_MOCK_STEP = createMockStep('Checkout main', 'Checkout main', 'UPDATE_STAGING', ['ref', 'token']); +const SETUP_GIT_FOR_OSBOTIFY_MOCK_STEP = createMockStep('Setup Git for OSBotify', 'Setup Git for OSBotify', 'UPDATE_STAGING', ['GPG_PASSPHRASE']); +const UPDATE_STAGING_BRANCH_FROM_MAIN_MOCK_STEP = createMockStep('Update staging branch from main', 'Update staging branch from main', 'UPDATE_STAGING'); +const ANNOUNCE_FAILED_WORKFLOW_IN_SLACK_MOCK_STEP = createMockStep('Announce failed workflow in Slack', 'Announcing failed workflow in Slack', 'UPDATE_STAGING', ['SLACK_WEBHOOK']); const UPDATE_STAGING_JOB_MOCK_STEPS = [ RUN_TURNSTYLE_MOCK_STEP, CHECKOUT_MAIN_MOCK_STEP, @@ -86,10 +77,10 @@ const UPDATE_STAGING_JOB_MOCK_STEPS = [ ANNOUNCE_FAILED_WORKFLOW_IN_SLACK_MOCK_STEP, ]; -const PREDEPLOY__E2EPERFORMANCETESTS__PERFORM_E2E_TESTS__MOCK_STEP = utils.createMockStep('Perform E2E tests', 'Perform E2E tests', 'E2EPERFORMANCETESTS'); +const PREDEPLOY__E2EPERFORMANCETESTS__PERFORM_E2E_TESTS__MOCK_STEP = createMockStep('Perform E2E tests', 'Perform E2E tests', 'E2EPERFORMANCETESTS'); const PREDEPLOY__E2EPERFORMANCETESTS__MOCK_STEPS = [PREDEPLOY__E2EPERFORMANCETESTS__PERFORM_E2E_TESTS__MOCK_STEP]; -module.exports = { +export { TYPECHECK_JOB_MOCK_STEPS, LINT_JOB_MOCK_STEPS, TEST_JOB_MOCK_STEPS, diff --git a/workflow_tests/mocks/reviewerChecklistMocks.js b/workflow_tests/mocks/reviewerChecklistMocks.ts similarity index 51% rename from workflow_tests/mocks/reviewerChecklistMocks.js rename to workflow_tests/mocks/reviewerChecklistMocks.ts index 5f9ef67198a8..8a70c0c71597 100644 --- a/workflow_tests/mocks/reviewerChecklistMocks.js +++ b/workflow_tests/mocks/reviewerChecklistMocks.ts @@ -1,9 +1,10 @@ -const utils = require('../utils/utils'); +/* eslint-disable @typescript-eslint/naming-convention */ +import {createMockStep} from '../utils/utils'; // checklist -const REVIEWERCHECKLIST__CHECKLIST__REVIEWERCHECKLIST_JS__STEP_MOCK = utils.createMockStep('reviewerChecklist.js', 'reviewerChecklist.js', 'CHECKLIST', ['GITHUB_TOKEN'], []); +const REVIEWERCHECKLIST__CHECKLIST__REVIEWERCHECKLIST_JS__STEP_MOCK = createMockStep('reviewerChecklist.js', 'reviewerChecklist.js', 'CHECKLIST', ['GITHUB_TOKEN'], []); const REVIEWERCHECKLIST__CHECKLIST__STEP_MOCKS = [REVIEWERCHECKLIST__CHECKLIST__REVIEWERCHECKLIST_JS__STEP_MOCK]; -module.exports = { +export default { REVIEWERCHECKLIST__CHECKLIST__STEP_MOCKS, }; diff --git a/workflow_tests/mocks/testBuildMocks.js b/workflow_tests/mocks/testBuildMocks.ts similarity index 59% rename from workflow_tests/mocks/testBuildMocks.js rename to workflow_tests/mocks/testBuildMocks.ts index 37bcc5fb6fac..f502bfb248ba 100644 --- a/workflow_tests/mocks/testBuildMocks.js +++ b/workflow_tests/mocks/testBuildMocks.ts @@ -1,13 +1,14 @@ -const utils = require('../utils/utils'); +/* eslint-disable @typescript-eslint/naming-convention */ +import {createMockStep} from '../utils/utils'; // validateactor -const TESTBUILD__VALIDATEACTOR__IS_TEAM_MEMBER__TRUE__STEP_MOCK = utils.createMockStep('Is Expensify employee', 'Is Expensify employee', 'VALIDATEACTOR', [], ['GITHUB_TOKEN'], { +const TESTBUILD__VALIDATEACTOR__IS_TEAM_MEMBER__TRUE__STEP_MOCK = createMockStep('Is Expensify employee', 'Is Expensify employee', 'VALIDATEACTOR', [], ['GITHUB_TOKEN'], { IS_EXPENSIFY_EMPLOYEE: true, }); -const TESTBUILD__VALIDATEACTOR__IS_TEAM_MEMBER__FALSE__STEP_MOCK = utils.createMockStep('Is Expensify employee', 'Is Expensify employee', 'VALIDATEACTOR', [], ['GITHUB_TOKEN'], { +const TESTBUILD__VALIDATEACTOR__IS_TEAM_MEMBER__FALSE__STEP_MOCK = createMockStep('Is Expensify employee', 'Is Expensify employee', 'VALIDATEACTOR', [], ['GITHUB_TOKEN'], { IS_EXPENSIFY_EMPLOYEE: false, }); -const TESTBUILD__VALIDATEACTOR__SET_HAS_READY_TO_BUILD_LABEL_FLAG__TRUE__STEP_MOCK = utils.createMockStep( +const TESTBUILD__VALIDATEACTOR__SET_HAS_READY_TO_BUILD_LABEL_FLAG__TRUE__STEP_MOCK = createMockStep( 'Set HAS_READY_TO_BUILD_LABEL flag', 'Set HAS_READY_TO_BUILD_LABEL flag', 'VALIDATEACTOR', @@ -15,7 +16,7 @@ const TESTBUILD__VALIDATEACTOR__SET_HAS_READY_TO_BUILD_LABEL_FLAG__TRUE__STEP_MO ['PULL_REQUEST_NUMBER', 'GITHUB_TOKEN'], {HAS_READY_TO_BUILD_LABEL: true}, ); -const TESTBUILD__VALIDATEACTOR__SET_HAS_READY_TO_BUILD_LABEL_FLAG__FALSE__STEP_MOCK = utils.createMockStep( +const TESTBUILD__VALIDATEACTOR__SET_HAS_READY_TO_BUILD_LABEL_FLAG__FALSE__STEP_MOCK = createMockStep( 'Set HAS_READY_TO_BUILD_LABEL flag', 'Set HAS_READY_TO_BUILD_LABEL flag', 'VALIDATEACTOR', @@ -41,8 +42,8 @@ const TESTBUILD__VALIDATEACTOR__NO_TEAM_MEMBER_NO_FLAG__STEP_MOCKS = [ ]; // getbranchref -const TESTBUILD__GETBRANCHREF__CHECKOUT__STEP_MOCK = utils.createMockStep('Checkout', 'Checkout', 'GETBRANCHREF', [], []); -const TESTBUILD__GETBRANCHREF__CHECK_IF_PULL_REQUEST_NUMBER_IS_CORRECT__STEP_MOCK = utils.createMockStep( +const TESTBUILD__GETBRANCHREF__CHECKOUT__STEP_MOCK = createMockStep('Checkout', 'Checkout', 'GETBRANCHREF', [], []); +const TESTBUILD__GETBRANCHREF__CHECK_IF_PULL_REQUEST_NUMBER_IS_CORRECT__STEP_MOCK = createMockStep( 'Check if pull request number is correct', 'Check if pull request number is correct', 'GETBRANCHREF', @@ -53,35 +54,35 @@ const TESTBUILD__GETBRANCHREF__CHECK_IF_PULL_REQUEST_NUMBER_IS_CORRECT__STEP_MOC const TESTBUILD__GETBRANCHREF__STEP_MOCKS = [TESTBUILD__GETBRANCHREF__CHECKOUT__STEP_MOCK, TESTBUILD__GETBRANCHREF__CHECK_IF_PULL_REQUEST_NUMBER_IS_CORRECT__STEP_MOCK]; // android -const TESTBUILD__ANDROID__CHECKOUT__STEP_MOCK = utils.createMockStep('Checkout', 'Checkout', 'ANDROID', ['ref'], []); -const TESTBUILD__ANDROID__CREATE_ENV_ADHOC__STEP_MOCK = utils.createMockStep( +const TESTBUILD__ANDROID__CHECKOUT__STEP_MOCK = createMockStep('Checkout', 'Checkout', 'ANDROID', ['ref'], []); +const TESTBUILD__ANDROID__CREATE_ENV_ADHOC__STEP_MOCK = createMockStep( 'Create .env.adhoc file based on staging and add PULL_REQUEST_NUMBER env to it', 'Creating .env.adhoc file based on staging', 'ANDROID', [], [], ); -const TESTBUILD__ANDROID__SETUP_NODE__STEP_MOCK = utils.createMockStep('Setup Node', 'Setup Node', 'ANDROID', [], []); -const TESTBUILD__ANDROID__SETUP_JAVA__STEP_MOCK = utils.createMockStep('Setup Java', 'Setup Java', 'ANDROID', ['distribution', 'java-version'], []); -const TESTBUILD__ANDROID__SETUP_RUBY__STEP_MOCK = utils.createMockStep('Setup Ruby', 'Setup Ruby', 'ANDROID', ['ruby-version', 'bundler-cache'], []); -const TESTBUILD__ANDROID__DECRYPT_KEYSTORE__STEP_MOCK = utils.createMockStep('Decrypt keystore', 'Decrypt keystore', 'ANDROID', [], ['LARGE_SECRET_PASSPHRASE']); -const TESTBUILD__ANDROID__DECRYPT_JSON_KEY__STEP_MOCK = utils.createMockStep('Decrypt json key', 'Decrypt json key', 'ANDROID', [], ['LARGE_SECRET_PASSPHRASE']); -const TESTBUILD__ANDROID__CONFIGURE_AWS_CREDENTIALS__STEP_MOCK = utils.createMockStep( +const TESTBUILD__ANDROID__SETUP_NODE__STEP_MOCK = createMockStep('Setup Node', 'Setup Node', 'ANDROID', [], []); +const TESTBUILD__ANDROID__SETUP_JAVA__STEP_MOCK = createMockStep('Setup Java', 'Setup Java', 'ANDROID', ['distribution', 'java-version'], []); +const TESTBUILD__ANDROID__SETUP_RUBY__STEP_MOCK = createMockStep('Setup Ruby', 'Setup Ruby', 'ANDROID', ['ruby-version', 'bundler-cache'], []); +const TESTBUILD__ANDROID__DECRYPT_KEYSTORE__STEP_MOCK = createMockStep('Decrypt keystore', 'Decrypt keystore', 'ANDROID', [], ['LARGE_SECRET_PASSPHRASE']); +const TESTBUILD__ANDROID__DECRYPT_JSON_KEY__STEP_MOCK = createMockStep('Decrypt json key', 'Decrypt json key', 'ANDROID', [], ['LARGE_SECRET_PASSPHRASE']); +const TESTBUILD__ANDROID__CONFIGURE_AWS_CREDENTIALS__STEP_MOCK = createMockStep( 'Configure AWS Credentials', 'Configure AWS Credentials', 'ANDROID', ['aws-access-key-id', 'aws-secret-access-key', 'aws-region'], [], ); -const TESTBUILD__ANDROID__CONFIGURE_MAPBOX_SDK__STEP_MOCK = utils.createMockStep('Configure MapBox SDK', 'Configure MapBox SDK', 'ANDROID'); -const TESTBUILD__ANDROID__RUN_FASTLANE_BETA_TEST__STEP_MOCK = utils.createMockStep( +const TESTBUILD__ANDROID__CONFIGURE_MAPBOX_SDK__STEP_MOCK = createMockStep('Configure MapBox SDK', 'Configure MapBox SDK', 'ANDROID'); +const TESTBUILD__ANDROID__RUN_FASTLANE_BETA_TEST__STEP_MOCK = createMockStep( 'Run Fastlane beta test', 'Run Fastlane beta test', 'ANDROID', [], ['S3_ACCESS_KEY', 'S3_SECRET_ACCESS_KEY', 'S3_BUCKET', 'S3_REGION', 'MYAPP_UPLOAD_STORE_PASSWORD', 'MYAPP_UPLOAD_KEY_PASSWORD'], ); -const TESTBUILD__ANDROID__UPLOAD_ARTIFACT__STEP_MOCK = utils.createMockStep('Upload Artifact', 'Upload Artifact', 'ANDROID', ['name', 'path'], []); +const TESTBUILD__ANDROID__UPLOAD_ARTIFACT__STEP_MOCK = createMockStep('Upload Artifact', 'Upload Artifact', 'ANDROID', ['name', 'path'], []); const TESTBUILD__ANDROID__STEP_MOCKS = [ TESTBUILD__ANDROID__CHECKOUT__STEP_MOCK, TESTBUILD__ANDROID__CREATE_ENV_ADHOC__STEP_MOCK, @@ -97,43 +98,43 @@ const TESTBUILD__ANDROID__STEP_MOCKS = [ ]; // ios -const TESTBUILD__IOS__CHECKOUT__STEP_MOCK = utils.createMockStep('Checkout', 'Checkout', 'IOS', ['ref'], []); -const TESTBUILD__IOS__CONFIGURE_MAPBOX_SDK__STEP_MOCK = utils.createMockStep('Configure MapBox SDK', 'Configure MapBox SDK', 'IOS'); -const TESTBUILD__IOS__CREATE_ENV_ADHOC__STEP_MOCK = utils.createMockStep( +const TESTBUILD__IOS__CHECKOUT__STEP_MOCK = createMockStep('Checkout', 'Checkout', 'IOS', ['ref'], []); +const TESTBUILD__IOS__CONFIGURE_MAPBOX_SDK__STEP_MOCK = createMockStep('Configure MapBox SDK', 'Configure MapBox SDK', 'IOS'); +const TESTBUILD__IOS__CREATE_ENV_ADHOC__STEP_MOCK = createMockStep( 'Create .env.adhoc file based on staging and add PULL_REQUEST_NUMBER env to it', 'Creating .env.adhoc file based on staging', 'IOS', [], [], ); -const TESTBUILD__IOS__SETUP_NODE__STEP_MOCK = utils.createMockStep('Setup Node', 'Setup Node', 'IOS', [], []); -const TESTBUILD__IOS__SETUP_XCODE__STEP_MOCK = utils.createMockStep('Setup XCode', 'Setup XCode', 'IOS', [], []); -const TESTBUILD__IOS__SETUP_RUBY__STEP_MOCK = utils.createMockStep('Setup Ruby', 'Setup Ruby', 'IOS', ['ruby-version', 'bundler-cache'], []); -const TESTBUILD__IOS__CACHE_POD_DEPENDENCIES__STEP_MOCK = utils.createMockStep('Cache Pod dependencies', 'Cache Pod dependencies', 'IOS', ['path', 'key', 'restore-keys'], [], { +const TESTBUILD__IOS__SETUP_NODE__STEP_MOCK = createMockStep('Setup Node', 'Setup Node', 'IOS', [], []); +const TESTBUILD__IOS__SETUP_XCODE__STEP_MOCK = createMockStep('Setup XCode', 'Setup XCode', 'IOS', [], []); +const TESTBUILD__IOS__SETUP_RUBY__STEP_MOCK = createMockStep('Setup Ruby', 'Setup Ruby', 'IOS', ['ruby-version', 'bundler-cache'], []); +const TESTBUILD__IOS__CACHE_POD_DEPENDENCIES__STEP_MOCK = createMockStep('Cache Pod dependencies', 'Cache Pod dependencies', 'IOS', ['path', 'key', 'restore-keys'], [], { 'cache-hit': false, }); -const TESTBUILD__IOS__COMPARE_PODFILE_AND_MANIFEST__STEP_MOCK = utils.createMockStep('Compare Podfile.lock and Manifest.lock', 'Compare Podfile.lock and Manifest.lock', 'IOS', [], [], { +const TESTBUILD__IOS__COMPARE_PODFILE_AND_MANIFEST__STEP_MOCK = createMockStep('Compare Podfile.lock and Manifest.lock', 'Compare Podfile.lock and Manifest.lock', 'IOS', [], [], { IS_PODFILE_SAME_AS_MANIFEST: false, }); -const TESTBUILD__IOS__INSTALL_COCOAPODS__STEP_MOCK = utils.createMockStep('Install cocoapods', 'Install cocoapods', 'IOS', ['timeout_minutes', 'max_attempts', 'command'], []); -const TESTBUILD__IOS__DECRYPT_ADHOC_PROFILE__STEP_MOCK = utils.createMockStep('Decrypt AdHoc profile', 'Decrypt AdHoc profile', 'IOS', [], ['LARGE_SECRET_PASSPHRASE']); -const TESTBUILD__IOS__DECRYPT_ADHOC_NSE_PROFILE__STEP_MOCK = utils.createMockStep( +const TESTBUILD__IOS__INSTALL_COCOAPODS__STEP_MOCK = createMockStep('Install cocoapods', 'Install cocoapods', 'IOS', ['timeout_minutes', 'max_attempts', 'command'], []); +const TESTBUILD__IOS__DECRYPT_ADHOC_PROFILE__STEP_MOCK = createMockStep('Decrypt AdHoc profile', 'Decrypt AdHoc profile', 'IOS', [], ['LARGE_SECRET_PASSPHRASE']); +const TESTBUILD__IOS__DECRYPT_ADHOC_NSE_PROFILE__STEP_MOCK = createMockStep( 'Decrypt AdHoc Notification Service profile', 'Decrypt AdHoc Notification Service profile', 'IOS', [], ['LARGE_SECRET_PASSPHRASE'], ); -const TESTBUILD__IOS__DECRYPT_CERTIFICATE__STEP_MOCK = utils.createMockStep('Decrypt certificate', 'Decrypt certificate', 'IOS', [], ['LARGE_SECRET_PASSPHRASE']); -const TESTBUILD__IOS__CONFIGURE_AWS_CREDENTIALS__STEP_MOCK = utils.createMockStep( +const TESTBUILD__IOS__DECRYPT_CERTIFICATE__STEP_MOCK = createMockStep('Decrypt certificate', 'Decrypt certificate', 'IOS', [], ['LARGE_SECRET_PASSPHRASE']); +const TESTBUILD__IOS__CONFIGURE_AWS_CREDENTIALS__STEP_MOCK = createMockStep( 'Configure AWS Credentials', 'Configure AWS Credentials', 'IOS', ['aws-access-key-id', 'aws-secret-access-key', 'aws-region'], [], ); -const TESTBUILD__IOS__RUN_FASTLANE__STEP_MOCK = utils.createMockStep('Run Fastlane', 'Run Fastlane', 'IOS', [], ['S3_ACCESS_KEY', 'S3_SECRET_ACCESS_KEY', 'S3_BUCKET', 'S3_REGION']); -const TESTBUILD__IOS__UPLOAD_ARTIFACT__STEP_MOCK = utils.createMockStep('Upload Artifact', 'Upload Artifact', 'IOS', ['name', 'path'], []); +const TESTBUILD__IOS__RUN_FASTLANE__STEP_MOCK = createMockStep('Run Fastlane', 'Run Fastlane', 'IOS', [], ['S3_ACCESS_KEY', 'S3_SECRET_ACCESS_KEY', 'S3_BUCKET', 'S3_REGION']); +const TESTBUILD__IOS__UPLOAD_ARTIFACT__STEP_MOCK = createMockStep('Upload Artifact', 'Upload Artifact', 'IOS', ['name', 'path'], []); const TESTBUILD__IOS__STEP_MOCKS = [ TESTBUILD__IOS__CHECKOUT__STEP_MOCK, TESTBUILD__IOS__CONFIGURE_MAPBOX_SDK__STEP_MOCK, @@ -153,30 +154,30 @@ const TESTBUILD__IOS__STEP_MOCKS = [ ]; // desktop -const TESTBUILD__DESKTOP__CHECKOUT__STEP_MOCK = utils.createMockStep('Checkout', 'Checkout', 'DESKTOP', ['ref'], []); -const TESTBUILD__DESKTOP__CREATE_ENV_ADHOC__STEP_MOCK = utils.createMockStep( +const TESTBUILD__DESKTOP__CHECKOUT__STEP_MOCK = createMockStep('Checkout', 'Checkout', 'DESKTOP', ['ref'], []); +const TESTBUILD__DESKTOP__CREATE_ENV_ADHOC__STEP_MOCK = createMockStep( 'Create .env.adhoc file based on staging and add PULL_REQUEST_NUMBER env to it', 'Creating .env.adhoc file based on staging', 'DESKTOP', [], [], ); -const TESTBUILD__DESKTOP__SETUP_NODE__STEP_MOCK = utils.createMockStep('Setup Node', 'Setup Node', 'DESKTOP', [], []); -const TESTBUILD__DESKTOP__DECRYPT_DEVELOPER_ID_CERTIFICATE__STEP_MOCK = utils.createMockStep( +const TESTBUILD__DESKTOP__SETUP_NODE__STEP_MOCK = createMockStep('Setup Node', 'Setup Node', 'DESKTOP', [], []); +const TESTBUILD__DESKTOP__DECRYPT_DEVELOPER_ID_CERTIFICATE__STEP_MOCK = createMockStep( 'Decrypt Developer ID Certificate', 'Decrypt Developer ID Certificate', 'DESKTOP', [], ['DEVELOPER_ID_SECRET_PASSPHRASE'], ); -const TESTBUILD__DESKTOP__CONFIGURE_AWS_CREDENTIALS__STEP_MOCK = utils.createMockStep( +const TESTBUILD__DESKTOP__CONFIGURE_AWS_CREDENTIALS__STEP_MOCK = createMockStep( 'Configure AWS Credentials', 'Configure AWS Credentials', 'DESKTOP', ['aws-access-key-id', 'aws-secret-access-key', 'aws-region'], [], ); -const TESTBUILD__DESKTOP__BUILD_DESKTOP_APP_FOR_TESTING__STEP_MOCK = utils.createMockStep( +const TESTBUILD__DESKTOP__BUILD_DESKTOP_APP_FOR_TESTING__STEP_MOCK = createMockStep( 'Build desktop app for testing', 'Build desktop app for testing', 'DESKTOP', @@ -193,25 +194,25 @@ const TESTBUILD__DESKTOP__STEP_MOCKS = [ ]; // web -const TESTBUILD__WEB__CHECKOUT__STEP_MOCK = utils.createMockStep('Checkout', 'Checkout', 'WEB', ['ref'], []); -const TESTBUILD__WEB__CREATE_ENV_ADHOC__STEP_MOCK = utils.createMockStep( +const TESTBUILD__WEB__CHECKOUT__STEP_MOCK = createMockStep('Checkout', 'Checkout', 'WEB', ['ref'], []); +const TESTBUILD__WEB__CREATE_ENV_ADHOC__STEP_MOCK = createMockStep( 'Create .env.adhoc file based on staging and add PULL_REQUEST_NUMBER env to it', 'Creating .env.adhoc file based on staging', 'WEB', [], [], ); -const TESTBUILD__WEB__SETUP_NODE__STEP_MOCK = utils.createMockStep('Setup Node', 'Setup Node', 'WEB', [], []); -const TESTBUILD__WEB__CONFIGURE_AWS_CREDENTIALS__STEP_MOCK = utils.createMockStep( +const TESTBUILD__WEB__SETUP_NODE__STEP_MOCK = createMockStep('Setup Node', 'Setup Node', 'WEB', [], []); +const TESTBUILD__WEB__CONFIGURE_AWS_CREDENTIALS__STEP_MOCK = createMockStep( 'Configure AWS Credentials', 'Configure AWS Credentials', 'WEB', ['aws-access-key-id', 'aws-secret-access-key', 'aws-region'], [], ); -const TESTBUILD__WEB__BUILD_WEB_FOR_TESTING__STEP_MOCK = utils.createMockStep('Build web for testing', 'Build web for testing', 'WEB', [], []); -const TESTBUILD__WEB__BUILD_DOCS__STEP_MOCK = utils.createMockStep('Build docs', 'Build docs', 'WEB', [], []); -const TESTBUILD__WEB__DEPLOY_TO_S3_FOR_INTERNAL_TESTING__STEP_MOCK = utils.createMockStep('Deploy to S3 for internal testing', 'Deploy to S3 for internal testing', 'WEB', [], []); +const TESTBUILD__WEB__BUILD_WEB_FOR_TESTING__STEP_MOCK = createMockStep('Build web for testing', 'Build web for testing', 'WEB', [], []); +const TESTBUILD__WEB__BUILD_DOCS__STEP_MOCK = createMockStep('Build docs', 'Build docs', 'WEB', [], []); +const TESTBUILD__WEB__DEPLOY_TO_S3_FOR_INTERNAL_TESTING__STEP_MOCK = createMockStep('Deploy to S3 for internal testing', 'Deploy to S3 for internal testing', 'WEB', [], []); const TESTBUILD__WEB__STEP_MOCKS = [ TESTBUILD__WEB__CHECKOUT__STEP_MOCK, TESTBUILD__WEB__CREATE_ENV_ADHOC__STEP_MOCK, @@ -223,20 +224,15 @@ const TESTBUILD__WEB__STEP_MOCKS = [ ]; // postgithubcomment -const TESTBUILD__POSTGITHUBCOMMENT__CHECKOUT__STEP_MOCK = utils.createMockStep('Checkout', 'Checkout', 'POSTGITHUBCOMMENT', ['ref'], []); -const TESTBUILD__POSTGITHUBCOMMENT__DOWNLOAD_ARTIFACT__STEP_MOCK = utils.createMockStep('Download Artifact', 'Download Artifact', 'POSTGITHUBCOMMENT', [], []); -const TESTBUILD__POSTGITHUBCOMMENT__READ_JSONS_WITH_ANDROID_PATHS__STEP_MOCK = utils.createMockStep( - 'Read JSONs with android paths', - 'Read JSONs with android paths', - 'POSTGITHUBCOMMENT', - [], - [], - {android_path: 'http://dummy.android.link'}, -); -const TESTBUILD__POSTGITHUBCOMMENT__READ_JSONS_WITH_IOS_PATHS__STEP_MOCK = utils.createMockStep('Read JSONs with iOS paths', 'Read JSONs with iOS paths', 'POSTGITHUBCOMMENT', [], [], { +const TESTBUILD__POSTGITHUBCOMMENT__CHECKOUT__STEP_MOCK = createMockStep('Checkout', 'Checkout', 'POSTGITHUBCOMMENT', ['ref'], []); +const TESTBUILD__POSTGITHUBCOMMENT__DOWNLOAD_ARTIFACT__STEP_MOCK = createMockStep('Download Artifact', 'Download Artifact', 'POSTGITHUBCOMMENT', [], []); +const TESTBUILD__POSTGITHUBCOMMENT__READ_JSONS_WITH_ANDROID_PATHS__STEP_MOCK = createMockStep('Read JSONs with android paths', 'Read JSONs with android paths', 'POSTGITHUBCOMMENT', [], [], { + android_path: 'http://dummy.android.link', +}); +const TESTBUILD__POSTGITHUBCOMMENT__READ_JSONS_WITH_IOS_PATHS__STEP_MOCK = createMockStep('Read JSONs with iOS paths', 'Read JSONs with iOS paths', 'POSTGITHUBCOMMENT', [], [], { ios_path: 'http://dummy.ios.link', }); -const TESTBUILD__POSTGITHUBCOMMENT__PUBLISH_LINKS_TO_APPS_FOR_DOWNLOAD__STEP_MOCK = utils.createMockStep( +const TESTBUILD__POSTGITHUBCOMMENT__PUBLISH_LINKS_TO_APPS_FOR_DOWNLOAD__STEP_MOCK = createMockStep( 'Publish links to apps for download', 'Publish links to apps for download', 'POSTGITHUBCOMMENT', @@ -251,7 +247,7 @@ const TESTBUILD__POSTGITHUBCOMMENT__STEP_MOCKS = [ TESTBUILD__POSTGITHUBCOMMENT__PUBLISH_LINKS_TO_APPS_FOR_DOWNLOAD__STEP_MOCK, ]; -module.exports = { +export { TESTBUILD__VALIDATEACTOR__TEAM_MEMBER_HAS_FLAG__STEP_MOCKS, TESTBUILD__VALIDATEACTOR__TEAM_MEMBER_NO_FLAG__STEP_MOCKS, TESTBUILD__VALIDATEACTOR__NO_TEAM_MEMBER_HAS_FLAG__STEP_MOCKS, diff --git a/workflow_tests/mocks/testMocks.js b/workflow_tests/mocks/testMocks.js deleted file mode 100644 index 19011271bb47..000000000000 --- a/workflow_tests/mocks/testMocks.js +++ /dev/null @@ -1,26 +0,0 @@ -const utils = require('../utils/utils'); - -// jest -const TEST__JEST__CHECKOUT__STEP_MOCK = utils.createMockStep('Checkout', 'Checkout', 'JEST', [], []); -const TEST__JEST__SETUP_NODE__STEP_MOCK = utils.createMockStep('Setup Node', 'Setup Node', 'JEST', [], []); -const TEST__JEST__GET_NUMBER_OF_CPU_CORES__STEP_MOCK = utils.createMockStep('Get number of CPU cores', 'Get number of CPU cores', 'JEST', [], [], {count: 8}); -const TEST__JEST__CACHE_JEST_CACHE__STEP_MOCK = utils.createMockStep('Cache Jest cache', 'Cache Jest cache', 'JEST', ['path', 'key'], []); -const TEST__JEST__JEST_TESTS__STEP_MOCK = utils.createMockStep('Jest tests', 'Jest tests', 'JEST', [], []); -const TEST__JEST__STEP_MOCKS = [ - TEST__JEST__CHECKOUT__STEP_MOCK, - TEST__JEST__SETUP_NODE__STEP_MOCK, - TEST__JEST__GET_NUMBER_OF_CPU_CORES__STEP_MOCK, - TEST__JEST__CACHE_JEST_CACHE__STEP_MOCK, - TEST__JEST__JEST_TESTS__STEP_MOCK, -]; - -// shelltests -const TEST__SHELLTESTS__CHECKOUT__STEP_MOCK = utils.createMockStep('Checkout', 'Checkout', 'SHELLTESTS', [], []); -const TEST__SHELLTESTS__SETUP_NODE__STEP_MOCK = utils.createMockStep('Setup Node', 'Setup Node', 'SHELLTESTS', [], []); -const TEST__SHELLTESTS__TEST_CI_GIT_LOGIC__STEP_MOCK = utils.createMockStep('Test CI git logic', 'Test CI git logic', 'SHELLTESTS', [], []); -const TEST__SHELLTESTS__STEP_MOCKS = [TEST__SHELLTESTS__CHECKOUT__STEP_MOCK, TEST__SHELLTESTS__SETUP_NODE__STEP_MOCK, TEST__SHELLTESTS__TEST_CI_GIT_LOGIC__STEP_MOCK]; - -module.exports = { - TEST__JEST__STEP_MOCKS, - TEST__SHELLTESTS__STEP_MOCKS, -}; diff --git a/workflow_tests/mocks/testMocks.ts b/workflow_tests/mocks/testMocks.ts new file mode 100644 index 000000000000..cb8240169a8e --- /dev/null +++ b/workflow_tests/mocks/testMocks.ts @@ -0,0 +1,24 @@ +/* eslint-disable @typescript-eslint/naming-convention */ +import {createMockStep} from '../utils/utils'; + +// jest +const TEST__JEST__CHECKOUT__STEP_MOCK = createMockStep('Checkout', 'Checkout', 'JEST', [], []); +const TEST__JEST__SETUP_NODE__STEP_MOCK = createMockStep('Setup Node', 'Setup Node', 'JEST', [], []); +const TEST__JEST__GET_NUMBER_OF_CPU_CORES__STEP_MOCK = createMockStep('Get number of CPU cores', 'Get number of CPU cores', 'JEST', [], [], {count: 8}); +const TEST__JEST__CACHE_JEST_CACHE__STEP_MOCK = createMockStep('Cache Jest cache', 'Cache Jest cache', 'JEST', ['path', 'key'], []); +const TEST__JEST__JEST_TESTS__STEP_MOCK = createMockStep('Jest tests', 'Jest tests', 'JEST', [], []); +const TEST__JEST__STEP_MOCKS = [ + TEST__JEST__CHECKOUT__STEP_MOCK, + TEST__JEST__SETUP_NODE__STEP_MOCK, + TEST__JEST__GET_NUMBER_OF_CPU_CORES__STEP_MOCK, + TEST__JEST__CACHE_JEST_CACHE__STEP_MOCK, + TEST__JEST__JEST_TESTS__STEP_MOCK, +]; + +// shelltests +const TEST__SHELLTESTS__CHECKOUT__STEP_MOCK = createMockStep('Checkout', 'Checkout', 'SHELLTESTS', [], []); +const TEST__SHELLTESTS__SETUP_NODE__STEP_MOCK = createMockStep('Setup Node', 'Setup Node', 'SHELLTESTS', [], []); +const TEST__SHELLTESTS__TEST_CI_GIT_LOGIC__STEP_MOCK = createMockStep('Test CI git logic', 'Test CI git logic', 'SHELLTESTS', [], []); +const TEST__SHELLTESTS__STEP_MOCKS = [TEST__SHELLTESTS__CHECKOUT__STEP_MOCK, TEST__SHELLTESTS__SETUP_NODE__STEP_MOCK, TEST__SHELLTESTS__TEST_CI_GIT_LOGIC__STEP_MOCK]; + +export {TEST__JEST__STEP_MOCKS, TEST__SHELLTESTS__STEP_MOCKS}; diff --git a/workflow_tests/mocks/validateGithubActionsMocks.js b/workflow_tests/mocks/validateGithubActionsMocks.js deleted file mode 100644 index e2d48932acf6..000000000000 --- a/workflow_tests/mocks/validateGithubActionsMocks.js +++ /dev/null @@ -1,23 +0,0 @@ -const utils = require('../utils/utils'); - -// verify -const VALIDATEGITHUBACTIONS__VERIFY__CHECKOUT__STEP_MOCK = utils.createMockStep('Checkout', 'Checkout', 'VERIFY'); -const VALIDATEGITHUBACTIONS__VERIFY__SETUP_NODE__STEP_MOCK = utils.createMockStep('Setup Node', 'Setup Node', 'VERIFY', [], []); -const VALIDATEGITHUBACTIONS__VERIFY__VERIFY_JAVASCRIPT_ACTION_BUILDS__STEP_MOCK = utils.createMockStep( - 'Verify Javascript Action Builds', - 'Verify Javascript Action Builds', - 'VERIFY', - [], - [], -); -const VALIDATEGITHUBACTIONS__VERIFY__VALIDATE_ACTIONS_AND_WORKFLOWS__STEP_MOCK = utils.createMockStep('Validate actions and workflows', 'Validate actions and workflows', 'VERIFY', [], []); -const VALIDATEGITHUBACTIONS__VERIFY__STEP_MOCKS = [ - VALIDATEGITHUBACTIONS__VERIFY__CHECKOUT__STEP_MOCK, - VALIDATEGITHUBACTIONS__VERIFY__SETUP_NODE__STEP_MOCK, - VALIDATEGITHUBACTIONS__VERIFY__VERIFY_JAVASCRIPT_ACTION_BUILDS__STEP_MOCK, - VALIDATEGITHUBACTIONS__VERIFY__VALIDATE_ACTIONS_AND_WORKFLOWS__STEP_MOCK, -]; - -module.exports = { - VALIDATEGITHUBACTIONS__VERIFY__STEP_MOCKS, -}; diff --git a/workflow_tests/mocks/validateGithubActionsMocks.ts b/workflow_tests/mocks/validateGithubActionsMocks.ts new file mode 100644 index 000000000000..2c1afba74387 --- /dev/null +++ b/workflow_tests/mocks/validateGithubActionsMocks.ts @@ -0,0 +1,18 @@ +/* eslint-disable @typescript-eslint/naming-convention */ +import {createMockStep} from '../utils/utils'; + +// verify +const VALIDATEGITHUBACTIONS__VERIFY__CHECKOUT__STEP_MOCK = createMockStep('Checkout', 'Checkout', 'VERIFY'); +const VALIDATEGITHUBACTIONS__VERIFY__SETUP_NODE__STEP_MOCK = createMockStep('Setup Node', 'Setup Node', 'VERIFY', [], []); +const VALIDATEGITHUBACTIONS__VERIFY__VERIFY_JAVASCRIPT_ACTION_BUILDS__STEP_MOCK = createMockStep('Verify Javascript Action Builds', 'Verify Javascript Action Builds', 'VERIFY', [], []); +const VALIDATEGITHUBACTIONS__VERIFY__VALIDATE_ACTIONS_AND_WORKFLOWS__STEP_MOCK = createMockStep('Validate actions and workflows', 'Validate actions and workflows', 'VERIFY', [], []); +const VALIDATEGITHUBACTIONS__VERIFY__STEP_MOCKS = [ + VALIDATEGITHUBACTIONS__VERIFY__CHECKOUT__STEP_MOCK, + VALIDATEGITHUBACTIONS__VERIFY__SETUP_NODE__STEP_MOCK, + VALIDATEGITHUBACTIONS__VERIFY__VERIFY_JAVASCRIPT_ACTION_BUILDS__STEP_MOCK, + VALIDATEGITHUBACTIONS__VERIFY__VALIDATE_ACTIONS_AND_WORKFLOWS__STEP_MOCK, +]; + +export default { + VALIDATEGITHUBACTIONS__VERIFY__STEP_MOCKS, +}; diff --git a/workflow_tests/mocks/verifyPodfileMocks.js b/workflow_tests/mocks/verifyPodfileMocks.js deleted file mode 100644 index 0a82eebcc748..000000000000 --- a/workflow_tests/mocks/verifyPodfileMocks.js +++ /dev/null @@ -1,11 +0,0 @@ -const utils = require('../utils/utils'); - -// verify -const VERIFYPODFILE__VERIFY__CHECKOUT__STEP_MOCK = utils.createMockStep('Checkout', 'Checkout', 'VERIFY'); -const VERIFYPODFILE__VERIFY__SETUP_NODE__STEP_MOCK = utils.createMockStep('Setup Node', 'Setup Node', 'VERIFY', [], []); -const VERIFYPODFILE__VERIFY__VERIFY_PODFILE__STEP_MOCK = utils.createMockStep('Verify podfile', 'Verify podfile', 'VERIFY', [], []); -const VERIFYPODFILE__VERIFY__STEP_MOCKS = [VERIFYPODFILE__VERIFY__CHECKOUT__STEP_MOCK, VERIFYPODFILE__VERIFY__SETUP_NODE__STEP_MOCK, VERIFYPODFILE__VERIFY__VERIFY_PODFILE__STEP_MOCK]; - -module.exports = { - VERIFYPODFILE__VERIFY__STEP_MOCKS, -}; diff --git a/workflow_tests/mocks/verifyPodfileMocks.ts b/workflow_tests/mocks/verifyPodfileMocks.ts new file mode 100644 index 000000000000..0cd7ea396dad --- /dev/null +++ b/workflow_tests/mocks/verifyPodfileMocks.ts @@ -0,0 +1,12 @@ +/* eslint-disable @typescript-eslint/naming-convention */ +import {createMockStep} from '../utils/utils'; + +// verify +const VERIFYPODFILE__VERIFY__CHECKOUT__STEP_MOCK = createMockStep('Checkout', 'Checkout', 'VERIFY'); +const VERIFYPODFILE__VERIFY__SETUP_NODE__STEP_MOCK = createMockStep('Setup Node', 'Setup Node', 'VERIFY', [], []); +const VERIFYPODFILE__VERIFY__VERIFY_PODFILE__STEP_MOCK = createMockStep('Verify podfile', 'Verify podfile', 'VERIFY', [], []); +const VERIFYPODFILE__VERIFY__STEP_MOCKS = [VERIFYPODFILE__VERIFY__CHECKOUT__STEP_MOCK, VERIFYPODFILE__VERIFY__SETUP_NODE__STEP_MOCK, VERIFYPODFILE__VERIFY__VERIFY_PODFILE__STEP_MOCK]; + +export default { + VERIFYPODFILE__VERIFY__STEP_MOCKS, +}; diff --git a/workflow_tests/mocks/verifySignedCommitsMocks.js b/workflow_tests/mocks/verifySignedCommitsMocks.ts similarity index 72% rename from workflow_tests/mocks/verifySignedCommitsMocks.js rename to workflow_tests/mocks/verifySignedCommitsMocks.ts index a19fac809e55..6109af183fd7 100644 --- a/workflow_tests/mocks/verifySignedCommitsMocks.js +++ b/workflow_tests/mocks/verifySignedCommitsMocks.ts @@ -1,7 +1,8 @@ -const utils = require('../utils/utils'); +/* eslint-disable @typescript-eslint/naming-convention */ +import {createMockStep} from '../utils/utils'; // verifysignedcommits -const VERIFYSIGNEDCOMMITS__VERIFYSIGNEDCOMMITS__VERIFY_SIGNED_COMMITS__STEP_MOCK = utils.createMockStep( +const VERIFYSIGNEDCOMMITS__VERIFYSIGNEDCOMMITS__VERIFY_SIGNED_COMMITS__STEP_MOCK = createMockStep( 'Verify signed commits', 'Verify signed commits', 'VERIFYSIGNEDCOMMITS', @@ -10,6 +11,6 @@ const VERIFYSIGNEDCOMMITS__VERIFYSIGNEDCOMMITS__VERIFY_SIGNED_COMMITS__STEP_MOCK ); const VERIFYSIGNEDCOMMITS__VERIFYSIGNEDCOMMITS__STEP_MOCKS = [VERIFYSIGNEDCOMMITS__VERIFYSIGNEDCOMMITS__VERIFY_SIGNED_COMMITS__STEP_MOCK]; -module.exports = { +export default { VERIFYSIGNEDCOMMITS__VERIFYSIGNEDCOMMITS__STEP_MOCKS, }; diff --git a/workflow_tests/utils/utils.ts b/workflow_tests/utils/utils.ts index dcc04aee02de..df4cc0468963 100644 --- a/workflow_tests/utils/utils.ts +++ b/workflow_tests/utils/utils.ts @@ -69,7 +69,7 @@ function createMockStep( jobId: string | null = null, inputs: string[] | null = null, inEnvs: string[] | null = null, - outputs: Record | null = null, + outputs: Record | null = null, outEnvs: Record | null = null, isSuccessful = true, id: string | null = null, From 66403e8958c19ba4d8f46fdc953481b387265d72 Mon Sep 17 00:00:00 2001 From: Yauheni Pasiukevich Date: Fri, 22 Mar 2024 11:49:24 +0100 Subject: [PATCH 2/2] address comments --- workflow_tests/mocks/authorChecklistMocks.ts | 5 ++- workflow_tests/mocks/cherryPickMocks.ts | 37 ++++++++++--------- workflow_tests/mocks/claMocks.ts | 6 +-- workflow_tests/mocks/createNewVersionMocks.ts | 8 ++-- workflow_tests/mocks/deployBlockerMocks.ts | 4 +- workflow_tests/mocks/deployMocks.ts | 9 ++++- workflow_tests/mocks/failureNotifierMocks.ts | 8 +++- .../mocks/finishReleaseCycleMocks.ts | 14 +++---- workflow_tests/mocks/lintMocks.ts | 5 ++- workflow_tests/mocks/lockDeploysMocks.ts | 7 +++- workflow_tests/mocks/platformDeployMocks.ts | 20 +++++----- workflow_tests/mocks/preDeployMocks.ts | 20 +++++----- .../mocks/reviewerChecklistMocks.ts | 5 ++- workflow_tests/mocks/testBuildMocks.ts | 20 +++++----- workflow_tests/mocks/testMocks.ts | 4 +- .../mocks/validateGithubActionsMocks.ts | 5 ++- workflow_tests/mocks/verifyPodfileMocks.ts | 9 ++++- .../mocks/verifySignedCommitsMocks.ts | 5 ++- 18 files changed, 107 insertions(+), 84 deletions(-) diff --git a/workflow_tests/mocks/authorChecklistMocks.ts b/workflow_tests/mocks/authorChecklistMocks.ts index 3a7f49783111..b4d520eb7a1f 100644 --- a/workflow_tests/mocks/authorChecklistMocks.ts +++ b/workflow_tests/mocks/authorChecklistMocks.ts @@ -4,8 +4,9 @@ import {createMockStep} from '../utils/utils'; // checklist const AUTHORCHECKLIST__CHECKLIST__CHECKOUT__STEP_MOCK = createMockStep('Checkout', 'Checkout', 'CHECKLIST'); const AUTHORCHECKLIST__CHECKLIST__AUTHORCHECKLIST_JS__STEP_MOCK = createMockStep('authorChecklist.js', 'Running authorChecklist.js', 'CHECKLIST', ['GITHUB_TOKEN'], []); -const AUTHORCHECKLIST__CHECKLIST__STEP_MOCKS = [AUTHORCHECKLIST__CHECKLIST__CHECKOUT__STEP_MOCK, AUTHORCHECKLIST__CHECKLIST__AUTHORCHECKLIST_JS__STEP_MOCK]; +const AUTHORCHECKLIST__CHECKLIST__STEP_MOCKS = [AUTHORCHECKLIST__CHECKLIST__CHECKOUT__STEP_MOCK, AUTHORCHECKLIST__CHECKLIST__AUTHORCHECKLIST_JS__STEP_MOCK] as const; -export default { +export { + // eslint-disable-next-line import/prefer-default-export AUTHORCHECKLIST__CHECKLIST__STEP_MOCKS, }; diff --git a/workflow_tests/mocks/cherryPickMocks.ts b/workflow_tests/mocks/cherryPickMocks.ts index 5791d903e416..f1508a3dc39d 100644 --- a/workflow_tests/mocks/cherryPickMocks.ts +++ b/workflow_tests/mocks/cherryPickMocks.ts @@ -18,8 +18,8 @@ const CHERRYPICK__VALIDATEACTOR__CHECK_IF_USER_IS_DEPLOYER_FALSE__STEP_MOCK = cr ['GITHUB_TOKEN'], {IS_DEPLOYER: false}, ); -const CHERRYPICK__VALIDATEACTOR__TRUE__STEP_MOCKS = [CHERRYPICK__VALIDATEACTOR__CHECK_IF_USER_IS_DEPLOYER_TRUE__STEP_MOCK]; -const CHERRYPICK__VALIDATEACTOR__FALSE__STEP_MOCKS = [CHERRYPICK__VALIDATEACTOR__CHECK_IF_USER_IS_DEPLOYER_FALSE__STEP_MOCK]; +const CHERRYPICK__VALIDATEACTOR__TRUE__STEP_MOCKS = [CHERRYPICK__VALIDATEACTOR__CHECK_IF_USER_IS_DEPLOYER_TRUE__STEP_MOCK] as const; +const CHERRYPICK__VALIDATEACTOR__FALSE__STEP_MOCKS = [CHERRYPICK__VALIDATEACTOR__CHECK_IF_USER_IS_DEPLOYER_FALSE__STEP_MOCK] as const; // createnewversion const CHERRYPICK__CREATENEWVERSION__CREATE_NEW_VERSION__STEP_MOCK = createMockStep( @@ -33,7 +33,7 @@ const CHERRYPICK__CREATENEWVERSION__CREATE_NEW_VERSION__STEP_MOCK = createMockSt true, 'createNewVersion', ); -const CHERRYPICK__CREATENEWVERSION__STEP_MOCKS = [CHERRYPICK__CREATENEWVERSION__CREATE_NEW_VERSION__STEP_MOCK]; +const CHERRYPICK__CREATENEWVERSION__STEP_MOCKS = [CHERRYPICK__CREATENEWVERSION__CREATE_NEW_VERSION__STEP_MOCK] as const; // cherrypick const CHERRYPICK__CHERRYPICK__CHECKOUT_STAGING_BRANCH__STEP_MOCK = createMockStep('Checkout staging branch', 'Checking out staging branch', 'CHERRYPICK', ['ref', 'token'], []); @@ -93,20 +93,21 @@ const CHERRYPICK__CHERRYPICK__ANNOUNCES_A_CP_FAILURE_IN_THE_ANNOUNCE_SLACK_ROOM_ ['GITHUB_TOKEN', 'SLACK_WEBHOOK_URL'], ); -const getCherryPickMockSteps = (upToDate: boolean, hasConflicts: boolean) => [ - CHERRYPICK__CHERRYPICK__CHECKOUT_STAGING_BRANCH__STEP_MOCK, - CHERRYPICK__CHERRYPICK__SET_UP_GIT_FOR_OSBOTIFY__STEP_MOCK, - CHERRYPICK__CHERRYPICK__GET_PREVIOUS_APP_VERSION__STEP_MOCK, - CHERRYPICK__CHERRYPICK__FETCH_HISTORY_OF_RELEVANT_REFS__STEP_MOCK, - CHERRYPICK__CHERRYPICK__GET_VERSION_BUMP_COMMIT__STEP_MOCK, - CHERRYPICK__CHERRYPICK__GET_MERGE_COMMIT_FOR_PULL_REQUEST_TO_CP__STEP_MOCK, - CHERRYPICK__CHERRYPICK__CHERRY_PICK_THE_VERSION_BUMP_TO_STAGING__STEP_MOCK, - hasConflicts - ? CHERRYPICK__CHERRYPICK__CHERRY_PICK_THE_MERGE_COMMIT_OF_TARGET_PR_TO_NEW_BRANCH__HAS_CONFLICTS__STEP_MOCK - : CHERRYPICK__CHERRYPICK__CHERRY_PICK_THE_MERGE_COMMIT_OF_TARGET_PR_TO_NEW_BRANCH__HAS_NO_CONFLICTS__STEP_MOCK, - CHERRYPICK__CHERRYPICK__PUSH_CHANGES__STEP_MOCK, - CHERRYPICK__CHERRYPICK__CREATE_PULL_REQUEST_TO_MANUALLY_FINISH_CP__STEP_MOCK, - CHERRYPICK__CHERRYPICK__ANNOUNCES_A_CP_FAILURE_IN_THE_ANNOUNCE_SLACK_ROOM__STEP_MOCK, -]; +const getCherryPickMockSteps = (upToDate: boolean, hasConflicts: boolean) => + [ + CHERRYPICK__CHERRYPICK__CHECKOUT_STAGING_BRANCH__STEP_MOCK, + CHERRYPICK__CHERRYPICK__SET_UP_GIT_FOR_OSBOTIFY__STEP_MOCK, + CHERRYPICK__CHERRYPICK__GET_PREVIOUS_APP_VERSION__STEP_MOCK, + CHERRYPICK__CHERRYPICK__FETCH_HISTORY_OF_RELEVANT_REFS__STEP_MOCK, + CHERRYPICK__CHERRYPICK__GET_VERSION_BUMP_COMMIT__STEP_MOCK, + CHERRYPICK__CHERRYPICK__GET_MERGE_COMMIT_FOR_PULL_REQUEST_TO_CP__STEP_MOCK, + CHERRYPICK__CHERRYPICK__CHERRY_PICK_THE_VERSION_BUMP_TO_STAGING__STEP_MOCK, + hasConflicts + ? CHERRYPICK__CHERRYPICK__CHERRY_PICK_THE_MERGE_COMMIT_OF_TARGET_PR_TO_NEW_BRANCH__HAS_CONFLICTS__STEP_MOCK + : CHERRYPICK__CHERRYPICK__CHERRY_PICK_THE_MERGE_COMMIT_OF_TARGET_PR_TO_NEW_BRANCH__HAS_NO_CONFLICTS__STEP_MOCK, + CHERRYPICK__CHERRYPICK__PUSH_CHANGES__STEP_MOCK, + CHERRYPICK__CHERRYPICK__CREATE_PULL_REQUEST_TO_MANUALLY_FINISH_CP__STEP_MOCK, + CHERRYPICK__CHERRYPICK__ANNOUNCES_A_CP_FAILURE_IN_THE_ANNOUNCE_SLACK_ROOM__STEP_MOCK, + ] as const; export {CHERRYPICK__VALIDATEACTOR__TRUE__STEP_MOCKS, CHERRYPICK__VALIDATEACTOR__FALSE__STEP_MOCKS, CHERRYPICK__CREATENEWVERSION__STEP_MOCKS, getCherryPickMockSteps}; diff --git a/workflow_tests/mocks/claMocks.ts b/workflow_tests/mocks/claMocks.ts index ca065510cd4a..ab2d5f15a756 100644 --- a/workflow_tests/mocks/claMocks.ts +++ b/workflow_tests/mocks/claMocks.ts @@ -15,8 +15,8 @@ const CLA__CLA__CLA_ASSISTANT__STEP_MOCK = createMockStep( ['path-to-signatures', 'path-to-document', 'branch', 'remote-organization-name', 'remote-repository-name', 'lock-pullrequest-aftermerge', 'allowlist'], ['GITHUB_TOKEN', 'PERSONAL_ACCESS_TOKEN'], ); -const CLA__CLA__NO_MATCHES__STEP_MOCKS = [CLA__CLA__CLA_COMMENT_CHECK__NO_MATCH__STEP_MOCK, CLA__CLA__CLA_COMMENT_RE_CHECK__NO_MATCH__STEP_MOCK, CLA__CLA__CLA_ASSISTANT__STEP_MOCK]; -const CLA__CLA__CHECK_MATCH__STEP_MOCKS = [CLA__CLA__CLA_COMMENT_CHECK__MATCH__STEP_MOCK, CLA__CLA__CLA_COMMENT_RE_CHECK__NO_MATCH__STEP_MOCK, CLA__CLA__CLA_ASSISTANT__STEP_MOCK]; -const CLA__CLA__RECHECK_MATCH__STEP_MOCKS = [CLA__CLA__CLA_COMMENT_CHECK__NO_MATCH__STEP_MOCK, CLA__CLA__CLA_COMMENT_RE_CHECK__MATCH__STEP_MOCK, CLA__CLA__CLA_ASSISTANT__STEP_MOCK]; +const CLA__CLA__NO_MATCHES__STEP_MOCKS = [CLA__CLA__CLA_COMMENT_CHECK__NO_MATCH__STEP_MOCK, CLA__CLA__CLA_COMMENT_RE_CHECK__NO_MATCH__STEP_MOCK, CLA__CLA__CLA_ASSISTANT__STEP_MOCK] as const; +const CLA__CLA__CHECK_MATCH__STEP_MOCKS = [CLA__CLA__CLA_COMMENT_CHECK__MATCH__STEP_MOCK, CLA__CLA__CLA_COMMENT_RE_CHECK__NO_MATCH__STEP_MOCK, CLA__CLA__CLA_ASSISTANT__STEP_MOCK] as const; +const CLA__CLA__RECHECK_MATCH__STEP_MOCKS = [CLA__CLA__CLA_COMMENT_CHECK__NO_MATCH__STEP_MOCK, CLA__CLA__CLA_COMMENT_RE_CHECK__MATCH__STEP_MOCK, CLA__CLA__CLA_ASSISTANT__STEP_MOCK] as const; export {CLA__CLA__NO_MATCHES__STEP_MOCKS, CLA__CLA__CHECK_MATCH__STEP_MOCKS, CLA__CLA__RECHECK_MATCH__STEP_MOCKS}; diff --git a/workflow_tests/mocks/createNewVersionMocks.ts b/workflow_tests/mocks/createNewVersionMocks.ts index d3ebdfa57734..59aa6bc910a2 100644 --- a/workflow_tests/mocks/createNewVersionMocks.ts +++ b/workflow_tests/mocks/createNewVersionMocks.ts @@ -11,9 +11,9 @@ const CREATENEWVERSION__VALIDATEACTOR__GET_USER_PERMISSIONS__WRITE__STEP_MOCK = const CREATENEWVERSION__VALIDATEACTOR__GET_USER_PERMISSIONS__NONE__STEP_MOCK = createMockStep('Get user permissions', 'Get user permissions', 'VALIDATEACTOR', [], ['GITHUB_TOKEN'], { PERMISSION: 'read', }); -const CREATENEWVERSION__VALIDATEACTOR__ADMIN__STEP_MOCKS = [CREATENEWVERSION__VALIDATEACTOR__GET_USER_PERMISSIONS__ADMIN__STEP_MOCK]; -const CREATENEWVERSION__VALIDATEACTOR__WRITER__STEP_MOCKS = [CREATENEWVERSION__VALIDATEACTOR__GET_USER_PERMISSIONS__WRITE__STEP_MOCK]; -const CREATENEWVERSION__VALIDATEACTOR__NO_PERMISSION__STEP_MOCKS = [CREATENEWVERSION__VALIDATEACTOR__GET_USER_PERMISSIONS__NONE__STEP_MOCK]; +const CREATENEWVERSION__VALIDATEACTOR__ADMIN__STEP_MOCKS = [CREATENEWVERSION__VALIDATEACTOR__GET_USER_PERMISSIONS__ADMIN__STEP_MOCK] as const; +const CREATENEWVERSION__VALIDATEACTOR__WRITER__STEP_MOCKS = [CREATENEWVERSION__VALIDATEACTOR__GET_USER_PERMISSIONS__WRITE__STEP_MOCK] as const; +const CREATENEWVERSION__VALIDATEACTOR__NO_PERMISSION__STEP_MOCKS = [CREATENEWVERSION__VALIDATEACTOR__GET_USER_PERMISSIONS__NONE__STEP_MOCK] as const; // createnewversion const CREATENEWVERSION__CREATENEWVERSION__RUN_TURNSTYLE__STEP_MOCK = createMockStep('Run turnstyle', 'Run turnstyle', 'CREATENEWVERSION', ['poll-interval-seconds'], ['GITHUB_TOKEN']); @@ -37,7 +37,7 @@ const CREATENEWVERSION__CREATENEWVERSION__STEP_MOCKS = [ CREATENEWVERSION__CREATENEWVERSION__COMMIT_NEW_VERSION__STEP_MOCK, CREATENEWVERSION__CREATENEWVERSION__UPDATE_MAIN_BRANCH__STEP_MOCK, CREATENEWVERSION__CREATENEWVERSION__ANNOUNCE_FAILED_WORKFLOW_IN_SLACK__STEP_MOCK, -]; +] as const; export { CREATENEWVERSION__VALIDATEACTOR__ADMIN__STEP_MOCKS, diff --git a/workflow_tests/mocks/deployBlockerMocks.ts b/workflow_tests/mocks/deployBlockerMocks.ts index 2280950890a0..932d4626b67b 100644 --- a/workflow_tests/mocks/deployBlockerMocks.ts +++ b/workflow_tests/mocks/deployBlockerMocks.ts @@ -3,7 +3,7 @@ import {createMockStep} from '../utils/utils'; // updateChecklist const DEPLOYBLOCKER__UPDATECHECKLIST__STEP_MOCK = createMockStep('updateChecklist', 'Run updateChecklist', 'UPDATECHECKLIST'); -const DEPLOYBLOCKER__UPDATECHECKLIST__STEP_MOCKS = [DEPLOYBLOCKER__UPDATECHECKLIST__STEP_MOCK]; +const DEPLOYBLOCKER__UPDATECHECKLIST__STEP_MOCKS = [DEPLOYBLOCKER__UPDATECHECKLIST__STEP_MOCK] as const; // deployblocker const DEPLOYBLOCKER__DEPLOYBLOCKER__CHECKOUT__STEP_MOCK = createMockStep('Checkout', 'Checkout', 'DEPLOYBLOCKER'); @@ -35,6 +35,6 @@ const DEPLOYBLOCKER__DEPLOYBLOCKER__STEP_MOCKS = [ DEPLOYBLOCKER__DEPLOYBLOCKER__POST_THE_ISSUE_IN_THE_EXPENSIFY_OPEN_SOURCE_SLACK_ROOM__STEP_MOCK, DEPLOYBLOCKER__DEPLOYBLOCKER__COMMENT_ON_DEPLOY_BLOCKER__STEP_MOCK, DEPLOYBLOCKER__DEPLOYBLOCKER__ANNOUNCE_FAILED_WORKFLOW_IN_SLACK__STEP_MOCK, -]; +] as const; export {DEPLOYBLOCKER__UPDATECHECKLIST__STEP_MOCKS, DEPLOYBLOCKER__DEPLOYBLOCKER__STEP_MOCKS}; diff --git a/workflow_tests/mocks/deployMocks.ts b/workflow_tests/mocks/deployMocks.ts index 5888320a87b2..d0795477cfca 100644 --- a/workflow_tests/mocks/deployMocks.ts +++ b/workflow_tests/mocks/deployMocks.ts @@ -9,7 +9,12 @@ const DEPLOY_STAGING__SETUP_GIT__STEP_MOCK = createMockStep('Setup git for OSBot ]); const DEPLOY_STAGING__TAG_VERSION__STEP_MOCK = createMockStep('Tag version', 'Tagging new version', 'DEPLOY_STAGING'); const DEPLOY_STAGING__PUSH_TAG__STEP_MOCK = createMockStep('🚀 Push tags to trigger staging deploy 🚀', 'Pushing tag to trigger staging deploy', 'DEPLOY_STAGING'); -const DEPLOY_STAGING_STEP_MOCKS = [DEPLOY_STAGING__CHECKOUT__STEP_MOCK, DEPLOY_STAGING__SETUP_GIT__STEP_MOCK, DEPLOY_STAGING__TAG_VERSION__STEP_MOCK, DEPLOY_STAGING__PUSH_TAG__STEP_MOCK]; +const DEPLOY_STAGING_STEP_MOCKS = [ + DEPLOY_STAGING__CHECKOUT__STEP_MOCK, + DEPLOY_STAGING__SETUP_GIT__STEP_MOCK, + DEPLOY_STAGING__TAG_VERSION__STEP_MOCK, + DEPLOY_STAGING__PUSH_TAG__STEP_MOCK, +] as const; const DEPLOY_PRODUCTION__CHECKOUT__STEP_MOCK = createMockStep('Checkout', 'Checking out', 'DEPLOY_PRODUCTION', ['ref', 'token']); const DEPLOY_PRODUCTION__SETUP_GIT__STEP_MOCK = createMockStep( @@ -48,6 +53,6 @@ const DEPLOY_PRODUCTION_STEP_MOCKS = [ DEPLOY_PRODUCTION__RELEASE_PR_LIST__STEP_MOCK, DEPLOY_PRODUCTION__GENERATE_RELEASE_BODY__STEP_MOCK, DEPLOY_PRODUCTION__CREATE_RELEASE__STEP_MOCK, -]; +] as const; export {DEPLOY_STAGING_STEP_MOCKS, DEPLOY_PRODUCTION_STEP_MOCKS}; diff --git a/workflow_tests/mocks/failureNotifierMocks.ts b/workflow_tests/mocks/failureNotifierMocks.ts index cbea6fce95ae..5c869adae21b 100644 --- a/workflow_tests/mocks/failureNotifierMocks.ts +++ b/workflow_tests/mocks/failureNotifierMocks.ts @@ -6,8 +6,12 @@ import {createMockStep} from '../utils/utils'; // notifyfailure const FAILURENOTIFIER__NOTIFYFAILURE__FETCH_WORKFLOW_RUN_JOBS__STEP_MOCK = createMockStep('Fetch Workflow Run Jobs', 'Fetch Workflow Run Jobs', 'NOTIFYFAILURE', [], []); const FAILURENOTIFIER__NOTIFYFAILURE__PROCESS_EACH_FAILED_JOB__STEP_MOCK = createMockStep('Process Each Failed Job', 'Process Each Failed Job', 'NOTIFYFAILURE', [], []); -const FAILURENOTIFIER__NOTIFYFAILURE__STEP_MOCKS = [FAILURENOTIFIER__NOTIFYFAILURE__FETCH_WORKFLOW_RUN_JOBS__STEP_MOCK, FAILURENOTIFIER__NOTIFYFAILURE__PROCESS_EACH_FAILED_JOB__STEP_MOCK]; +const FAILURENOTIFIER__NOTIFYFAILURE__STEP_MOCKS = [ + FAILURENOTIFIER__NOTIFYFAILURE__FETCH_WORKFLOW_RUN_JOBS__STEP_MOCK, + FAILURENOTIFIER__NOTIFYFAILURE__PROCESS_EACH_FAILED_JOB__STEP_MOCK, +] as const; -export default { +export { + // eslint-disable-next-line import/prefer-default-export FAILURENOTIFIER__NOTIFYFAILURE__STEP_MOCKS, }; diff --git a/workflow_tests/mocks/finishReleaseCycleMocks.ts b/workflow_tests/mocks/finishReleaseCycleMocks.ts index 86493fb077c9..360bb017da88 100644 --- a/workflow_tests/mocks/finishReleaseCycleMocks.ts +++ b/workflow_tests/mocks/finishReleaseCycleMocks.ts @@ -73,7 +73,7 @@ const FINISHRELEASECYCLE__VALIDATE__TEAM_MEMBER_NO_BLOCKERS__STEP_MOCKS = [ FINISHRELEASECYCLE__VALIDATE__CHECK_FOR_ANY_DEPLOY_BLOCKERS_FALSE__STEP_MOCK, FINISHRELEASECYCLE__VALIDATE__REOPEN_AND_COMMENT_ON_ISSUE_HAS_BLOCKERS__STEP_MOCK, FINISHRELEASECYCLE__VALIDATE__ANNOUNCE_FAILED_WORKFLOW_IN_SLACK__STEP_MOCK, -]; +] as const; const FINISHRELEASECYCLE__VALIDATE__TEAM_MEMBER_BLOCKERS__STEP_MOCKS = [ FINISHRELEASECYCLE__VALIDATE__CHECKOUT__STEP_MOCK, FINISHRELEASECYCLE__VALIDATE__SETUP_GIT_FOR_OSBOTIFY__STEP_MOCK, @@ -82,7 +82,7 @@ const FINISHRELEASECYCLE__VALIDATE__TEAM_MEMBER_BLOCKERS__STEP_MOCKS = [ FINISHRELEASECYCLE__VALIDATE__CHECK_FOR_ANY_DEPLOY_BLOCKERS_TRUE__STEP_MOCK, FINISHRELEASECYCLE__VALIDATE__REOPEN_AND_COMMENT_ON_ISSUE_HAS_BLOCKERS__STEP_MOCK, FINISHRELEASECYCLE__VALIDATE__ANNOUNCE_FAILED_WORKFLOW_IN_SLACK__STEP_MOCK, -]; +] as const; // eslint-disable-next-line rulesdir/no-negated-variables const FINISHRELEASECYCLE__VALIDATE__NOT_TEAM_MEMBER_NO_BLOCKERS__STEP_MOCKS = [ FINISHRELEASECYCLE__VALIDATE__CHECKOUT__STEP_MOCK, @@ -92,7 +92,7 @@ const FINISHRELEASECYCLE__VALIDATE__NOT_TEAM_MEMBER_NO_BLOCKERS__STEP_MOCKS = [ FINISHRELEASECYCLE__VALIDATE__CHECK_FOR_ANY_DEPLOY_BLOCKERS_FALSE__STEP_MOCK, FINISHRELEASECYCLE__VALIDATE__REOPEN_AND_COMMENT_ON_ISSUE_HAS_BLOCKERS__STEP_MOCK, FINISHRELEASECYCLE__VALIDATE__ANNOUNCE_FAILED_WORKFLOW_IN_SLACK__STEP_MOCK, -]; +] as const; // eslint-disable-next-line rulesdir/no-negated-variables const FINISHRELEASECYCLE__VALIDATE__NOT_TEAM_MEMBER_BLOCKERS__STEP_MOCKS = [ FINISHRELEASECYCLE__VALIDATE__CHECKOUT__STEP_MOCK, @@ -102,7 +102,7 @@ const FINISHRELEASECYCLE__VALIDATE__NOT_TEAM_MEMBER_BLOCKERS__STEP_MOCKS = [ FINISHRELEASECYCLE__VALIDATE__CHECK_FOR_ANY_DEPLOY_BLOCKERS_TRUE__STEP_MOCK, FINISHRELEASECYCLE__VALIDATE__REOPEN_AND_COMMENT_ON_ISSUE_HAS_BLOCKERS__STEP_MOCK, FINISHRELEASECYCLE__VALIDATE__ANNOUNCE_FAILED_WORKFLOW_IN_SLACK__STEP_MOCK, -]; +] as const; // updateproduction const FINISHRELEASECYCLE__UPDATEPRODUCTION__CHECKOUT__STEP_MOCK = createMockStep('Checkout', 'Checkout', 'UPDATEPRODUCTION', ['ref', 'token'], []); @@ -126,7 +126,7 @@ const FINISHRELEASECYCLE__UPDATEPRODUCTION__STEP_MOCKS = [ FINISHRELEASECYCLE__UPDATEPRODUCTION__SETUP_GIT_FOR_OSBOTIFY__STEP_MOCK, FINISHRELEASECYCLE__UPDATEPRODUCTION__UPDATE_PRODUCTION_BRANCH__STEP_MOCK, FINISHRELEASECYCLE__UPDATEPRODUCTION__ANNOUNCE_FAILED_WORKFLOW_IN_SLACK__STEP_MOCK, -]; +] as const; // createnewpatchversion const FINISHRELEASECYCLE__CREATENEWPATCHVERSION__CREATE_NEW_VERSION__STEP_MOCK = createMockStep( @@ -140,7 +140,7 @@ const FINISHRELEASECYCLE__CREATENEWPATCHVERSION__CREATE_NEW_VERSION__STEP_MOCK = true, 'createNewVersion', ); -const FINISHRELEASECYCLE__CREATENEWPATCHVERSION__STEP_MOCKS = [FINISHRELEASECYCLE__CREATENEWPATCHVERSION__CREATE_NEW_VERSION__STEP_MOCK]; +const FINISHRELEASECYCLE__CREATENEWPATCHVERSION__STEP_MOCKS = [FINISHRELEASECYCLE__CREATENEWPATCHVERSION__CREATE_NEW_VERSION__STEP_MOCK] as const; // updatestaging const FINISHRELEASECYCLE__UPDATESTAGING__CHECKOUT__STEP_MOCK = createMockStep('Checkout', 'Checkout', 'UPDATESTAGING', ['ref', 'token'], []); @@ -164,7 +164,7 @@ const FINISHRELEASECYCLE__UPDATESTAGING__STEP_MOCKS = [ FINISHRELEASECYCLE__UPDATESTAGING__SETUP_GIT_FOR_OSBOTIFY__STEP_MOCK, FINISHRELEASECYCLE__UPDATESTAGING__UPDATE_STAGING_BRANCH_TO_TRIGGER_STAGING_DEPLOY__STEP_MOCK, FINISHRELEASECYCLE__UPDATESTAGING__ANNOUNCE_FAILED_WORKFLOW_IN_SLACK__STEP_MOCK, -]; +] as const; export { FINISHRELEASECYCLE__VALIDATE__TEAM_MEMBER_NO_BLOCKERS__STEP_MOCKS, diff --git a/workflow_tests/mocks/lintMocks.ts b/workflow_tests/mocks/lintMocks.ts index 851555313cff..93a3fd190a41 100644 --- a/workflow_tests/mocks/lintMocks.ts +++ b/workflow_tests/mocks/lintMocks.ts @@ -13,8 +13,9 @@ const LINT__LINT__STEP_MOCKS = [ LINT__LINT__LINT_JAVASCRIPT_WITH_ESLINT__STEP_MOCK, LINT__LINT__VERIFY_NO_PRETTIER__STEP_MOCK, LINT__LINT__RUN_UNUSED_SEARCHER__STEP_MOCK, -]; +] as const; -export default { +export { + // eslint-disable-next-line import/prefer-default-export LINT__LINT__STEP_MOCKS, }; diff --git a/workflow_tests/mocks/lockDeploysMocks.ts b/workflow_tests/mocks/lockDeploysMocks.ts index 342e2315ac88..2c9aa1fd6d11 100644 --- a/workflow_tests/mocks/lockDeploysMocks.ts +++ b/workflow_tests/mocks/lockDeploysMocks.ts @@ -29,6 +29,9 @@ const LOCKDEPLOYS__LOCKSTAGINGDEPLOYS__STEP_MOCKS = [ LOCKDEPLOYS__LOCKSTAGINGDEPLOYS__WAIT_FOR_STAGING_DEPLOYS_TO_FINISH__STEP_MOCK, LOCKDEPLOYS__LOCKSTAGINGDEPLOYS__COMMENT_IN_STAGINGDEPLOYCASH_TO_GIVE_APPLAUSE_THE_GREEN_LIGHT_TO_BEGIN_QA__STEP_MOCK, LOCKDEPLOYS__LOCKSTAGINGDEPLOYS__ANNOUNCE_FAILED_WORKFLOW__STEP_MOCK, -]; +] as const; -export default {LOCKDEPLOYS__LOCKSTAGINGDEPLOYS__STEP_MOCKS}; +export { + // eslint-disable-next-line import/prefer-default-export + LOCKDEPLOYS__LOCKSTAGINGDEPLOYS__STEP_MOCKS, +}; diff --git a/workflow_tests/mocks/platformDeployMocks.ts b/workflow_tests/mocks/platformDeployMocks.ts index 1a14f488a81d..72176e34d1fa 100644 --- a/workflow_tests/mocks/platformDeployMocks.ts +++ b/workflow_tests/mocks/platformDeployMocks.ts @@ -18,12 +18,12 @@ const PLATFORM_DEPLOY__VALIDATE_ACTOR__CHECK_USER_DEPLOYER__OUTSIDER__STEP_MOCK ['GITHUB_TOKEN'], {IS_DEPLOYER: false}, ); -const PLATFORM_DEPLOY__VALIDATE_ACTOR__TEAM_MEMBER__STEP_MOCKS = [PLATFORM_DEPLOY__VALIDATE_ACTOR__CHECK_USER_DEPLOYER__TEAM_MEMBER__STEP_MOCK]; -const PLATFORM_DEPLOY__VALIDATE_ACTOR__OUTSIDER__STEP_MOCKS = [PLATFORM_DEPLOY__VALIDATE_ACTOR__CHECK_USER_DEPLOYER__OUTSIDER__STEP_MOCK]; +const PLATFORM_DEPLOY__VALIDATE_ACTOR__TEAM_MEMBER__STEP_MOCKS = [PLATFORM_DEPLOY__VALIDATE_ACTOR__CHECK_USER_DEPLOYER__TEAM_MEMBER__STEP_MOCK] as const; +const PLATFORM_DEPLOY__VALIDATE_ACTOR__OUTSIDER__STEP_MOCKS = [PLATFORM_DEPLOY__VALIDATE_ACTOR__CHECK_USER_DEPLOYER__OUTSIDER__STEP_MOCK] as const; // deployChecklist const PLATFORM_DEPLOY__DEPLOY_CHECKLIST__STEP_MOCK = createMockStep('deployChecklist', 'Run deployChecklist', 'DEPLOY_CHECKLIST'); -const PLATFORM_DEPLOY__DEPLOY_CHECKLIST__STEP_MOCKS = [PLATFORM_DEPLOY__DEPLOY_CHECKLIST__STEP_MOCK]; +const PLATFORM_DEPLOY__DEPLOY_CHECKLIST__STEP_MOCKS = [PLATFORM_DEPLOY__DEPLOY_CHECKLIST__STEP_MOCK] as const; // android const PLATFORM_DEPLOY__ANDROID__CHECKOUT__STEP_MOCK = createMockStep('Checkout', 'Checking out', 'ANDROID'); @@ -75,7 +75,7 @@ const PLATFORM_DEPLOY__ANDROID__STEP_MOCKS = [ PLATFORM_DEPLOY__ANDROID__UPLOAD_ANDROID_VERSION_TO_GITHUB_ARTIFACTS__STEP_MOCK, PLATFORM_DEPLOY__ANDROID__UPLOAD_TO_BROWSER_STACK__STEP_MOCK, PLATFORM_DEPLOY__ANDROID__WARN_DEPLOYERS__STEP_MOCK, -]; +] as const; // desktop const PLATFORM_DEPLOY__DESKTOP__CHECKOUT__STEP_MOCK = createMockStep('Checkout', 'Checking out', 'DESKTOP'); @@ -105,7 +105,7 @@ const PLATFORM_DEPLOY__DESKTOP__STEP_MOCKS = [ PLATFORM_DEPLOY__DESKTOP__DECRYPT_ID__STEP_MOCK, PLATFORM_DEPLOY__DESKTOP__BUILD_PRODUCTION__STEP_MOCK, PLATFORM_DEPLOY__DESKTOP__BUILD_STAGING__STEP_MOCK, -]; +] as const; // ios const PLATFORM_DEPLOY__IOS__CHECKOUT__STEP_MOCK = createMockStep('Checkout', 'Checking out', 'IOS'); @@ -167,7 +167,7 @@ const PLATFORM_DEPLOY__IOS__STEP_MOCKS = [ PLATFORM_DEPLOY__IOS__SET_VERSION__STEP_MOCK, PLATFORM_DEPLOY__IOS__RELEASE_FASTLANE__STEP_MOCK, PLATFORM_DEPLOY__IOS__WARN_FAIL__STEP_MOCK, -]; +] as const; // web const PLATFORM_DEPLOY__WEB__CHECKOUT__STEP_MOCK = createMockStep('Checkout', 'Checking out', 'WEB'); @@ -199,13 +199,13 @@ const PLATFORM_DEPLOY__WEB__STEP_MOCKS = [ PLATFORM_DEPLOY__WEB__DEPLOY_STAGING_S3__STEP_MOCK, PLATFORM_DEPLOY__WEB__PURGE_PRODUCTION_CACHE__STEP_MOCK, PLATFORM_DEPLOY__WEB__PURGE_STAGING_CACHE__STEP_MOCK, -]; +] as const; // post slack message on failure const PLATFORM_DEPLOY__POST_SLACK_FAIL__POST_SLACK__STEP_MOCK = createMockStep('Post Slack message on failure', 'Posting Slack message on platform deploy failure', 'POST_SLACK_FAIL', [ 'SLACK_WEBHOOK', ]); -const PLATFORM_DEPLOY__POST_SLACK_FAIL__STEP_MOCKS = [PLATFORM_DEPLOY__POST_SLACK_FAIL__POST_SLACK__STEP_MOCK]; +const PLATFORM_DEPLOY__POST_SLACK_FAIL__STEP_MOCKS = [PLATFORM_DEPLOY__POST_SLACK_FAIL__POST_SLACK__STEP_MOCK] as const; // post slack message on success const PLATFORM_DEPLOY__POST_SLACK_SUCCESS__CHECKOUT__STEP_MOCK = createMockStep('Checkout', 'Checking out', 'POST_SLACK_SUCCESS'); @@ -237,7 +237,7 @@ const PLATFORM_DEPLOY__POST_SLACK_SUCCESS__STEP_MOCKS = [ PLATFORM_DEPLOY__POST_SLACK_SUCCESS__ANNOUNCE_CHANNEL__STEP_MOCK, PLATFORM_DEPLOY__POST_SLACK_SUCCESS__DEPLOYER_CHANNEL__STEP_MOCK, PLATFORM_DEPLOY__POST_SLACK_SUCCESS__EXPENSIFY_CHANNEL__STEP_MOCK, -]; +] as const; // post github comment const PLATFORM_DEPLOY__POST_GIHUB_COMMENT__CHECKOUT__STEP_MOCK = createMockStep('Checkout', 'Checking out', 'POST_GITHUB_COMMENT'); @@ -267,7 +267,7 @@ const PLATFORM_DEPLOY__POST_GITHUB_COMMENT__STEP_MOCKS = [ PLATFORM_DEPLOY__POST_GIHUB_COMMENT__SET_VERSION__STEP_MOCK, PLATFORM_DEPLOY__POST_GIHUB_COMMENT__GET_PR_LIST__STEP_MOCK, PLATFORM_DEPLOY__POST_GIHUB_COMMENT__COMMENT__STEP_MOCK, -]; +] as const; export { PLATFORM_DEPLOY__VALIDATE_ACTOR__TEAM_MEMBER__STEP_MOCKS, diff --git a/workflow_tests/mocks/preDeployMocks.ts b/workflow_tests/mocks/preDeployMocks.ts index d9da9d51bd85..df6bc63e7dd9 100644 --- a/workflow_tests/mocks/preDeployMocks.ts +++ b/workflow_tests/mocks/preDeployMocks.ts @@ -3,15 +3,15 @@ import {createMockStep} from '../utils/utils'; // typecheck const TYPECHECK_WORKFLOW_MOCK_STEP = createMockStep('Run typecheck workflow', 'Running typecheck workflow', 'TYPECHECK'); -const TYPECHECK_JOB_MOCK_STEPS = [TYPECHECK_WORKFLOW_MOCK_STEP]; +const TYPECHECK_JOB_MOCK_STEPS = [TYPECHECK_WORKFLOW_MOCK_STEP] as const; // lint const LINT_WORKFLOW_MOCK_STEP = createMockStep('Run lint workflow', 'Running lint workflow', 'LINT'); -const LINT_JOB_MOCK_STEPS = [LINT_WORKFLOW_MOCK_STEP]; +const LINT_JOB_MOCK_STEPS = [LINT_WORKFLOW_MOCK_STEP] as const; // test const TEST_WORKFLOW_MOCK_STEP = createMockStep('Run test workflow', 'Running test workflow', 'TEST'); -const TEST_JOB_MOCK_STEPS = [TEST_WORKFLOW_MOCK_STEP]; +const TEST_JOB_MOCK_STEPS = [TEST_WORKFLOW_MOCK_STEP] as const; // confirm_passing_build const ANNOUNCE_IN_SLACK_MOCK_STEP = createMockStep('Announce failed workflow in Slack', 'Announcing failed workflow in slack', 'CONFIRM_PASSING_BUILD', ['SLACK_WEBHOOK']); @@ -19,7 +19,7 @@ const CONFIRM_PASSING_BUILD_JOB_MOCK_STEPS = [ ANNOUNCE_IN_SLACK_MOCK_STEP, // 2nd step runs normally -]; +] as const; // choose_deploy_actions const GET_MERGED_PULL_REQUEST_MOCK_STEP__CHOOSE_DEPLOY = createMockStep('Get merged pull request', 'Getting merged pull request', 'CHOOSE_DEPLOY_ACTIONS', ['github_token'], null, { @@ -47,21 +47,21 @@ const CHOOSE_DEPLOY_ACTIONS_JOB_MOCK_STEPS__STAGING_LOCKED = [ CHECK_IF_STAGINGDEPLOYCASH_IS_LOCKED_MOCK_STEP__LOCKED, // step 3 runs normally -]; +] as const; const CHOOSE_DEPLOY_ACTIONS_JOB_MOCK_STEPS__STAGING_UNLOCKED = [ GET_MERGED_PULL_REQUEST_MOCK_STEP__CHOOSE_DEPLOY, CHECK_IF_STAGINGDEPLOYCASH_IS_LOCKED_MOCK_STEP__UNLOCKED, // step 3 runs normally -]; +] as const; // skip_deploy const COMMENT_ON_DEFERRED_PR_MOCK_STEP = createMockStep('Comment on deferred PR', 'Skipping deploy', 'SKIP_DEPLOY', ['github_token', 'number', 'body']); -const SKIP_DEPLOY_JOB_MOCK_STEPS = [COMMENT_ON_DEFERRED_PR_MOCK_STEP]; +const SKIP_DEPLOY_JOB_MOCK_STEPS = [COMMENT_ON_DEFERRED_PR_MOCK_STEP] as const; // create_new_version const CREATE_NEW_VERSION_MOCK_STEP = createMockStep('Create new version', 'Creating new version', 'CREATE_NEW_VERSION', null, null, {NEW_VERSION: '1.2.3'}, null, true, 'createNewVersion'); -const CREATE_NEW_VERSION_JOB_MOCK_STEPS = [CREATE_NEW_VERSION_MOCK_STEP]; +const CREATE_NEW_VERSION_JOB_MOCK_STEPS = [CREATE_NEW_VERSION_MOCK_STEP] as const; // update_staging const RUN_TURNSTYLE_MOCK_STEP = createMockStep('Run turnstyle', 'Running turnstyle', 'UPDATE_STAGING', ['poll-interval-seconds'], ['GITHUB_TOKEN']); @@ -75,10 +75,10 @@ const UPDATE_STAGING_JOB_MOCK_STEPS = [ SETUP_GIT_FOR_OSBOTIFY_MOCK_STEP, UPDATE_STAGING_BRANCH_FROM_MAIN_MOCK_STEP, ANNOUNCE_FAILED_WORKFLOW_IN_SLACK_MOCK_STEP, -]; +] as const; const PREDEPLOY__E2EPERFORMANCETESTS__PERFORM_E2E_TESTS__MOCK_STEP = createMockStep('Perform E2E tests', 'Perform E2E tests', 'E2EPERFORMANCETESTS'); -const PREDEPLOY__E2EPERFORMANCETESTS__MOCK_STEPS = [PREDEPLOY__E2EPERFORMANCETESTS__PERFORM_E2E_TESTS__MOCK_STEP]; +const PREDEPLOY__E2EPERFORMANCETESTS__MOCK_STEPS = [PREDEPLOY__E2EPERFORMANCETESTS__PERFORM_E2E_TESTS__MOCK_STEP] as const; export { TYPECHECK_JOB_MOCK_STEPS, diff --git a/workflow_tests/mocks/reviewerChecklistMocks.ts b/workflow_tests/mocks/reviewerChecklistMocks.ts index 8a70c0c71597..20c87994f957 100644 --- a/workflow_tests/mocks/reviewerChecklistMocks.ts +++ b/workflow_tests/mocks/reviewerChecklistMocks.ts @@ -3,8 +3,9 @@ import {createMockStep} from '../utils/utils'; // checklist const REVIEWERCHECKLIST__CHECKLIST__REVIEWERCHECKLIST_JS__STEP_MOCK = createMockStep('reviewerChecklist.js', 'reviewerChecklist.js', 'CHECKLIST', ['GITHUB_TOKEN'], []); -const REVIEWERCHECKLIST__CHECKLIST__STEP_MOCKS = [REVIEWERCHECKLIST__CHECKLIST__REVIEWERCHECKLIST_JS__STEP_MOCK]; +const REVIEWERCHECKLIST__CHECKLIST__STEP_MOCKS = [REVIEWERCHECKLIST__CHECKLIST__REVIEWERCHECKLIST_JS__STEP_MOCK] as const; -export default { +export { + // eslint-disable-next-line import/prefer-default-export REVIEWERCHECKLIST__CHECKLIST__STEP_MOCKS, }; diff --git a/workflow_tests/mocks/testBuildMocks.ts b/workflow_tests/mocks/testBuildMocks.ts index f502bfb248ba..12109d0a875b 100644 --- a/workflow_tests/mocks/testBuildMocks.ts +++ b/workflow_tests/mocks/testBuildMocks.ts @@ -27,19 +27,19 @@ const TESTBUILD__VALIDATEACTOR__SET_HAS_READY_TO_BUILD_LABEL_FLAG__FALSE__STEP_M const TESTBUILD__VALIDATEACTOR__TEAM_MEMBER_HAS_FLAG__STEP_MOCKS = [ TESTBUILD__VALIDATEACTOR__IS_TEAM_MEMBER__TRUE__STEP_MOCK, TESTBUILD__VALIDATEACTOR__SET_HAS_READY_TO_BUILD_LABEL_FLAG__TRUE__STEP_MOCK, -]; +] as const; const TESTBUILD__VALIDATEACTOR__TEAM_MEMBER_NO_FLAG__STEP_MOCKS = [ TESTBUILD__VALIDATEACTOR__IS_TEAM_MEMBER__TRUE__STEP_MOCK, TESTBUILD__VALIDATEACTOR__SET_HAS_READY_TO_BUILD_LABEL_FLAG__FALSE__STEP_MOCK, -]; +] as const; const TESTBUILD__VALIDATEACTOR__NO_TEAM_MEMBER_HAS_FLAG__STEP_MOCKS = [ TESTBUILD__VALIDATEACTOR__IS_TEAM_MEMBER__FALSE__STEP_MOCK, TESTBUILD__VALIDATEACTOR__SET_HAS_READY_TO_BUILD_LABEL_FLAG__TRUE__STEP_MOCK, -]; +] as const; const TESTBUILD__VALIDATEACTOR__NO_TEAM_MEMBER_NO_FLAG__STEP_MOCKS = [ TESTBUILD__VALIDATEACTOR__IS_TEAM_MEMBER__FALSE__STEP_MOCK, TESTBUILD__VALIDATEACTOR__SET_HAS_READY_TO_BUILD_LABEL_FLAG__FALSE__STEP_MOCK, -]; +] as const; // getbranchref const TESTBUILD__GETBRANCHREF__CHECKOUT__STEP_MOCK = createMockStep('Checkout', 'Checkout', 'GETBRANCHREF', [], []); @@ -51,7 +51,7 @@ const TESTBUILD__GETBRANCHREF__CHECK_IF_PULL_REQUEST_NUMBER_IS_CORRECT__STEP_MOC ['GITHUB_TOKEN'], {REF: 'test-ref'}, ); -const TESTBUILD__GETBRANCHREF__STEP_MOCKS = [TESTBUILD__GETBRANCHREF__CHECKOUT__STEP_MOCK, TESTBUILD__GETBRANCHREF__CHECK_IF_PULL_REQUEST_NUMBER_IS_CORRECT__STEP_MOCK]; +const TESTBUILD__GETBRANCHREF__STEP_MOCKS = [TESTBUILD__GETBRANCHREF__CHECKOUT__STEP_MOCK, TESTBUILD__GETBRANCHREF__CHECK_IF_PULL_REQUEST_NUMBER_IS_CORRECT__STEP_MOCK] as const; // android const TESTBUILD__ANDROID__CHECKOUT__STEP_MOCK = createMockStep('Checkout', 'Checkout', 'ANDROID', ['ref'], []); @@ -95,7 +95,7 @@ const TESTBUILD__ANDROID__STEP_MOCKS = [ TESTBUILD__ANDROID__CONFIGURE_MAPBOX_SDK__STEP_MOCK, TESTBUILD__ANDROID__RUN_FASTLANE_BETA_TEST__STEP_MOCK, TESTBUILD__ANDROID__UPLOAD_ARTIFACT__STEP_MOCK, -]; +] as const; // ios const TESTBUILD__IOS__CHECKOUT__STEP_MOCK = createMockStep('Checkout', 'Checkout', 'IOS', ['ref'], []); @@ -151,7 +151,7 @@ const TESTBUILD__IOS__STEP_MOCKS = [ TESTBUILD__IOS__CONFIGURE_AWS_CREDENTIALS__STEP_MOCK, TESTBUILD__IOS__RUN_FASTLANE__STEP_MOCK, TESTBUILD__IOS__UPLOAD_ARTIFACT__STEP_MOCK, -]; +] as const; // desktop const TESTBUILD__DESKTOP__CHECKOUT__STEP_MOCK = createMockStep('Checkout', 'Checkout', 'DESKTOP', ['ref'], []); @@ -191,7 +191,7 @@ const TESTBUILD__DESKTOP__STEP_MOCKS = [ TESTBUILD__DESKTOP__DECRYPT_DEVELOPER_ID_CERTIFICATE__STEP_MOCK, TESTBUILD__DESKTOP__CONFIGURE_AWS_CREDENTIALS__STEP_MOCK, TESTBUILD__DESKTOP__BUILD_DESKTOP_APP_FOR_TESTING__STEP_MOCK, -]; +] as const; // web const TESTBUILD__WEB__CHECKOUT__STEP_MOCK = createMockStep('Checkout', 'Checkout', 'WEB', ['ref'], []); @@ -221,7 +221,7 @@ const TESTBUILD__WEB__STEP_MOCKS = [ TESTBUILD__WEB__BUILD_WEB_FOR_TESTING__STEP_MOCK, TESTBUILD__WEB__BUILD_DOCS__STEP_MOCK, TESTBUILD__WEB__DEPLOY_TO_S3_FOR_INTERNAL_TESTING__STEP_MOCK, -]; +] as const; // postgithubcomment const TESTBUILD__POSTGITHUBCOMMENT__CHECKOUT__STEP_MOCK = createMockStep('Checkout', 'Checkout', 'POSTGITHUBCOMMENT', ['ref'], []); @@ -245,7 +245,7 @@ const TESTBUILD__POSTGITHUBCOMMENT__STEP_MOCKS = [ TESTBUILD__POSTGITHUBCOMMENT__READ_JSONS_WITH_ANDROID_PATHS__STEP_MOCK, TESTBUILD__POSTGITHUBCOMMENT__READ_JSONS_WITH_IOS_PATHS__STEP_MOCK, TESTBUILD__POSTGITHUBCOMMENT__PUBLISH_LINKS_TO_APPS_FOR_DOWNLOAD__STEP_MOCK, -]; +] as const; export { TESTBUILD__VALIDATEACTOR__TEAM_MEMBER_HAS_FLAG__STEP_MOCKS, diff --git a/workflow_tests/mocks/testMocks.ts b/workflow_tests/mocks/testMocks.ts index cb8240169a8e..96f47d4204fb 100644 --- a/workflow_tests/mocks/testMocks.ts +++ b/workflow_tests/mocks/testMocks.ts @@ -13,12 +13,12 @@ const TEST__JEST__STEP_MOCKS = [ TEST__JEST__GET_NUMBER_OF_CPU_CORES__STEP_MOCK, TEST__JEST__CACHE_JEST_CACHE__STEP_MOCK, TEST__JEST__JEST_TESTS__STEP_MOCK, -]; +] as const; // shelltests const TEST__SHELLTESTS__CHECKOUT__STEP_MOCK = createMockStep('Checkout', 'Checkout', 'SHELLTESTS', [], []); const TEST__SHELLTESTS__SETUP_NODE__STEP_MOCK = createMockStep('Setup Node', 'Setup Node', 'SHELLTESTS', [], []); const TEST__SHELLTESTS__TEST_CI_GIT_LOGIC__STEP_MOCK = createMockStep('Test CI git logic', 'Test CI git logic', 'SHELLTESTS', [], []); -const TEST__SHELLTESTS__STEP_MOCKS = [TEST__SHELLTESTS__CHECKOUT__STEP_MOCK, TEST__SHELLTESTS__SETUP_NODE__STEP_MOCK, TEST__SHELLTESTS__TEST_CI_GIT_LOGIC__STEP_MOCK]; +const TEST__SHELLTESTS__STEP_MOCKS = [TEST__SHELLTESTS__CHECKOUT__STEP_MOCK, TEST__SHELLTESTS__SETUP_NODE__STEP_MOCK, TEST__SHELLTESTS__TEST_CI_GIT_LOGIC__STEP_MOCK] as const; export {TEST__JEST__STEP_MOCKS, TEST__SHELLTESTS__STEP_MOCKS}; diff --git a/workflow_tests/mocks/validateGithubActionsMocks.ts b/workflow_tests/mocks/validateGithubActionsMocks.ts index 2c1afba74387..8249945dbfc7 100644 --- a/workflow_tests/mocks/validateGithubActionsMocks.ts +++ b/workflow_tests/mocks/validateGithubActionsMocks.ts @@ -11,8 +11,9 @@ const VALIDATEGITHUBACTIONS__VERIFY__STEP_MOCKS = [ VALIDATEGITHUBACTIONS__VERIFY__SETUP_NODE__STEP_MOCK, VALIDATEGITHUBACTIONS__VERIFY__VERIFY_JAVASCRIPT_ACTION_BUILDS__STEP_MOCK, VALIDATEGITHUBACTIONS__VERIFY__VALIDATE_ACTIONS_AND_WORKFLOWS__STEP_MOCK, -]; +] as const; -export default { +export { + // eslint-disable-next-line import/prefer-default-export VALIDATEGITHUBACTIONS__VERIFY__STEP_MOCKS, }; diff --git a/workflow_tests/mocks/verifyPodfileMocks.ts b/workflow_tests/mocks/verifyPodfileMocks.ts index 0cd7ea396dad..b1f0669b8b00 100644 --- a/workflow_tests/mocks/verifyPodfileMocks.ts +++ b/workflow_tests/mocks/verifyPodfileMocks.ts @@ -5,8 +5,13 @@ import {createMockStep} from '../utils/utils'; const VERIFYPODFILE__VERIFY__CHECKOUT__STEP_MOCK = createMockStep('Checkout', 'Checkout', 'VERIFY'); const VERIFYPODFILE__VERIFY__SETUP_NODE__STEP_MOCK = createMockStep('Setup Node', 'Setup Node', 'VERIFY', [], []); const VERIFYPODFILE__VERIFY__VERIFY_PODFILE__STEP_MOCK = createMockStep('Verify podfile', 'Verify podfile', 'VERIFY', [], []); -const VERIFYPODFILE__VERIFY__STEP_MOCKS = [VERIFYPODFILE__VERIFY__CHECKOUT__STEP_MOCK, VERIFYPODFILE__VERIFY__SETUP_NODE__STEP_MOCK, VERIFYPODFILE__VERIFY__VERIFY_PODFILE__STEP_MOCK]; +const VERIFYPODFILE__VERIFY__STEP_MOCKS = [ + VERIFYPODFILE__VERIFY__CHECKOUT__STEP_MOCK, + VERIFYPODFILE__VERIFY__SETUP_NODE__STEP_MOCK, + VERIFYPODFILE__VERIFY__VERIFY_PODFILE__STEP_MOCK, +] as const; -export default { +export { + // eslint-disable-next-line import/prefer-default-export VERIFYPODFILE__VERIFY__STEP_MOCKS, }; diff --git a/workflow_tests/mocks/verifySignedCommitsMocks.ts b/workflow_tests/mocks/verifySignedCommitsMocks.ts index 6109af183fd7..953d09d1255f 100644 --- a/workflow_tests/mocks/verifySignedCommitsMocks.ts +++ b/workflow_tests/mocks/verifySignedCommitsMocks.ts @@ -9,8 +9,9 @@ const VERIFYSIGNEDCOMMITS__VERIFYSIGNEDCOMMITS__VERIFY_SIGNED_COMMITS__STEP_MOCK ['GITHUB_TOKEN'], [], ); -const VERIFYSIGNEDCOMMITS__VERIFYSIGNEDCOMMITS__STEP_MOCKS = [VERIFYSIGNEDCOMMITS__VERIFYSIGNEDCOMMITS__VERIFY_SIGNED_COMMITS__STEP_MOCK]; +const VERIFYSIGNEDCOMMITS__VERIFYSIGNEDCOMMITS__STEP_MOCKS = [VERIFYSIGNEDCOMMITS__VERIFYSIGNEDCOMMITS__VERIFY_SIGNED_COMMITS__STEP_MOCK] as const; -export default { +export { + // eslint-disable-next-line import/prefer-default-export VERIFYSIGNEDCOMMITS__VERIFYSIGNEDCOMMITS__STEP_MOCKS, };