@@ -23,6 +23,7 @@ import { PytestTestExecutionAdapter } from '../../../client/testing/testControll
2323import { UnittestTestDiscoveryAdapter } from '../../../client/testing/testController/unittest/testDiscoveryAdapter' ;
2424import { UnittestTestExecutionAdapter } from '../../../client/testing/testController/unittest/testExecutionAdapter' ;
2525import { PythonResultResolver } from '../../../client/testing/testController/common/resultResolver' ;
26+ import { expandCompactDiscoveryPayload } from '../../../client/testing/testController/common/testDiscoveryHandler' ;
2627import { TestProvider } from '../../../client/testing/types' ;
2728import { PYTEST_PROVIDER , UNITTEST_PROVIDER } from '../../../client/testing/common/constants' ;
2829import { IEnvironmentVariablesProvider } from '../../../client/common/variables/types' ;
@@ -310,16 +311,15 @@ suite('End to End Tests: test adapters', () => {
310311 // 3. Confirm tests are found
311312 assert . ok ( actualData . tests , 'Expected tests to be present' ) ;
312313 // 4. Confirm that the cwd returned is the symlink path and the test's path is also using the symlink as the root
314+ const expandedTests = ( expandCompactDiscoveryPayload ( actualData as any ) . tests as unknown ) as {
315+ children : { path : string } [ ] ;
316+ } ;
313317 if ( process . platform === 'win32' ) {
314318 // covert string to lowercase for windows as the path is case insensitive
315319 traceLog ( 'windows machine detected, converting path to lowercase for comparison' ) ;
316320 const a = actualData . cwd . toLowerCase ( ) ;
317321 const b = filePath . toLowerCase ( ) ;
318- const testSimpleActual = ( actualData . tests as {
319- children : {
320- path : string ;
321- } [ ] ;
322- } ) . children [ 0 ] . path . toLowerCase ( ) ;
322+ const testSimpleActual = expandedTests . children [ 0 ] . path . toLowerCase ( ) ;
323323 const testSimpleExpected = filePath . toLowerCase ( ) ;
324324 assert . strictEqual ( a , b , `Expected cwd to be the symlink path actual: ${ a } expected: ${ b } ` ) ;
325325 assert . strictEqual (
@@ -334,11 +334,7 @@ suite('End to End Tests: test adapters', () => {
334334 'Expected cwd to be the symlink path, check for non-windows machines' ,
335335 ) ;
336336 assert . strictEqual (
337- ( actualData . tests as {
338- children : {
339- path : string ;
340- } [ ] ;
341- } ) . children [ 0 ] . path ,
337+ expandedTests . children [ 0 ] . path ,
342338 filePath ,
343339 'Expected test path to be the symlink path, check for non windows machines' ,
344340 ) ;
@@ -393,16 +389,15 @@ suite('End to End Tests: test adapters', () => {
393389 // 3. Confirm tests are found
394390 assert . ok ( actualData . tests , 'Expected tests to be present' ) ;
395391 // 4. Confirm that the cwd returned is the symlink path and the test's path is also using the symlink as the root
392+ const expandedTests = ( expandCompactDiscoveryPayload ( actualData as any ) . tests as unknown ) as {
393+ children : { path : string } [ ] ;
394+ } ;
396395 if ( process . platform === 'win32' ) {
397396 // covert string to lowercase for windows as the path is case insensitive
398397 traceLog ( 'windows machine detected, converting path to lowercase for comparison' ) ;
399398 const a = actualData . cwd . toLowerCase ( ) ;
400399 const b = rootPathDiscoverySymlink . toLowerCase ( ) ;
401- const testSimpleActual = ( actualData . tests as {
402- children : {
403- path : string ;
404- } [ ] ;
405- } ) . children [ 0 ] . path . toLowerCase ( ) ;
400+ const testSimpleActual = expandedTests . children [ 0 ] . path . toLowerCase ( ) ;
406401 const testSimpleExpected = testSimpleSymlinkPath . toLowerCase ( ) ;
407402 assert . strictEqual ( a , b , `Expected cwd to be the symlink path actual: ${ a } expected: ${ b } ` ) ;
408403 assert . strictEqual (
@@ -417,11 +412,7 @@ suite('End to End Tests: test adapters', () => {
417412 'Expected cwd to be the symlink path, check for non-windows machines' ,
418413 ) ;
419414 assert . strictEqual (
420- ( actualData . tests as {
421- children : {
422- path : string ;
423- } [ ] ;
424- } ) . children [ 0 ] . path ,
415+ expandedTests . children [ 0 ] . path ,
425416 testSimpleSymlinkPath ,
426417 'Expected test path to be the symlink path, check for non windows machines' ,
427418 ) ;
0 commit comments