@@ -72,13 +72,17 @@ suite('End to End Tests: test adapters', () => {
72
72
// create symlink for specific symlink test
73
73
const target = rootPathSmallWorkspace ;
74
74
const dest = rootPathDiscoverySymlink ;
75
- fs . symlink ( target , dest , 'dir' , ( err ) => {
76
- if ( err ) {
77
- console . error ( err ) ;
78
- } else {
79
- console . log ( 'Symlink created successfully for end to end tests.' ) ;
80
- }
81
- } ) ;
75
+ try {
76
+ fs . symlink ( target , dest , 'dir' , ( err ) => {
77
+ if ( err ) {
78
+ console . error ( err ) ;
79
+ } else {
80
+ console . log ( 'Symlink created successfully for end to end tests.' ) ;
81
+ }
82
+ } ) ;
83
+ } catch ( err ) {
84
+ console . error ( err ) ;
85
+ }
82
86
} ) ;
83
87
84
88
setup ( async ( ) => {
@@ -117,13 +121,17 @@ suite('End to End Tests: test adapters', () => {
117
121
suiteTeardown ( async ( ) => {
118
122
// remove symlink
119
123
const dest = rootPathDiscoverySymlink ;
120
- fs . unlink ( dest , ( err ) => {
121
- if ( err ) {
122
- console . error ( err ) ;
123
- } else {
124
- console . log ( 'Symlink removed successfully after tests.' ) ;
125
- }
126
- } ) ;
124
+ if ( fs . existsSync ( dest ) ) {
125
+ fs . unlink ( dest , ( err ) => {
126
+ if ( err ) {
127
+ console . error ( err ) ;
128
+ } else {
129
+ console . log ( 'Symlink removed successfully after tests.' ) ;
130
+ }
131
+ } ) ;
132
+ } else {
133
+ console . log ( 'Symlink was not found to remove after tests, exiting successfully' ) ;
134
+ }
127
135
} ) ;
128
136
test ( 'unittest discovery adapter small workspace' , async ( ) => {
129
137
// result resolver and saved data for assertions
@@ -293,6 +301,7 @@ suite('End to End Tests: test adapters', () => {
293
301
resultResolver ,
294
302
envVarsService ,
295
303
) ;
304
+ configService . getSettings ( workspaceUri ) . testing . pytestArgs = [ ] ;
296
305
297
306
await discoveryAdapter . discoverTests ( workspaceUri , pythonExecFactory ) . finally ( ( ) => {
298
307
// verification after discovery is complete
@@ -372,6 +381,7 @@ suite('End to End Tests: test adapters', () => {
372
381
373
382
// set workspace to test workspace folder
374
383
workspaceUri = Uri . parse ( rootPathLargeWorkspace ) ;
384
+ configService . getSettings ( workspaceUri ) . testing . pytestArgs = [ ] ;
375
385
376
386
await discoveryAdapter . discoverTests ( workspaceUri , pythonExecFactory ) . finally ( ( ) => {
377
387
// verification after discovery is complete
@@ -558,6 +568,7 @@ suite('End to End Tests: test adapters', () => {
558
568
} ;
559
569
// set workspace to test workspace folder
560
570
workspaceUri = Uri . parse ( rootPathSmallWorkspace ) ;
571
+ configService . getSettings ( workspaceUri ) . testing . pytestArgs = [ ] ;
561
572
562
573
// run pytest execution
563
574
const executionAdapter = new PytestTestExecutionAdapter (
@@ -648,6 +659,7 @@ suite('End to End Tests: test adapters', () => {
648
659
649
660
// set workspace to test workspace folder
650
661
workspaceUri = Uri . parse ( rootPathLargeWorkspace ) ;
662
+ configService . getSettings ( workspaceUri ) . testing . pytestArgs = [ ] ;
651
663
652
664
// generate list of test_ids
653
665
const testIds : string [ ] = [ ] ;
@@ -728,6 +740,7 @@ suite('End to End Tests: test adapters', () => {
728
740
729
741
// set workspace to test workspace folder
730
742
workspaceUri = Uri . parse ( rootPathDiscoveryErrorWorkspace ) ;
743
+ configService . getSettings ( workspaceUri ) . testing . unittestArgs = [ '-s' , '.' , '-p' , '*test*.py' ] ;
731
744
732
745
const discoveryAdapter = new UnittestTestDiscoveryAdapter (
733
746
pythonTestServer ,
@@ -799,6 +812,8 @@ suite('End to End Tests: test adapters', () => {
799
812
800
813
// set workspace to test workspace folder
801
814
workspaceUri = Uri . parse ( rootPathDiscoveryErrorWorkspace ) ;
815
+ configService . getSettings ( workspaceUri ) . testing . pytestArgs = [ ] ;
816
+
802
817
await discoveryAdapter . discoverTests ( workspaceUri , pythonExecFactory ) . finally ( ( ) => {
803
818
// verification after discovery is complete
804
819
assert . ok (
@@ -860,6 +875,7 @@ suite('End to End Tests: test adapters', () => {
860
875
861
876
// set workspace to test workspace folder
862
877
workspaceUri = Uri . parse ( rootPathErrorWorkspace ) ;
878
+ configService . getSettings ( workspaceUri ) . testing . unittestArgs = [ '-s' , '.' , '-p' , '*test*.py' ] ;
863
879
864
880
// run pytest execution
865
881
const executionAdapter = new UnittestTestExecutionAdapter (
@@ -921,6 +937,7 @@ suite('End to End Tests: test adapters', () => {
921
937
922
938
// set workspace to test workspace folder
923
939
workspaceUri = Uri . parse ( rootPathErrorWorkspace ) ;
940
+ configService . getSettings ( workspaceUri ) . testing . pytestArgs = [ ] ;
924
941
925
942
// run pytest execution
926
943
const executionAdapter = new PytestTestExecutionAdapter (
0 commit comments