11import Backend from './backend'
22import { SocketChannel , WebSocketChannel } from './channel'
33import { LocalController , RemoteController } from './controller'
4+ import { getShouldRunTest } from './skipped-tests'
45import * as REQUEST_HANDLERS from './request-handlers'
56
67/**
@@ -11,6 +12,11 @@ function main( ) {
1112 const channelType = process . env . CHANNEL_TYPE || 'SOCKET'
1213 const backendPort = process . env . BACKEND_PORT || 9876
1314 const webserverPort = process . env . WEB_SERVER_PORT || 8000
15+ const driverDescriptor = process . env . DRIVER_DESCRIPTOR || ''
16+ const driverDescriptorList = driverDescriptor
17+ . split ( ',' ) . map ( s => s . trim ( ) . toLowerCase ( ) )
18+
19+ const shouldRunTest = getShouldRunTest ( driverDescriptorList )
1420
1521 const newChannel = ( ) => {
1622 if ( channelType . toUpperCase ( ) === 'WEBSOCKET' ) {
@@ -24,7 +30,7 @@ function main( ) {
2430 if ( testEnviroment . toUpperCase ( ) === 'REMOTE' ) {
2531 return new RemoteController ( webserverPort )
2632 }
27- return new LocalController ( REQUEST_HANDLERS )
33+ return new LocalController ( REQUEST_HANDLERS , shouldRunTest )
2834 }
2935
3036 const backend = new Backend ( newController , newChannel )
@@ -39,7 +45,10 @@ function main( ) {
3945 process . on ( 'SIGINT' , process . exit . bind ( process ) ) ;
4046 process . on ( 'SIGUSR1' , process . exit . bind ( process ) ) ;
4147 process . on ( 'SIGUSR2' , process . exit . bind ( process ) ) ;
42- process . on ( 'uncaughtException' , process . exit . bind ( process ) ) ;
48+ process . on ( 'uncaughtException' , exception => {
49+ console . error ( 'UncaughtException' , exception )
50+ process . exit ( )
51+ } ) ;
4352 }
4453}
4554
0 commit comments