-
Notifications
You must be signed in to change notification settings - Fork 5k
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
- Loading branch information
1 parent
50035f3
commit 4a58972
Showing
4 changed files
with
32 additions
and
9 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