@@ -6,81 +6,78 @@ import { EXTENSION_ROOT_DIR_FOR_TESTS, IS_SMOKE_TEST } from '../constants';
66import { closeActiveWindows , initialize , initializeTest } from '../initialize' ;
77import { openFile , waitForCondition } from '../common' ;
88
9- // TODO: This test is being flaky for windows, need to investigate why only fails on windows
10- if ( process . platform !== 'win32' ) {
11- suite ( 'Smoke Test: Run Smart Selection and Advance Cursor' , ( ) => {
12- suiteSetup ( async function ( ) {
13- if ( ! IS_SMOKE_TEST ) {
14- return this . skip ( ) ;
15- }
16- await initialize ( ) ;
17- return undefined ;
18- } ) ;
9+ suite ( 'Smoke Test: Run Smart Selection and Advance Cursor' , async ( ) => {
10+ suiteSetup ( async function ( ) {
11+ if ( ! IS_SMOKE_TEST ) {
12+ return this . skip ( ) ;
13+ }
14+ await initialize ( ) ;
15+ return undefined ;
16+ } ) ;
1917
20- setup ( initializeTest ) ;
21- suiteTeardown ( closeActiveWindows ) ;
22- teardown ( closeActiveWindows ) ;
18+ setup ( initializeTest ) ;
19+ suiteTeardown ( closeActiveWindows ) ;
20+ teardown ( closeActiveWindows ) ;
2321
24- test ( 'Smart Send' , async ( ) => {
25- const file = path . join (
26- EXTENSION_ROOT_DIR_FOR_TESTS ,
27- 'src' ,
28- 'testMultiRootWkspc' ,
29- 'smokeTests' ,
30- 'create_delete_file.py' ,
31- ) ;
32- const outputFile = path . join (
33- EXTENSION_ROOT_DIR_FOR_TESTS ,
34- 'src' ,
35- 'testMultiRootWkspc' ,
36- 'smokeTests' ,
37- 'smart_send_smoke.txt' ,
38- ) ;
22+ test ( 'Smart Send' , async ( ) => {
23+ const file = path . join (
24+ EXTENSION_ROOT_DIR_FOR_TESTS ,
25+ 'src' ,
26+ 'testMultiRootWkspc' ,
27+ 'smokeTests' ,
28+ 'create_delete_file.py' ,
29+ ) ;
30+ const outputFile = path . join (
31+ EXTENSION_ROOT_DIR_FOR_TESTS ,
32+ 'src' ,
33+ 'testMultiRootWkspc' ,
34+ 'smokeTests' ,
35+ 'smart_send_smoke.txt' ,
36+ ) ;
3937
40- await fs . remove ( outputFile ) ;
38+ await fs . remove ( outputFile ) ;
4139
42- const textDocument = await openFile ( file ) ;
40+ const textDocument = await openFile ( file ) ;
4341
44- if ( vscode . window . activeTextEditor ) {
45- const myPos = new vscode . Position ( 0 , 0 ) ;
46- vscode . window . activeTextEditor ! . selections = [ new vscode . Selection ( myPos , myPos ) ] ;
47- }
48- await vscode . commands
49- . executeCommand < void > ( 'python.execSelectionInTerminal' , textDocument . uri )
50- . then ( undefined , ( err ) => {
51- assert . fail ( `Something went wrong running the Python file in the terminal: ${ err } ` ) ;
52- } ) ;
42+ if ( vscode . window . activeTextEditor ) {
43+ const myPos = new vscode . Position ( 0 , 0 ) ;
44+ vscode . window . activeTextEditor ! . selections = [ new vscode . Selection ( myPos , myPos ) ] ;
45+ }
46+ await vscode . commands
47+ . executeCommand < void > ( 'python.execSelectionInTerminal' , textDocument . uri )
48+ . then ( undefined , ( err ) => {
49+ assert . fail ( `Something went wrong running the Python file in the terminal: ${ err } ` ) ;
50+ } ) ;
5351
54- const checkIfFileHasBeenCreated = ( ) => fs . pathExists ( outputFile ) ;
55- await waitForCondition ( checkIfFileHasBeenCreated , 10_000 , `"${ outputFile } " file not created` ) ;
52+ const checkIfFileHasBeenCreated = ( ) => fs . pathExists ( outputFile ) ;
53+ await waitForCondition ( checkIfFileHasBeenCreated , 20_000 , `"${ outputFile } " file not created` ) ;
5654
57- await vscode . commands
58- . executeCommand < void > ( 'python.execSelectionInTerminal' , textDocument . uri )
59- . then ( undefined , ( err ) => {
60- assert . fail ( `Something went wrong running the Python file in the terminal: ${ err } ` ) ;
61- } ) ;
62- await vscode . commands
63- . executeCommand < void > ( 'python.execSelectionInTerminal' , textDocument . uri )
64- . then ( undefined , ( err ) => {
65- assert . fail ( `Something went wrong running the Python file in the terminal: ${ err } ` ) ;
66- } ) ;
55+ await vscode . commands
56+ . executeCommand < void > ( 'python.execSelectionInTerminal' , textDocument . uri )
57+ . then ( undefined , ( err ) => {
58+ assert . fail ( `Something went wrong running the Python file in the terminal: ${ err } ` ) ;
59+ } ) ;
60+ await vscode . commands
61+ . executeCommand < void > ( 'python.execSelectionInTerminal' , textDocument . uri )
62+ . then ( undefined , ( err ) => {
63+ assert . fail ( `Something went wrong running the Python file in the terminal: ${ err } ` ) ;
64+ } ) ;
6765
68- async function wait ( ) {
69- return new Promise < void > ( ( resolve ) => {
70- setTimeout ( ( ) => {
71- resolve ( ) ;
72- } , 10000 ) ;
73- } ) ;
74- }
66+ async function wait ( ) {
67+ return new Promise < void > ( ( resolve ) => {
68+ setTimeout ( ( ) => {
69+ resolve ( ) ;
70+ } , 10000 ) ;
71+ } ) ;
72+ }
7573
76- await wait ( ) ;
74+ await wait ( ) ;
7775
78- const deletedFile = ! ( await fs . pathExists ( outputFile ) ) ;
79- if ( deletedFile ) {
80- assert . ok ( true , `"${ outputFile } " file has been deleted` ) ;
81- } else {
82- assert . fail ( `"${ outputFile } " file still exists` ) ;
83- }
84- } ) ;
76+ const deletedFile = ! ( await fs . pathExists ( outputFile ) ) ;
77+ if ( deletedFile ) {
78+ assert . ok ( true , `"${ outputFile } " file has been deleted` ) ;
79+ } else {
80+ assert . fail ( `"${ outputFile } " file still exists` ) ;
81+ }
8582 } ) ;
86- }
83+ } ) ;
0 commit comments