-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #163 from DEFRA/BAU-dynamic-runner-count-update
BAU: dynamic runner count update
- Loading branch information
Showing
4 changed files
with
35 additions
and
12 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
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 |
---|---|---|
@@ -0,0 +1,17 @@ | ||
import { recommendRunnerCount } from './browserstackMetrics' | ||
|
||
describe('recommendRunnerCount', () => { | ||
it('should take half availableThreads runners if that figure is greater than the minimum preferred', () => { | ||
expect(recommendRunnerCount({ availableThreads: 16 })).toBe(8) | ||
expect(recommendRunnerCount({ availableThreads: 15 })).toBe(7) | ||
}) | ||
|
||
it('should take the minimum preferred if half availableThreads runners is too small, but available runners is more than minimum preferred', () => { | ||
expect(recommendRunnerCount({ availableThreads: 10 })).toBe(6) | ||
expect(recommendRunnerCount({ availableThreads: 8 })).toBe(6) | ||
}) | ||
|
||
it('should take all that remains if the availableThreads is below minimum preferred', () => { | ||
expect(recommendRunnerCount({ availableThreads: 4 })).toBe(4) | ||
}) | ||
}) |