@@ -9,9 +9,10 @@ import * as path from 'path';
99import { ThreadEvent } from 'vscode-debugadapter' ;
1010import { DebugClient } from 'vscode-debugadapter-testsupport' ;
1111import { DebugProtocol } from 'vscode-debugprotocol' ;
12+ import { noop } from '../../client/common/core.utils' ;
1213import { LaunchRequestArguments } from '../../client/debugger/Common/Contracts' ;
1314import { sleep } from '../common' ;
14- import { IS_CI_SERVER , IS_MULTI_ROOT_TEST , TEST_DEBUGGER } from '../initialize' ;
15+ import { IS_MULTI_ROOT_TEST , TEST_DEBUGGER } from '../initialize' ;
1516
1617const isProcessRunning = require ( 'is-running' ) as ( number ) = > boolean ;
1718
@@ -34,10 +35,6 @@ const THREAD_TIMEOUT = 10000;
3435 if ( ! IS_MULTI_ROOT_TEST || ! TEST_DEBUGGER ) {
3536 this . skip ( ) ;
3637 }
37- // Temporary, untill new version of PTVSD is bundled we cannot run tests
38- if ( debuggerType !== 'python' && IS_CI_SERVER ) {
39- return this . skip ( ) ;
40- }
4138 await new Promise ( resolve => setTimeout ( resolve , 1000 ) ) ;
4239 debugClient = new DebugClient ( 'node' , testAdapterFilePath , debuggerType ) ;
4340 await debugClient . start ( ) ;
@@ -46,26 +43,20 @@ const THREAD_TIMEOUT = 10000;
4643 // Wait for a second before starting another test (sometimes, sockets take a while to get closed).
4744 await sleep ( 1000 ) ;
4845 try {
49- // tslint:disable-next-line:no-empty
50- await debugClient . stop ( ) . catch ( ( ) => { } ) ;
46+ await debugClient . stop ( ) . catch ( noop ) ;
5147 // tslint:disable-next-line:no-empty
5248 } catch ( ex ) { }
5349 await sleep ( 1000 ) ;
5450 } ) ;
55-
5651 function buildLauncArgs ( pythonFile : string , stopOnEntry : boolean = false ) : LaunchRequestArguments {
57- // Temporary, untill new version of PTVSD is bundled we cannot run tests.
58- // For now lets run test locally.
59- const pythonPath = debuggerType === 'python' ? 'python' : '/Users/donjayamanne/Desktop/Development/PythonStuff/IssueRepos/debuggerTests/.envp36/bin/python' ;
60- const env = debuggerType === 'python' ? { } : { PYTHONPATH : '/Users/donjayamanne/Desktop/Development/PythonStuff/IssueRepos/expPTVSD/ptvsd' } ;
6152 return {
6253 program : path . join ( debugFilesPath , pythonFile ) ,
6354 cwd : debugFilesPath ,
6455 stopOnEntry,
6556 debugOptions : [ 'RedirectOutput' ] ,
66- pythonPath,
57+ pythonPath : 'python' ,
6758 args : [ ] ,
68- env,
59+ env : { } ,
6960 envFile : '' ,
7061 logToFile : false ,
7162 type : debuggerType
@@ -325,17 +316,23 @@ const THREAD_TIMEOUT = 10000;
325316 const threadId = ( ( await threadIdPromise ) as ThreadEvent ) . body . threadId ;
326317 await debugClient . assertStoppedLocation ( 'breakpoint' , breakpointLocation ) ;
327318
328- await debugClient . nextRequest ( { threadId } ) ;
329319 const functionLocation = { path : path . join ( debugFilesPath , 'sample2.py' ) , column : 1 , line : 7 } ;
330- await debugClient . assertStoppedLocation ( 'step' , functionLocation ) ;
320+ await Promise . all ( [
321+ debugClient . nextRequest ( { threadId } ) ,
322+ debugClient . assertStoppedLocation ( 'step' , functionLocation )
323+ ] ) ;
331324
332- await debugClient . nextRequest ( { threadId } ) ;
333325 const functionInvocationLocation = { path : path . join ( debugFilesPath , 'sample2.py' ) , column : 1 , line : 11 } ;
334- await debugClient . assertStoppedLocation ( 'step' , functionInvocationLocation ) ;
326+ await Promise . all ( [
327+ debugClient . nextRequest ( { threadId } ) ,
328+ debugClient . assertStoppedLocation ( 'step' , functionInvocationLocation )
329+ ] ) ;
335330
336- await debugClient . nextRequest ( { threadId } ) ;
337331 const printLocation = { path : path . join ( debugFilesPath , 'sample2.py' ) , column : 1 , line : 13 } ;
338- await debugClient . assertStoppedLocation ( 'step' , printLocation ) ;
332+ await Promise . all ( [
333+ debugClient . nextRequest ( { threadId } ) ,
334+ debugClient . assertStoppedLocation ( 'step' , printLocation )
335+ ] ) ;
339336 } ) ;
340337 test ( 'Test stepin and stepout' , async ( ) => {
341338 const threadIdPromise = debugClient . waitForEvent ( 'thread' , THREAD_TIMEOUT ) ;
@@ -357,28 +354,37 @@ const THREAD_TIMEOUT = 10000;
357354 await debugClient . assertStoppedLocation ( 'breakpoint' , breakpointLocation ) ;
358355 const threadId = ( ( await threadIdPromise ) as ThreadEvent ) . body . threadId ;
359356
360- await debugClient . nextRequest ( { threadId } ) ;
361357 const functionLocation = { path : path . join ( debugFilesPath , 'sample2.py' ) , column : 1 , line : 7 } ;
362- await debugClient . assertStoppedLocation ( 'step' , functionLocation ) ;
358+ await Promise . all ( [
359+ debugClient . nextRequest ( { threadId } ) ,
360+ debugClient . assertStoppedLocation ( 'step' , functionLocation )
361+ ] ) ;
363362
364- await debugClient . nextRequest ( { threadId } ) ;
365363 const functionInvocationLocation = { path : path . join ( debugFilesPath , 'sample2.py' ) , column : 1 , line : 11 } ;
366- await debugClient . assertStoppedLocation ( 'step' , functionInvocationLocation ) ;
364+ await Promise . all ( [
365+ debugClient . nextRequest ( { threadId } ) ,
366+ debugClient . assertStoppedLocation ( 'step' , functionInvocationLocation )
367+ ] ) ;
367368
368- await debugClient . stepInRequest ( { threadId } ) ;
369369 const loopPrintLocation = { path : path . join ( debugFilesPath , 'sample2.py' ) , column : 1 , line : 8 } ;
370- await debugClient . assertStoppedLocation ( 'step' , loopPrintLocation ) ;
370+ await Promise . all ( [
371+ debugClient . stepInRequest ( { threadId } ) ,
372+ debugClient . assertStoppedLocation ( 'step' , loopPrintLocation )
373+ ] ) ;
371374
372- await debugClient . stepOutRequest ( { threadId } ) ;
373- await debugClient . assertStoppedLocation ( 'step' , functionInvocationLocation ) ;
375+ await Promise . all ( [
376+ debugClient . stepOutRequest ( { threadId } ) ,
377+ debugClient . assertStoppedLocation ( 'step' , functionInvocationLocation )
378+ ] ) ;
374379
375- await debugClient . nextRequest ( { threadId } ) ;
376380 const printLocation = { path : path . join ( debugFilesPath , 'sample2.py' ) , column : 1 , line : 13 } ;
377- await debugClient . assertStoppedLocation ( 'step' , printLocation ) ;
381+ await Promise . all ( [
382+ debugClient . nextRequest ( { threadId } ) ,
383+ debugClient . assertStoppedLocation ( 'step' , printLocation )
384+ ] ) ;
378385 } ) ;
379386 test ( 'Test pausing' , async function ( ) {
380- // TODO: re-enable for new debugger once it's running on CI
381- if ( debuggerType !== 'pythonExperimental' || IS_CI_SERVER ) {
387+ if ( debuggerType !== 'pythonExperimental' ) {
382388 return this . skip ( ) ;
383389 }
384390
0 commit comments