@@ -108,10 +108,12 @@ export class PytestTestExecutionAdapter implements ITestExecutionAdapter {
108108 const settings = this . configSettings . getSettings ( uri ) ;
109109 const { pytestArgs } = settings . testing ;
110110 const cwd = settings . testing . cwd && settings . testing . cwd . length > 0 ? settings . testing . cwd : uri . fsPath ;
111+ console . log ( 'EJFB, runTestNew' ) ;
111112 // get and edit env vars
112113 const mutableEnv = {
113114 ...( await this . envVarsService ?. getEnvironmentVariables ( uri ) ) ,
114115 } ;
116+ console . log ( 'EJFB after mutableEnv' ) ;
115117 // get python path from mutable env, it contains process.env as well
116118 const pythonPathParts : string [ ] = mutableEnv . PYTHONPATH ?. split ( path . delimiter ) ?? [ ] ;
117119 const pythonPathCommand = [ fullPluginPath , ...pythonPathParts ] . join ( path . delimiter ) ;
@@ -121,15 +123,17 @@ export class PytestTestExecutionAdapter implements ITestExecutionAdapter {
121123 mutableEnv . COVERAGE_ENABLED = 'True' ;
122124 }
123125 const debugBool = profileKind && profileKind === TestRunProfileKind . Debug ;
124-
126+ console . log ( 'EJFB after debug Bool' ) ;
125127 // Create the Python environment in which to execute the command.
126128 const creationOptions : ExecutionFactoryCreateWithEnvironmentOptions = {
127129 allowEnvironmentFetchExceptions : false ,
128130 resource : uri ,
129131 interpreter,
130132 } ;
131133 // need to check what will happen in the exec service is NOT defined and is null
134+ console . log ( 'EJFB, before exec service' ) ;
132135 const execService = await executionFactory ?. createActivatedEnvironment ( creationOptions ) ;
136+ console . log ( 'EJFB, after exec service' ) ;
133137 try {
134138 // Remove positional test folders and files, we will add as needed per node
135139 let testArgs = removePositionalFoldersAndFiles ( pytestArgs ) ;
@@ -157,7 +161,7 @@ export class PytestTestExecutionAdapter implements ITestExecutionAdapter {
157161 env : mutableEnv ,
158162 token : runInstance ?. token ,
159163 } ;
160-
164+ console . log ( 'EJFB, before debug check' ) ;
161165 if ( debugBool ) {
162166 const launchOptions : LaunchOptions = {
163167 cwd,
@@ -181,6 +185,7 @@ export class PytestTestExecutionAdapter implements ITestExecutionAdapter {
181185
182186 let resultProc : ChildProcess | undefined ;
183187
188+ console . log ( 'EJFB, before run instance creation' ) ;
184189 runInstance ?. token . onCancellationRequested ( ( ) => {
185190 traceInfo ( `Test run cancelled, killing pytest subprocess for workspace ${ uri . fsPath } ` ) ;
186191 // if the resultProc exists just call kill on it which will handle resolving the ExecClose deferred, otherwise resolve the deferred here.
@@ -192,7 +197,9 @@ export class PytestTestExecutionAdapter implements ITestExecutionAdapter {
192197 }
193198 } ) ;
194199
200+ console . log ( 'EJFB, before exec observable' ) ;
195201 const result = execService ?. execObservable ( runArgs , spawnOptions ) ;
202+ console . log ( 'EJFB, after exec observable' ) ;
196203 resultProc = result ?. proc ;
197204
198205 // Take all output from the subprocess and add it to the test output channel. This will be the pytest output.
@@ -219,6 +226,7 @@ export class PytestTestExecutionAdapter implements ITestExecutionAdapter {
219226
220227 result ?. proc ?. on ( 'close' , ( code , signal ) => {
221228 traceVerbose ( 'Test run finished, subprocess closed.' ) ;
229+ console . log ( 'EJFB, process closed' ) ;
222230 // if the child has testIds then this is a run request
223231 // if the child process exited with a non-zero exit code, then we need to send the error payload.
224232 if ( code !== 0 && testIds ) {
@@ -239,6 +247,7 @@ export class PytestTestExecutionAdapter implements ITestExecutionAdapter {
239247 deferredTillExecClose . resolve ( ) ;
240248 serverCancel . cancel ( ) ;
241249 } ) ;
250+ console . log ( 'EJFB, await deferredTillExecClose' ) ;
242251 await deferredTillExecClose . promise ;
243252 }
244253 } catch ( ex ) {
@@ -251,6 +260,7 @@ export class PytestTestExecutionAdapter implements ITestExecutionAdapter {
251260 status : 'success' ,
252261 error : '' ,
253262 } ;
263+ console . log ( 'EJFB, returning execution payload' ) ;
254264 return executionPayload ;
255265 }
256266}
0 commit comments