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 44 pull_request :
55 paths :
66 - ' packages/browser-integration-tests/suites/**'
7+ branches-ignore :
8+ - master
9+ - develop
710
811env :
912 HEAD_COMMIT : ${{ github.event.inputs.commit || github.sha }}
7780 working-directory : packages/browser-integration-tests
7881 env :
7982 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')}
2323 }
2424 }
2525
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+
2644 const cwd = path . join ( __dirname , '../' ) ;
27- const runCount = parseInt ( process . env . TEST_RUN_COUNT || '10' ) ;
2845
2946 try {
3047 await new Promise < void > ( ( resolve , reject ) => {
You can’t perform that action at this time.
0 commit comments