-
Notifications
You must be signed in to change notification settings - Fork 5.1k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
ci: add flags.circleci.timeoutMinutes (#29156)
## **Description** 1. Allows you to customize the E2E timeout by writing this in the PR description: `flags = {"circleci": {"timeoutMinutes": 35}}` 2. change to git-diff-default-branch.ts to be able to run it as a direct script or as a library 3. changes the default value for the merge queue 4. increases runAll.js's time-default from 30s to 50s [](https://codespaces.new/MetaMask/metamask-extension/pull/29156?quickstart=1) <!--## **Related issues** ## **Manual testing steps** ## **Screenshots/Recordings** ### **Before** ### **After** ## **Pre-merge author checklist** ## **Pre-merge reviewer checklist** --> --------- Co-authored-by: Mark Stacey <[email protected]>
- Loading branch information
1 parent
45c7bfd
commit 78ea51a
Showing
6 changed files
with
33 additions
and
11 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,23 @@ | ||
import { fetchManifestFlagsFromPRAndGit } from '../../development/lib/get-manifest-flag'; | ||
import { filterE2eChangedFiles } from '../../test/e2e/changedFilesUtil'; | ||
|
||
const changedOrNewTests = filterE2eChangedFiles(); | ||
fetchManifestFlagsFromPRAndGit().then((manifestFlags) => { | ||
let timeout; | ||
|
||
// 20 minutes, plus 3 minutes for every changed file, up to a maximum of 30 minutes | ||
const extraTime = Math.min(20 + changedOrNewTests.length * 3, 30); | ||
if (manifestFlags.circleci?.timeoutMinutes) { | ||
timeout = manifestFlags.circleci?.timeoutMinutes; | ||
} else { | ||
const changedOrNewTests = filterE2eChangedFiles(); | ||
|
||
console.log(extraTime); | ||
// 20 minutes, plus 3 minutes for every changed file, up to a maximum of 30 minutes | ||
timeout = Math.min(20 + changedOrNewTests.length * 3, 30); | ||
} | ||
|
||
// If this is the Merge Queue, add 10 minutes | ||
if (process.env.CIRCLE_BRANCH?.startsWith('gh-readonly-queue')) { | ||
timeout += 10; | ||
} | ||
|
||
// This is an essential log, that feeds into a bash script | ||
console.log(timeout); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters