forked from DonJayamanne/pythonVSCode
-
Notifications
You must be signed in to change notification settings - Fork 1.2k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fixes to UI Tests related to LS (#7659)
* Fix LS UI Tests * Warn instead of throwing exception * Create file * Increase delays * Added comments
- Loading branch information
1 parent
b7ad1d1
commit 9315191
Showing
10 changed files
with
144 additions
and
140 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
# Notes: | ||
|
||
* Why do have delays of >= 120 seconds when using LS. | ||
* 1. This is to provide LS sufficient time to analyze the entire workspace. | ||
* E.g. when using a `conda` environment, LS takes a long time to complete analysis. | ||
* This results in delays in responsiveness of LS, i.e. features such as `intellisense`, `code navigation`, etc might not be ready or won't respond in time. | ||
* To determine whether the LS has completed analysis, we ensure the statusbar item `Analyzing in background` is no longer visible. | ||
* 2. Also, it takes time to download & extract the Language Server |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,64 +1,47 @@ | ||
@ls | ||
@code:code/languageServer/basic | ||
Feature: Language Server | ||
Scenario Outline: When <reload_or_start_vs_for_first_time> with Jedi <jedi_enable>d then output contains <text_in_output_panel> | ||
When <reload_or_start_vs_for_first_time> | ||
And I <jedi_enable> the workspace setting "python.jediEnabled" | ||
And I wait for the Python extension to activate | ||
And I select the command "<output_panel_command>" | ||
Then the text "<text_in_output_panel>" will be displayed in the output panel within <time_to_activate> seconds | ||
|
||
Examples: | ||
| jedi_enable | reload_or_start_vs_for_first_time | time_to_activate | text_in_output_panel | output_panel_command | | ||
| enable | I open VS Code for the first time | 5 | Jedi Python language engine | Python: Show Output | | ||
| enable | I reload VS Code | 5 | Jedi Python language engine | Python: Show Output | | ||
| disable | I open VS Code for the first time | 120 | Microsoft Python language server | Python: Show Output | | ||
| disable | I open VS Code for the first time | 120 | Downloading | Python: Show Language Server Output | | ||
| disable | I reload VS Code | 120 | Microsoft Python language server | Python: Show Output | | ||
|
||
@autoretry | ||
Scenario Outline: When <reload_or_start_vs_for_first_time> with Jedi <jedi_enable>d then navigate to definition of a variable | ||
Scenario Outline: When <reload_or_start_vs_for_first_time> then navigate to the definition of a variable after opening file with Jedi enabled | ||
When <reload_or_start_vs_for_first_time> | ||
And I <jedi_enable> the workspace setting "python.jediEnabled" | ||
And I enable the workspace setting "python.jediEnabled" | ||
And I wait for the Python extension to activate | ||
And I select the command "<output_panel_command>" | ||
Then the text "<text_in_output_panel>" will be displayed in the output panel within <time_to_activate> seconds | ||
# Because LS is slow. | ||
And wait for <time_to_activate> seconds | ||
And I select the command "Python: Show Output" | ||
Then the text "Jedi Python language engine" will be displayed in the output panel within 10 seconds | ||
# Sometimes LS & Jedi are slow. | ||
And wait for 10 seconds | ||
When I open the file "my_sample.py" | ||
And I go to line 3, column 10 | ||
# Wait for intellisense to kick in (sometimes slow in jedi & ls) | ||
And I wait for 5 seconds | ||
And I select the command "Go to Definition" | ||
And I wait for 10 seconds | ||
When I select the command "Go to Definition" | ||
Then the cursor is on line 1 | ||
|
||
Examples: | ||
| jedi_enable | reload_or_start_vs_for_first_time | time_to_activate | text_in_output_panel | output_panel_command | | ||
| enable | I open VS Code for the first time | 5 | Jedi Python language engine | Python: Show Output | | ||
| enable | I reload VS Code | 5 | Jedi Python language engine | Python: Show Output | | ||
| disable | I open VS Code for the first time | 120 | Microsoft Python language server | Python: Show Output | | ||
| disable | I open VS Code for the first time | 120 | Downloading | Python: Show Language Server Output | | ||
| disable | I reload VS Code | 120 | Microsoft Python language server | Python: Show Output | | ||
| reload_or_start_vs_for_first_time | | ||
| I open VS Code for the first time | | ||
| I reload VS Code | | ||
|
||
@autoretry | ||
Scenario Outline: When I open VS Code for the first time with Jedi <jedi_enable>d, open a file then navigate to definition of a variable | ||
When I open VS Code for the first time | ||
And I <jedi_enable> the workspace setting "python.jediEnabled" | ||
And I select the command "Python: Show Output" | ||
Scenario Outline: When <reload_or_start_vs_for_first_time> then navigate to the definition of a variable after opening file with Language Server enabled | ||
When <reload_or_start_vs_for_first_time> | ||
And I disable the workspace setting "python.jediEnabled" | ||
And I wait for the Python extension to activate | ||
And I open the file "my_sample.py" | ||
And I select the command "<output_panel_command>" | ||
Then the text "<text_in_output_panel>" will be displayed in the output panel within <time_to_activate> seconds | ||
# Because LS is slow. | ||
And wait for <time_to_activate> seconds | ||
When I go to line 3, column 10 | ||
And I select the command "Python: Show Output" | ||
Then the text "Microsoft Python language server" will be displayed in the output panel within 120 seconds | ||
When I select the command "Python: Show Language Server Output" | ||
Then the text "Initializing for" will be displayed in the output panel within 120 seconds | ||
# Sometimes LS & Jedi are slow. | ||
When I wait for 10 seconds | ||
Then the status bar item containing the text "Analyzing in background" will be hidden within 120 seconds | ||
When I open the file "my_sample.py" | ||
And I go to line 3, column 10 | ||
# Wait for intellisense to kick in (sometimes slow in jedi & ls) | ||
And I wait for 5 seconds | ||
And I select the command "Go to Definition" | ||
And I wait for 10 seconds | ||
When I select the command "Go to Definition" | ||
Then the cursor is on line 1 | ||
|
||
Examples: | ||
| jedi_enable | time_to_activate | text_in_output_panel | output_panel_command | | ||
| enable | 5 | Jedi Python language engine | Python: Show Output | | ||
| disable | 120 | Microsoft Python language server | Python: Show Output | | ||
| disable | 120 | Downloading | Python: Show Language Server Output | | ||
| reload_or_start_vs_for_first_time | | ||
| I open VS Code for the first time | | ||
| I reload VS Code | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.