@@ -9,27 +9,21 @@ import * as path from 'path';
9
9
import { DebugClient } from 'vscode-debugadapter-testsupport' ;
10
10
import { EXTENSION_ROOT_DIR } from '../../client/common/constants' ;
11
11
import { noop } from '../../client/common/core.utils' ;
12
- import { IS_WINDOWS } from '../../client/common/platform/constants' ;
13
12
import { DebugOptions , LaunchRequestArguments } from '../../client/debugger/Common/Contracts' ;
14
13
import { sleep } from '../common' ;
15
14
import { IS_MULTI_ROOT_TEST , TEST_DEBUGGER } from '../initialize' ;
16
- import { DEBUGGER_TIMEOUT } from './common/constants' ;
17
- import { DebugClientEx } from './debugClient' ;
15
+ import { createDebugAdapter } from './utils' ;
18
16
19
- const testAdapterFilePath = path . join ( EXTENSION_ROOT_DIR , 'out' , 'client' , 'debugger' , 'mainV2.js' ) ;
20
17
const workspaceDirectory = path . join ( EXTENSION_ROOT_DIR , 'src' , 'testMultiRootWkspc' , 'workspace5' ) ;
21
- let testCounter = 0 ;
22
18
const debuggerType = 'pythonExperimental' ;
23
19
suite ( `Module Debugging - Misc tests: ${ debuggerType } ` , ( ) => {
24
20
let debugClient : DebugClient ;
25
21
setup ( async function ( ) {
26
22
if ( ! IS_MULTI_ROOT_TEST || ! TEST_DEBUGGER ) {
27
23
this . skip ( ) ;
28
24
}
29
- await new Promise ( resolve => setTimeout ( resolve , 1000 ) ) ;
30
- debugClient = createDebugAdapter ( ) ;
31
- debugClient . defaultTimeout = DEBUGGER_TIMEOUT ;
32
- await debugClient . start ( ) ;
25
+ const coverageDirectory = path . join ( EXTENSION_ROOT_DIR , 'debug_coverage_module' ) ;
26
+ debugClient = await createDebugAdapter ( coverageDirectory ) ;
33
27
} ) ;
34
28
teardown ( async ( ) => {
35
29
// Wait for a second before starting another test (sometimes, sockets take a while to get closed).
@@ -40,19 +34,6 @@ suite(`Module Debugging - Misc tests: ${debuggerType}`, () => {
40
34
} catch ( ex ) { }
41
35
await sleep ( 1000 ) ;
42
36
} ) ;
43
- /**
44
- * Creates the debug adapter.
45
- * We do not need to support code coverage on AppVeyor, lets use the standard test adapter.
46
- * @returns {DebugClient }
47
- */
48
- function createDebugAdapter ( ) : DebugClient {
49
- if ( IS_WINDOWS ) {
50
- return new DebugClient ( 'node' , testAdapterFilePath , debuggerType ) ;
51
- } else {
52
- const coverageDirectory = path . join ( EXTENSION_ROOT_DIR , `debug_coverage${ testCounter += 1 } ` ) ;
53
- return new DebugClientEx ( testAdapterFilePath , debuggerType , coverageDirectory , { cwd : EXTENSION_ROOT_DIR } ) ;
54
- }
55
- }
56
37
function buildLauncArgs ( ) : LaunchRequestArguments {
57
38
const env = { } ;
58
39
// tslint:disable-next-line:no-string-literal
0 commit comments