1
1
import Backend from './backend'
2
2
import { SocketChannel , WebSocketChannel } from './channel'
3
3
import { LocalController , RemoteController } from './controller'
4
+ import { getShouldRunTest } from './skipped-tests'
4
5
import * as REQUEST_HANDLERS from './request-handlers'
5
6
6
7
/**
@@ -11,6 +12,11 @@ function main( ) {
11
12
const channelType = process . env . CHANNEL_TYPE || 'SOCKET'
12
13
const backendPort = process . env . BACKEND_PORT || 9876
13
14
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 )
14
20
15
21
const newChannel = ( ) => {
16
22
if ( channelType . toUpperCase ( ) === 'WEBSOCKET' ) {
@@ -24,7 +30,7 @@ function main( ) {
24
30
if ( testEnviroment . toUpperCase ( ) === 'REMOTE' ) {
25
31
return new RemoteController ( webserverPort )
26
32
}
27
- return new LocalController ( REQUEST_HANDLERS )
33
+ return new LocalController ( REQUEST_HANDLERS , shouldRunTest )
28
34
}
29
35
30
36
const backend = new Backend ( newController , newChannel )
@@ -39,7 +45,10 @@ function main( ) {
39
45
process . on ( 'SIGINT' , process . exit . bind ( process ) ) ;
40
46
process . on ( 'SIGUSR1' , process . exit . bind ( process ) ) ;
41
47
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
+ } ) ;
43
52
}
44
53
}
45
54
0 commit comments