ci: Refactor mksnapshot test so that it doesn't stall. (#16875)
This commit is contained in:
		
					parent
					
						
							
								7baa218ca9
							
						
					
				
			
			
				commit
				
					
						6a47089c78
					
				
			
		
					 4 changed files with 20 additions and 7 deletions
				
			
		|  | @ -92,6 +92,9 @@ test_script: | |||
|   - if "%RUN_TESTS%"=="true" ( echo Running test suite & npm run test -- --ci --enable-logging) | ||||
|   - cd .. | ||||
|   - if "%RUN_TESTS%"=="true" ( echo Verifying non proprietary ffmpeg & python electron\script\verify-ffmpeg.py --build-dir out\Default --source-root %cd% --ffmpeg-path out\ffmpeg ) | ||||
|   - echo "About to verify mksnapshot" | ||||
|   - if "%RUN_TESTS%"=="true" ( echo Verifying mksnapshot & python electron\script\verify-mksnapshot.py --build-dir out\Default --source-root %cd% ) | ||||
|   - echo "Done verifying mksnapshot" | ||||
| deploy_script: | ||||
|   - cd electron | ||||
|   - ps: >- | ||||
|  |  | |||
|  | @ -39,7 +39,7 @@ def main(): | |||
|             + context_snapshot | ||||
| 
 | ||||
|       test_path = os.path.join(SOURCE_ROOT, 'spec', 'fixtures', \ | ||||
|                                'snapshot-items-available.js') | ||||
|                                'snapshot-items-available') | ||||
| 
 | ||||
|       if sys.platform == 'darwin': | ||||
|         bin_files = glob.glob(os.path.join(app_path, '*.bin')) | ||||
|  | @ -64,7 +64,7 @@ def main(): | |||
|   except KeyboardInterrupt: | ||||
|     print 'Other error' | ||||
|     returncode = 0 | ||||
| 
 | ||||
|   print 'Returning with error code: {0}'.format(returncode) | ||||
|   return returncode | ||||
| 
 | ||||
| 
 | ||||
|  |  | |||
|  | @ -2,19 +2,25 @@ | |||
| 
 | ||||
| const { app } = require('electron') | ||||
| 
 | ||||
| app.once('ready', () => { | ||||
| app.on('ready', () => { | ||||
|   let returnCode = 0 | ||||
|   try { | ||||
|     const testValue = f() // eslint-disable-line no-undef
 | ||||
|     if (testValue === 86) { | ||||
|       console.log('ok test snapshot successfully loaded.') | ||||
|       app.exit(0) | ||||
|     } else { | ||||
|       console.log('not ok test snapshot could not be successfully loaded.') | ||||
|       app.exit(1) | ||||
|       returnCode = 1 | ||||
|     } | ||||
|     return | ||||
|   } catch (ex) { | ||||
|     console.log('Error running custom snapshot', ex) | ||||
|     app.exit(1) | ||||
|     returnCode = 1 | ||||
|   } | ||||
|   setImmediate(function () { | ||||
|     app.exit(returnCode) | ||||
|   }) | ||||
| }) | ||||
| 
 | ||||
| process.on('exit', function (code) { | ||||
|   console.log('test snapshot exited with code: ' + code) | ||||
| }) | ||||
							
								
								
									
										4
									
								
								spec/fixtures/snapshot-items-available/package.json
									
										
									
									
										vendored
									
									
										Normal file
									
								
							
							
						
						
									
										4
									
								
								spec/fixtures/snapshot-items-available/package.json
									
										
									
									
										vendored
									
									
										Normal file
									
								
							|  | @ -0,0 +1,4 @@ | |||
| { | ||||
|   "name": "snapshot-items-available", | ||||
|   "main": "main.js" | ||||
| } | ||||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue
	
	 John Kleinschmidt
				John Kleinschmidt