Skip to content

Commit 2994e29

Browse files
Add expanded data science test plan (microsoft#4731)
Force push over failing Windows debugger tests.
1 parent 1cc6f39 commit 2994e29

5 files changed

Lines changed: 271 additions & 5 deletions

File tree

.github/test_plan.md

Lines changed: 105 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -355,9 +355,109 @@ def test_failure():
355355
- [ ] The first `"request": "test"` entry in launch.json is used for running unit tests
356356

357357
### [Data Science](https://code.visualstudio.com/docs/python/jupyter-support)
358-
- [ ] Set Python environment to Anaconda
359-
- [ ] Single cell execution works
360-
- [ ] `Run All Cells` in Jupyter code works
361-
- [ ] Typing code into Python interactive window works
362-
358+
#### P0 Test Scenarios
359+
- [ ] Start and connect to local Jupyter server
360+
1. Open the file src/test/datascience/manualTestFiles/manualTestFile.py in VSCode
361+
1. At the top of the file it will list the things that you need installed in your Python environment
362+
1. On the first cell click `Run Cell And All Below`
363+
1. Interactive Window should open, show connection information, and execute cells
364+
1. The first thing in the window should have a line like this: `Jupyter Server URI: http://localhost:[port number]/?token=[token value]`
365+
- [ ] Verify basic outputs
366+
1. Run all the cells in manualTestFile.py
367+
1. Check to make sure that no outputs have errors
368+
1. Verify that graphs and progress bars are shown
369+
- [ ] Verify export / import
370+
1. With the results from `Start and connect to local server` open click the `Export as Jupyter Notebook` button in the Interactive Window
371+
1. Choose a file location and save the generated .ipynb file
372+
1. When the prompt comes up in the lower right choose to open the file in the browser
373+
1. The file should open in the web browser and contain the output from the Interactive Window
374+
1. In VSCode open up the exported .ipynb file in the editor, when the prompt for `Do you want to import the Jupyter Notebook into Python code?` appears click import
375+
1. The imported file should match the original python file
376+
- [ ] Verify text entry
377+
1. In the Interactive Window type in some new code `print('testing')` and submit it to the Interactive Windows
378+
1. Verify the output from what you added
379+
- [ ] Verify dark and light main themes
380+
1. Repeat the `Start and connect to local server` and `Verify basic outputs` steps using `Default Dark+` and `Default Light+` themes
381+
382+
#### P1 Test Scenarios
383+
- [ ] Connect to a `remote` server
384+
1. Open up a valid python command prompt that can run `jupyter notebook` (a default Anaconda prompt works well)
385+
1. Run `jupyter notebook` to start up a local Jupyter server
386+
1. In the command window that launched Jupyter look for the server / token name like so: http://localhost:8888/?token=bf9eae43641cd75015df9104f814b8763ef0e23ffc73720d
387+
1. Run the command `Python: Select Jupyter server URI` then `Type in the URI to connect to a running jupyter server`
388+
1. Input the server / token name here
389+
1. Now run the cells in the manualTestFile.py
390+
1. Verify that you see the server name in the initial connection message
391+
1. Verify the outputs of the cells
392+
- [ ] Interactive Window commands
393+
- [ ] Verify per-cell commands
394+
1. Expand and collapse the input area of a cell
395+
1. Use the `X` button to remove a cell
396+
1. Use the `Goto Code` button to jump to the part of the .py file that submitted the code
397+
- [ ] Verify top menu commands
398+
1. Use `X` to delete all cells
399+
1. Undo the delete action with `Undo`
400+
1. Redo the delete action with `Redo`
401+
1. In manualTestFile.py modify the trange command in the progress bar from 100 to 2000. Run the Cell. As the cell is running hit the `Interrupt iPython Kernel` button
402+
1. The progress bar should be interrupted and you should see a KeyboardInterrupt error message in the output
403+
1. Test the `Restart iPython kernel` command. Kernel should be restarted and you should see a status output message for the kernel restart
404+
1. Use the expand all input and collapse all input commands to collapse all cell inputs
405+
- [ ] Verify code lenses
406+
1. Check that `Run Cell` `Run All Cells Above` and `Run Cell And All Below` all do the correct thing
407+
- [ ] Verify context menu navigation commands
408+
1. Check the `Run Current Cell` and `Run Current Cell And Advance` context menu commands
409+
1. If run on the last cell of the file `Run Current Cell And Advance` should create a new empty cell and advance to it
410+
- [ ] Verify command palette commands
411+
1. Close the Interactive Window then pick `Python: Show Interactive Window`
412+
1. Restart the kernel and pick `Python: Run Current File In Python Interactive Window` it should run the whole file again
413+
- [ ] Verify shift-enter
414+
1. Move to the top cell in the .py file
415+
1. Shift-enter should run each cell and advance to the next
416+
1. Shift-enter on the final cell should create a new cell and move to it
417+
- [ ] Verify file without cells
418+
1. Open the manualTestFileNoCells.py file
419+
1. Select a chunk of code, shift-enter should send it to the terminal
420+
1. Open VSCode settings, change `Send Selection To Interactive Window` to true
421+
1. Select a chunk of code, shift-enter should send that selection to the Interactive Windows
422+
1. Move your cursor to a line, but don't select anything. Shift-enter should send that line to the Interactive Window
423+
- [ ] Multiple installs
424+
1. Close and re-open VSCode to make sure that all jupyter servers are closed
425+
1. Also make sure you are set to locally launch Jupyter and not to connect to an existing URI
426+
1. In addition to your main testing environment install a new python or miniconda install (conda won't work as it has Jupyter by default)
427+
1. In VS code change the python interpreter to the new install
428+
1. Try `Run Cell`
429+
1. You should get a message that Jupyter was not found and that it is defaulting back to launch on the python instance that has Jupyter
430+
- [ ] LiveShare Support
431+
1. Install the LiveShare VSCode Extension
432+
1. Open manualTestFile.py in VSCode
433+
1. Run the first cell in the file
434+
1. Switch to the `Live Share` tab in VS Code and start a session
435+
- [ ] Verify server start
436+
1. Jupyter server instance should appear in the live share tab
437+
1. Open another window of VSCode
438+
1. Connect the second instance of VSCode as a Guest to the first Live Share session
439+
1. After the workspace opens, open the manualTestFile.py on the Guest instance
440+
1. On the Guest instance run a cell from the file, both via the codelens and via the command palette `Run Cell` command
441+
- [ ] Verify results
442+
1. Output should show up on the Guest Interactive Window
443+
1. Same output should show up in the Host Interactive Window
444+
1. On the Host instance run a cell from the file, both via the codelens and via the command palette
445+
- [ ] Verify results
446+
1. Output should show up on the Guest Interactive Window
447+
1. Same output should show up in the Host Interactive Window
448+
449+
#### P2 Test Scenarios
450+
- [ ] Directory change
451+
- [ ] Verify directory change in export
452+
1. Follow the previous steps for export, but export the ipynb to a directory outside of the current workspace
453+
1. Open the file in the browser, you should get an initial cell added to change directory back to your workspace directory
454+
- [ ] Verify directory change in import
455+
1. Follow the previous steps for import, but import an ipynb that is located outside of your current workspace
456+
1. Open the file in the editor. There should be python code at the start to change directory to the previous location of the .ipynb file
457+
- [ ] Interactive Window input history history
458+
1. Start up an Interactive Window session
459+
1. Input several lines into the Interactive Window terminal
460+
1. Press up to verify that those previously entered lines show in the Interactive Window terminal history
461+
- [ ] Extra themes
462+
1. Try several of the themes that come with VSCode that are not the default Dark+ and Light+
363463
</details>

news/3 Code Health/4716.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Add manual test plan for data science
Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
# To run this file either conda or pip install the following: jupyter, numpy, matplotlib, pandas, tqdm, bokeh
2+
# Or run the requirements.txt file included next to this file
3+
4+
#%% Basic Imports
5+
import numpy as np
6+
import pandas as pd
7+
import matplotlib.pyplot as plt
8+
9+
#%% Matplotlib Plot
10+
x = np.linspace(0, 20, 100)
11+
plt.plot(x, np.sin(x))
12+
plt.show()
13+
14+
#%% Bokeh Plot
15+
from bokeh.io import output_notebook, show
16+
from bokeh.plotting import figure
17+
output_notebook()
18+
p = figure(plot_width=400, plot_height=400)
19+
p.circle([1,2,3,4,5], [6,7,2,4,5], size=15, line_color="navy", fill_color="orange", fill_alpha=0.5)
20+
show(p)
21+
22+
#%% Progress bar
23+
from tqdm import trange
24+
import time
25+
for i in trange(100):
26+
time.sleep(0.01)
27+
28+
#%% [markdown]
29+
# # Heading
30+
# ## Sub-heading
31+
# *bold*,_italic_,`monospace`
32+
# Horizontal rule
33+
# ---
34+
# Bullet List
35+
# * Apples
36+
# * Pears
37+
# Numbered List
38+
# 1. ???
39+
# 2. Profit
40+
#
41+
# [Link](http://www.microsoft.com)
42+
43+
#%% Magics
44+
%whos
Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
import numpy as np
2+
import pandas as pd
3+
import matplotlib.pyplot as plt
4+
5+
# Matplotlib Plot
6+
x = np.linspace(0, 20, 100)
7+
plt.plot(x, np.sin(x))
8+
plt.show()
9+
10+
# Bokeh Plot
11+
from bokeh.io import output_notebook, show
12+
from bokeh.plotting import figure
13+
output_notebook()
14+
p = figure(plot_width=400, plot_height=400)
15+
p.circle([1,2,3,4,5], [6,7,2,4,5], size=15, line_color="navy", fill_color="orange", fill_alpha=0.5)
16+
show(p)
17+
18+
# Progress bar
19+
from tqdm import trange
20+
import time
21+
for i in trange(100):
22+
time.sleep(0.01)
Lines changed: 99 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,99 @@
1+
# This file may be used to create an environment using:
2+
# $ conda create --name <env> --file <this file>
3+
# platform: win-64
4+
attrs=19.1.0=py_0
5+
backcall=0.1.0=py37_0
6+
blas=1.0=mkl
7+
bleach=3.1.0=py37_0
8+
bokeh=1.0.4=py37_0
9+
ca-certificates=2019.1.23=0
10+
certifi=2019.3.9=py37_0
11+
colorama=0.4.1=py37_0
12+
cycler=0.10.0=py37_0
13+
decorator=4.3.2=py37_0
14+
entrypoints=0.3=py37_0
15+
freetype=2.9.1=ha9979f8_1
16+
icc_rt=2019.0.0=h0cc432a_1
17+
icu=58.2=ha66f8fd_1
18+
intel-openmp=2019.1=144
19+
ipykernel=5.1.0=py37h39e3cac_0
20+
ipython=7.3.0=py37h39e3cac_0
21+
ipython_genutils=0.2.0=py37_0
22+
ipywidgets=7.4.2=py37_0
23+
jedi=0.13.3=py37_0
24+
jinja2=2.10=py37_0
25+
jpeg=9b=hb83a4c4_2
26+
jsonschema=3.0.1=py37_0
27+
jupyter=1.0.0=py37_7
28+
jupyter_client=5.2.4=py37_0
29+
jupyter_console=6.0.0=py37_0
30+
jupyter_core=4.4.0=py37_0
31+
kiwisolver=1.0.1=py37h6538335_0
32+
libpng=1.6.36=h2a8f88b_0
33+
libsodium=1.0.16=h9d3ae62_0
34+
libtiff=4.0.10=hb898794_2
35+
m2w64-gcc-libgfortran=5.3.0=6
36+
m2w64-gcc-libs=5.3.0=7
37+
m2w64-gcc-libs-core=5.3.0=7
38+
m2w64-gmp=6.1.0=2
39+
m2w64-libwinpthread-git=5.0.0.4634.697f757=2
40+
markupsafe=1.1.1=py37he774522_0
41+
matplotlib=3.0.2=py37hc8f65d3_0
42+
mistune=0.8.4=py37he774522_0
43+
mkl=2019.1=144
44+
mkl_fft=1.0.10=py37h14836fe_0
45+
mkl_random=1.0.2=py37h343c172_0
46+
msys2-conda-epoch=20160418=1
47+
nbconvert=5.3.1=py37_0
48+
nbformat=4.4.0=py37_0
49+
notebook=5.7.6=py37_0
50+
numpy=1.16.2=py37h19fb1c0_0
51+
numpy-base=1.16.2=py37hc3f5095_0
52+
olefile=0.46=py37_0
53+
openssl=1.1.1b=he774522_1
54+
packaging=19.0=py37_0
55+
pandas=0.24.1=py37ha925a31_0
56+
pandoc=2.2.3.2=0
57+
pandocfilters=1.4.2=py37_1
58+
parso=0.3.4=py37_0
59+
pickleshare=0.7.5=py37_0
60+
pillow=5.4.1=py37hdc69c19_0
61+
pip=19.0.3=py37_0
62+
prometheus_client=0.6.0=py37_0
63+
prompt_toolkit=2.0.9=py37_0
64+
pygments=2.3.1=py37_0
65+
pyparsing=2.3.1=py37_0
66+
pyqt=5.9.2=py37h6538335_2
67+
pyrsistent=0.14.11=py37he774522_0
68+
python=3.7.2=h8c8aaf0_10
69+
python-dateutil=2.8.0=py37_0
70+
pytz=2018.9=py37_0
71+
pywinpty=0.5.5=py37_1000
72+
pyyaml=3.13=py37hfa6e2cd_0
73+
pyzmq=18.0.0=py37ha925a31_0
74+
qt=5.9.7=vc14h73c81de_0
75+
qtconsole=4.4.3=py37_0
76+
send2trash=1.5.0=py37_0
77+
setuptools=40.8.0=py37_0
78+
sip=4.19.8=py37h6538335_0
79+
six=1.12.0=py37_0
80+
sqlite=3.26.0=he774522_0
81+
terminado=0.8.1=py37_1
82+
testpath=0.4.2=py37_0
83+
tk=8.6.8=hfa6e2cd_0
84+
tornado=6.0.1=py37he774522_0
85+
tqdm=4.31.1=py_0
86+
traitlets=4.3.2=py37_0
87+
vc=14.1=h0510ff6_4
88+
vs2015_runtime=14.15.26706=h3a45250_0
89+
wcwidth=0.1.7=py37_0
90+
webencodings=0.5.1=py37_1
91+
wheel=0.33.1=py37_0
92+
widgetsnbextension=3.4.2=py37_0
93+
wincertstore=0.2=py37_0
94+
winpty=0.4.3=4
95+
xz=5.2.4=h2fa13f4_4
96+
yaml=0.1.7=hc54c509_2
97+
zeromq=4.3.1=h33f27b4_3
98+
zlib=1.2.11=h62dcd97_3
99+
zstd=1.3.7=h508b16e_0

0 commit comments

Comments
 (0)