@@ -5,14 +5,13 @@ import { TestController, TestRun, TestRunProfileKind, Uri } from 'vscode';
55import * as typeMoq from 'typemoq' ;
66import * as path from 'path' ;
77import * as assert from 'assert' ;
8- import * as fs from 'fs' ;
98import * as sinon from 'sinon' ;
109import { ITestController , ITestResultResolver } from '../../../client/testing/testController/common/types' ;
1110import { IPythonExecutionFactory } from '../../../client/common/process/types' ;
1211import { IConfigurationService , ITestOutputChannel } from '../../../client/common/types' ;
1312import { IServiceContainer } from '../../../client/ioc/types' ;
1413import { EXTENSION_ROOT_DIR_FOR_TESTS , initialize } from '../../initialize' ;
15- import { traceError , traceLog } from '../../../client/logging' ;
14+ import { traceLog } from '../../../client/logging' ;
1615import { UnittestTestExecutionAdapter } from '../../../client/testing/testController/unittest/testExecutionAdapter' ;
1716import { PythonResultResolver } from '../../../client/testing/testController/common/resultResolver' ;
1817import { TestProvider } from '../../../client/testing/types' ;
@@ -32,60 +31,14 @@ suite('End to End Tests: the broken one', () => {
3231 let testController : TestController ;
3332 let getPixiStub : sinon . SinonStub ;
3433 const unittestProvider : TestProvider = UNITTEST_PROVIDER ;
35- const rootPathSmallWorkspace = path . join (
36- EXTENSION_ROOT_DIR_FOR_TESTS ,
37- 'src' ,
38- 'testTestingRootWkspc' ,
39- 'smallWorkspace' ,
40- ) ;
41- // const rootPathLargeWorkspace = path.join(
42- // EXTENSION_ROOT_DIR_FOR_TESTS,
43- // 'src',
44- // 'testTestingRootWkspc',
45- // 'largeWorkspace',
46- // );
4734 const rootPathErrorWorkspace = path . join (
4835 EXTENSION_ROOT_DIR_FOR_TESTS ,
4936 'src' ,
5037 'testTestingRootWkspc' ,
5138 'errorWorkspace' ,
5239 ) ;
53- const rootPathDiscoverySymlink = path . join (
54- EXTENSION_ROOT_DIR_FOR_TESTS ,
55- 'src' ,
56- 'testTestingRootWkspc' ,
57- 'symlinkWorkspace' ,
58- ) ;
59- const nestedTarget = path . join ( EXTENSION_ROOT_DIR_FOR_TESTS , 'src' , 'testTestingRootWkspc' , 'target workspace' ) ;
60- const nestedSymlink = path . join (
61- EXTENSION_ROOT_DIR_FOR_TESTS ,
62- 'src' ,
63- 'testTestingRootWkspc' ,
64- 'symlink_parent-folder' ,
65- ) ;
6640 suiteSetup ( async ( ) => {
67- // create symlink for specific symlink test
68- const target = rootPathSmallWorkspace ;
69- const dest = rootPathDiscoverySymlink ;
7041 serviceContainer = ( await initialize ( ) ) . serviceContainer ;
71- try {
72- fs . symlink ( target , dest , 'dir' , ( err ) => {
73- if ( err ) {
74- traceError ( err ) ;
75- } else {
76- traceLog ( 'Symlink created successfully for regular symlink end to end tests.' ) ;
77- }
78- } ) ;
79- fs . symlink ( nestedTarget , nestedSymlink , 'dir' , ( err ) => {
80- if ( err ) {
81- traceError ( err ) ;
82- } else {
83- traceLog ( 'Symlink created successfully for nested symlink end to end tests.' ) ;
84- }
85- } ) ;
86- } catch ( err ) {
87- traceError ( err ) ;
88- }
8942 } ) ;
9043
9144 setup ( async ( ) => {
@@ -123,31 +76,9 @@ suite('End to End Tests: the broken one', () => {
12376 sinon . restore ( ) ;
12477 } ) ;
12578 suiteTeardown ( async ( ) => {
126- // remove symlink
127- const dest = rootPathDiscoverySymlink ;
128- if ( fs . existsSync ( dest ) ) {
129- fs . unlink ( dest , ( err ) => {
130- if ( err ) {
131- traceError ( err ) ;
132- } else {
133- traceLog ( 'Symlink removed successfully after tests, rootPathDiscoverySymlink.' ) ;
134- }
135- } ) ;
136- } else {
137- traceLog ( 'Symlink was not found to remove after tests, exiting successfully, rootPathDiscoverySymlink.' ) ;
138- }
139-
140- if ( fs . existsSync ( nestedSymlink ) ) {
141- fs . unlink ( nestedSymlink , ( err ) => {
142- if ( err ) {
143- traceError ( err ) ;
144- } else {
145- traceLog ( 'Symlink removed successfully after tests, nestedSymlink.' ) ;
146- }
147- } ) ;
148- } else {
149- traceLog ( 'Symlink was not found to remove after tests, exiting successfully, nestedSymlink.' ) ;
150- }
79+ sinon . restore ( ) ;
80+ sinon . reset ( ) ;
81+ sinon . resetBehavior ( ) ;
15182 } ) ;
15283 test ( 'unittest execution adapter seg fault error handling' , async ( ) => {
15384 resultResolver = new PythonResultResolver ( testController , unittestProvider , workspaceUri ) ;
0 commit comments