File tree Expand file tree Collapse file tree 2 files changed +22
-3
lines changed
packages/browser-integration-tests/scripts Expand file tree Collapse file tree 2 files changed +22
-3
lines changed Original file line number Diff line number Diff line change 4
4
pull_request :
5
5
paths :
6
6
- ' packages/browser-integration-tests/suites/**'
7
+ branches-ignore :
8
+ - master
9
+ - develop
7
10
8
11
env :
9
12
HEAD_COMMIT : ${{ github.event.inputs.commit || github.sha }}
77
80
working-directory : packages/browser-integration-tests
78
81
env :
79
82
CHANGED_TEST_PATHS : ${{ steps.changed.outputs.browser_integration_files }}
80
- # Run 50 times when detecting changed test(s), else run all tests 5x
81
- TEST_RUN_COUNT : ${{ steps.changed.outputs.browser_integration == 'true' && 50 || 5 }}
83
+ TEST_RUN_COUNT : ' AUTO'
Original file line number Diff line number Diff line change @@ -23,8 +23,25 @@ ${changedPaths.join('\n')}
23
23
}
24
24
}
25
25
26
+ let runCount : number ;
27
+ if ( process . env . TEST_RUN_COUNT === 'AUTO' ) {
28
+ // No test paths detected: run everything 5x
29
+ runCount = 5 ;
30
+
31
+ if ( testPaths . length > 0 ) {
32
+ // Run everything up to 100x, assuming that total runtime is less than 60min.
33
+ // We assume an average runtime of 3s per test, times 4 (for different browsers) = 12s per detected testPaths
34
+ // We want to keep overall runtime under 30min
35
+ const testCount = testPaths . length * 4 ;
36
+ const expectedRuntimePerTestPath = testCount * 3 ;
37
+ const expectedRuntime = Math . floor ( ( 30 * 60 ) / expectedRuntimePerTestPath ) ;
38
+ runCount = Math . min ( 50 , Math . max ( expectedRuntime , 5 ) ) ;
39
+ }
40
+ } else {
41
+ runCount = parseInt ( process . env . TEST_RUN_COUNT || '10' ) ;
42
+ }
43
+
26
44
const cwd = path . join ( __dirname , '../' ) ;
27
- const runCount = parseInt ( process . env . TEST_RUN_COUNT || '10' ) ;
28
45
29
46
try {
30
47
await new Promise < void > ( ( resolve , reject ) => {
You can’t perform that action at this time.
0 commit comments