Skip to content

Commit de1bfe1

Browse files
authored
Merge PRs from python repo (#195)
* Remove cell index property and use build in prop (#14239) * Update other cells in cell execution (#14240) * Tests for prompting to install missing ipykernel (#14266) * Treat Native notebook tests as VS Code tests (#14282) * Fixes to blowing away of kernel info & not using right startup info (… … * Default cell language for native notebooks (#14314) * Ignore formatting in ipynb when dealing with trust (#14333) * Fixes to trust service (#14352) * Change `IPython kernel` to `Jupyter kernel` (#14375) * Trust for native notebooks (#14353)
1 parent 493c4ee commit de1bfe1

File tree

105 files changed

+4800
-1636
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

105 files changed

+4800
-1636
lines changed

.eslintignore

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -363,7 +363,7 @@ src/test/common/insidersBuild/insidersExtensionService.unit.test.ts
363363
src/test/pythonFiles/formatting/dummy.ts
364364

365365
src/test/format/extension.dispatch.test.ts
366-
src/test/format/extension.format.ds.test.ts
366+
src/test/format/extension.format.native.vscode.test.ts
367367
src/test/format/extension.onTypeFormat.test.ts
368368
src/test/format/extension.lineFormatter.test.ts
369369
src/test/format/extension.sort.test.ts
@@ -570,20 +570,20 @@ src/test/datascience/notebook.functional.test.ts
570570
src/test/datascience/mockLanguageClient.ts
571571
src/test/datascience/errorHandler.functional.test.tsx
572572
src/test/datascience/notebook/notebookStorage.unit.test.ts
573-
src/test/datascience/notebook/notebookTrust.ds.test.ts
573+
src/test/datascience/notebook/notebookTrust.native.vscode.test.ts
574574
src/test/datascience/notebook/rendererExtensionDownloader.unit.test.ts
575575
src/test/datascience/notebook/survey.unit.test.ts
576-
src/test/datascience/notebook/interrupRestart.ds.test.ts
577-
src/test/datascience/notebook/contentProvider.ds.test.ts
576+
src/test/datascience/notebook/interrupRestart.native.vscode.test.ts
577+
src/test/datascience/notebook/contentProvider.native.vscode.test.ts
578578
src/test/datascience/notebook/helper.ts
579579
src/test/datascience/notebook/contentProvider.unit.test.ts
580-
src/test/datascience/notebook/edit.ds.test.ts
580+
src/test/datascience/notebook/edit.native.vscode.test.ts
581581
src/test/datascience/notebook/rendererExension.unit.test.ts
582-
src/test/datascience/notebook/saving.ds.test.ts
583-
src/test/datascience/notebook/notebookEditorProvider.ds.test.ts
582+
src/test/datascience/notebook/saving.native.vscode.test.ts
583+
src/test/datascience/notebook/notebookEditorProvider.native.vscode.test.ts
584584
src/test/datascience/notebook/helpers.unit.test.ts
585-
src/test/datascience/notebook/executionService.ds.test.ts
586-
src/test/datascience/notebook/cellOutput.ds.test.ts
585+
src/test/datascience/notebook/executionService.native.vscode.test.ts
586+
src/test/datascience/notebook/cellOutput.native.vscode.test.ts
587587
src/test/datascience/interactiveWindowTestHelpers.tsx
588588
src/test/datascience/export/exportUtil.test.ts
589589
src/test/datascience/export/exportToHTML.test.ts

.github/PULL_REQUEST_TEMPLATE.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,5 +19,5 @@ For #
1919
**Optional tests to run**:
2020
Select one or more of the following tests to run as part of the CI for the current PR. If multiple tests are selected and one of them fails, then the rest will not run.
2121
* [ ] Run single-workspace tests (with VS Code, without Python extension & without Jupyter)
22-
* [ ] Run functional-with-jupyter tests (mocked VS Code, without Python extension & with Jupyter)
2322
* [ ] Run vscode tests (with VS Code, with Python extension & with Jupyter)
23+
* [ ] Run Notebook tests (with VS Code, with Python extension & with Jupyter)

.github/test_plan.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -520,9 +520,9 @@ def test_failure():
520520
1. Use `X` to delete all cells
521521
1. Undo the delete action with `Undo`
522522
1. Redo the delete action with `Redo`
523-
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
523+
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 Jupyter Kernel` button
524524
1. The progress bar should be interrupted and you should see a KeyboardInterrupt error message in the output
525-
1. Test the `Restart iPython kernel` command. Kernel should be restarted and you should see a status output message for the kernel restart
525+
1. Test the `Restart Jupyter kernel` command. Kernel should be restarted and you should see a status output message for the kernel restart
526526
1. Use the expand all input and collapse all input commands to collapse all cell inputs
527527
- [ ] Verify theming works
528528
1. Start Interactive window

.github/workflows/flaky.yml

Lines changed: 301 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -27,9 +27,9 @@ jobs:
2727
matrix:
2828
# We're not running CI on macOS for now because it's one less matrix entry to lower the number of runners used,
2929
# macOS runners are expensive, and we assume that Ubuntu is enough to cover the UNIX case.
30-
os: [ubuntu-latest, windows-latest]
31-
python: [3.6, 3.7, 3.8]
32-
test-suite: [python-unit, functional-with-jupyter]
30+
os: [ubuntu-latest]
31+
python: [3.8]
32+
test-suite: [group1, group2, group3, group4]
3333
steps:
3434
- name: Checkout
3535
uses: actions/checkout@v2
@@ -165,14 +165,305 @@ jobs:
165165
- name: Publish Test Report
166166
uses: scacap/action-surefire-report@v1
167167
with:
168-
github_token: ${{ secrets.GITHUB_TOKEN }}
169-
report_paths: ${{ env.TEST_RESULTS_GLOB }}
168+
github_token: ${{ secrets.GITHUB_TOKEN }}
169+
report_paths: ${{ env.TEST_RESULTS_GLOB }}
170170
check_name: Functional Test Report
171171
if: (steps.test_functional.outcome == 'failure' || steps.test_functional_jupyter.outcome == 'failure') && failure()
172172

173-
- name: Upload Functional Test Report
174-
uses: actions/upload-artifact@v2
173+
testsInVSCode:
174+
name: Tests in VS Code
175+
runs-on: ${{ matrix.os }}
176+
if: github.repository == 'microsoft/vscode-python'
177+
strategy:
178+
fail-fast: false
179+
matrix:
180+
# We're not running CI on macOS for now because it's one less matrix entry to lower the number of runners used,
181+
# macOS runners are expensive, and we assume that Ubuntu is enough to cover the UNIX case.
182+
os: [ubuntu-latest]
183+
python: [3.8]
184+
steps:
185+
- name: Checkout
186+
uses: actions/checkout@v2
187+
188+
- name: Use Python ${{matrix.python}}
189+
uses: actions/setup-python@v2
190+
with:
191+
python-version: ${{matrix.python}}
192+
193+
- name: Upgrade pip
194+
run: python -m pip install -U pip
195+
196+
- name: Use Node ${{env.NODE_VERSION}}
197+
uses: actions/[email protected]
198+
with:
199+
node-version: ${{env.NODE_VERSION}}
200+
201+
# Start caching
202+
203+
# Cache Python Dependencies.
204+
# Caching (https://github.com/actions/cache/blob/main/examples.md#python---pip
205+
- name: Cache pip on linux
206+
uses: actions/cache@v2
207+
if: matrix.os == 'ubuntu-latest'
175208
with:
176-
name: functional-jupyter-test-result-${{ matrix.os }}-${{ matrix.python }}
177-
path: ${{ env.TEST_RESULTS_GLOB }}
178-
if: steps.test_functional_jupyter.outcome == 'failure' && failure()
209+
path: ~/.cache/pip
210+
key: ${{ runner.os }}-pip-${{env.PYTHON_VERSION}}-${{ hashFiles('requirements.txt') }}-${{hashFiles('build/debugger-install-requirements.txt')}}-${{hashFiles('test-requirements.txt')}}-${{hashFiles('ipython-test-requirements.txt')}}-${{hashFiles('functional-test-requirements.txt')}}-${{hashFiles('conda-functional-requirements.txt')}}
211+
restore-keys: |
212+
${{ runner.os }}-pip-${{env.PYTHON_VERSION}}-
213+
214+
- name: Cache pip on mac
215+
uses: actions/cache@v2
216+
if: matrix.os == 'macos-latest'
217+
with:
218+
path: ~/Library/Caches/pip
219+
key: ${{ runner.os }}-pip-${{env.PYTHON_VERSION}}-${{ hashFiles('requirements.txt') }}-${{hashFiles('build/debugger-install-requirements.txt')}}-${{hashFiles('test-requirements.txt')}}-${{hashFiles('ipython-test-requirements.txt')}}-${{hashFiles('functional-test-requirements.txt')}}-${{hashFiles('conda-functional-requirements.txt')}}
220+
restore-keys: |
221+
${{ runner.os }}-pip-${{env.PYTHON_VERSION}}-
222+
223+
- name: Cache pip on windows
224+
uses: actions/cache@v2
225+
if: matrix.os == 'windows-latest'
226+
with:
227+
path: ~\AppData\Local\pip\Cache
228+
key: ${{ runner.os }}-pip-${{env.PYTHON_VERSION}}-${{ hashFiles('requirements.txt') }}-${{hashFiles('build/debugger-install-requirements.txt')}}-${{hashFiles('test-requirements.txt')}}-${{hashFiles('ipython-test-requirements.txt')}}-${{hashFiles('functional-test-requirements.txt')}}-${{hashFiles('conda-functional-requirements.txt')}}
229+
restore-keys: |
230+
${{ runner.os }}-pip-${{env.PYTHON_VERSION}}-
231+
232+
# Caching of npm packages (https://github.com/actions/cache/blob/main/examples.md#node---npm)
233+
- name: Cache npm on linux/mac
234+
uses: actions/cache@v2
235+
if: matrix.os != 'windows-latest'
236+
with:
237+
path: ~/.npm
238+
key: ${{ runner.os }}-node-${{ hashFiles('**/package-lock.json') }}
239+
restore-keys: |
240+
${{ runner.os }}-node-
241+
242+
- name: Get npm cache directory
243+
if: matrix.os == 'windows-latest'
244+
id: npm-cache
245+
run: |
246+
echo "::set-output name=dir::$(npm config get cache)"
247+
- name: Cache npm on windows
248+
uses: actions/cache@v2
249+
if: matrix.os == 'windows-latest'
250+
with:
251+
path: ${{ steps.npm-cache.outputs.dir }}
252+
key: ${{ runner.os }}-node-${{ hashFiles('**/package-lock.json') }}
253+
restore-keys: |
254+
${{ runner.os }}-node-
255+
256+
- name: Cache compiled TS files
257+
id: out-cache
258+
uses: actions/cache@v2
259+
with:
260+
path: ./out
261+
key: ${{runner.os}}-${{env.CACHE_OUT_DIRECTORY}}-${{hashFiles('src/**')}}
262+
263+
# For faster/better builds of sdists.
264+
- run: python -m pip install wheel
265+
shell: bash
266+
267+
# debugpy is not shipped, only installed for local tests.
268+
# In production, we get debugpy from python extension.
269+
- name: Install functional test requirements
270+
run: |
271+
python -m pip --disable-pip-version-check install -t ./pythonFiles/lib/python --no-cache-dir --implementation py --no-deps --upgrade -r ./requirements.txt
272+
python -m pip --disable-pip-version-check install -r build/debugger-install-requirements.txt
273+
python ./pythonFiles/install_debugpy.py
274+
python -m pip install numpy
275+
python -m pip install --upgrade jupyter
276+
python -m pip install --upgrade -r build/test-requirements.txt
277+
python -m pip install --upgrade -r ./build/ipython-test-requirements.txt
278+
python -m pip install --upgrade -r ./build/conda-functional-requirements.txt
279+
python -m ipykernel install --user
280+
# This step is slow.
281+
282+
- name: Install dependencies (npm ci)
283+
run: npm ci --prefer-offline
284+
# This step is slow.
285+
286+
- name: Compile if not cached
287+
run: npx gulp prePublishNonBundle
288+
289+
290+
- name: Install Julia
291+
uses: julia-actions/setup-julia@v1
292+
with:
293+
version: 1.5.2
294+
295+
- name: Install Jualia Kernel
296+
run: |
297+
julia -e '
298+
using Pkg
299+
Pkg.add("IJulia")'
300+
301+
- name: Run VSCode tests
302+
uses: GabrielBB/[email protected]
303+
with:
304+
run: npm run testDataScienceInVSCode
305+
env:
306+
DISPLAY: 10
307+
VSCODE_PYTHON_ROLLING: 1
308+
VSC_PYTHON_FORCE_LOGGING: 1
309+
VSC_PYTHON_CI_NON_PYTHON_NB_TEST: 1
310+
VSC_PYTHON_LOAD_EXPERIMENTS_FROM_FILE: 'true'
311+
id: test_functional
312+
313+
- name: Publish Test Report
314+
uses: scacap/action-surefire-report@v1
315+
with:
316+
github_token: ${{ secrets.GITHUB_TOKEN }}
317+
report_paths: ${{ env.TEST_RESULTS_GLOB }}
318+
check_name: VSCode Test Report
319+
if: steps.test_functional.outcome == 'failure' && failure()
320+
321+
322+
# testsInVSCodeInsiders:
323+
# name: Tests in VS Code Insiders
324+
# runs-on: ${{ matrix.os }}
325+
# if: github.repository == 'microsoft/vscode-python'
326+
# strategy:
327+
# fail-fast: false
328+
# matrix:
329+
# # We're not running CI on macOS for now because it's one less matrix entry to lower the number of runners used,
330+
# # macOS runners are expensive, and we assume that Ubuntu is enough to cover the UNIX case.
331+
# os: [ubuntu-latest]
332+
# python: [3.8]
333+
# steps:
334+
# - name: Checkout
335+
# uses: actions/checkout@v2
336+
337+
# - name: Use Python ${{matrix.python}}
338+
# uses: actions/setup-python@v2
339+
# with:
340+
# python-version: ${{matrix.python}}
341+
342+
# - name: Upgrade pip
343+
# run: python -m pip install -U pip
344+
345+
# - name: Use Node ${{env.NODE_VERSION}}
346+
# uses: actions/[email protected]
347+
# with:
348+
# node-version: ${{env.NODE_VERSION}}
349+
350+
# # Start caching
351+
352+
# # Cache Python Dependencies.
353+
# # Caching (https://github.com/actions/cache/blob/main/examples.md#python---pip
354+
# - name: Cache pip on linux
355+
# uses: actions/cache@v2
356+
# if: matrix.os == 'ubuntu-latest'
357+
# with:
358+
# path: ~/.cache/pip
359+
# key: ${{ runner.os }}-pip-${{env.PYTHON_VERSION}}-${{ hashFiles('requirements.txt') }}-${{hashFiles('build/debugger-install-requirements.txt')}}-${{hashFiles('test-requirements.txt')}}-${{hashFiles('ipython-test-requirements.txt')}}-${{hashFiles('functional-test-requirements.txt')}}-${{hashFiles('conda-functional-requirements.txt')}}
360+
# restore-keys: |
361+
# ${{ runner.os }}-pip-${{env.PYTHON_VERSION}}-
362+
363+
# - name: Cache pip on mac
364+
# uses: actions/cache@v2
365+
# if: matrix.os == 'macos-latest'
366+
# with:
367+
# path: ~/Library/Caches/pip
368+
# key: ${{ runner.os }}-pip-${{env.PYTHON_VERSION}}-${{ hashFiles('requirements.txt') }}-${{hashFiles('build/debugger-install-requirements.txt')}}-${{hashFiles('test-requirements.txt')}}-${{hashFiles('ipython-test-requirements.txt')}}-${{hashFiles('functional-test-requirements.txt')}}-${{hashFiles('conda-functional-requirements.txt')}}
369+
# restore-keys: |
370+
# ${{ runner.os }}-pip-${{env.PYTHON_VERSION}}-
371+
372+
# - name: Cache pip on windows
373+
# uses: actions/cache@v2
374+
# if: matrix.os == 'windows-latest'
375+
# with:
376+
# path: ~\AppData\Local\pip\Cache
377+
# key: ${{ runner.os }}-pip-${{env.PYTHON_VERSION}}-${{ hashFiles('requirements.txt') }}-${{hashFiles('build/debugger-install-requirements.txt')}}-${{hashFiles('test-requirements.txt')}}-${{hashFiles('ipython-test-requirements.txt')}}-${{hashFiles('functional-test-requirements.txt')}}-${{hashFiles('conda-functional-requirements.txt')}}
378+
# restore-keys: |
379+
# ${{ runner.os }}-pip-${{env.PYTHON_VERSION}}-
380+
381+
# # Caching of npm packages (https://github.com/actions/cache/blob/main/examples.md#node---npm)
382+
# - name: Cache npm on linux/mac
383+
# uses: actions/cache@v2
384+
# if: matrix.os != 'windows-latest'
385+
# with:
386+
# path: ~/.npm
387+
# key: ${{ runner.os }}-node-${{ hashFiles('**/package-lock.json') }}
388+
# restore-keys: |
389+
# ${{ runner.os }}-node-
390+
391+
# - name: Get npm cache directory
392+
# if: matrix.os == 'windows-latest'
393+
# id: npm-cache
394+
# run: |
395+
# echo "::set-output name=dir::$(npm config get cache)"
396+
# - name: Cache npm on windows
397+
# uses: actions/cache@v2
398+
# if: matrix.os == 'windows-latest'
399+
# with:
400+
# path: ${{ steps.npm-cache.outputs.dir }}
401+
# key: ${{ runner.os }}-node-${{ hashFiles('**/package-lock.json') }}
402+
# restore-keys: |
403+
# ${{ runner.os }}-node-
404+
405+
# - name: Cache compiled TS files
406+
# id: out-cache
407+
# uses: actions/cache@v2
408+
# with:
409+
# path: ./out
410+
# key: ${{runner.os}}-${{env.CACHE_OUT_DIRECTORY}}-${{hashFiles('src/**')}}
411+
412+
# # For faster/better builds of sdists.
413+
# - run: python -m pip install wheel
414+
# shell: bash
415+
416+
# # debugpy is not shipped, only installed for local tests.
417+
# # In production, we get debugpy from python extension.
418+
# - name: Install functional test requirements
419+
# run: |
420+
# python -m pip --disable-pip-version-check install -t ./pythonFiles/lib/python --no-cache-dir --implementation py --no-deps --upgrade -r ./requirements.txt
421+
# python -m pip --disable-pip-version-check install -r build/debugger-install-requirements.txt
422+
# python ./pythonFiles/install_debugpy.py
423+
# python -m pip install numpy
424+
# python -m pip install --upgrade jupyter
425+
# python -m pip install --upgrade -r build/test-requirements.txt
426+
# python -m pip install --upgrade -r ./build/ipython-test-requirements.txt
427+
# python -m pip install --upgrade -r ./build/conda-functional-requirements.txt
428+
# python -m ipykernel install --user
429+
# # This step is slow.
430+
431+
# - name: Install dependencies (npm ci)
432+
# run: npm ci --prefer-offline
433+
# # This step is slow.
434+
435+
# - name: Compile if not cached
436+
# run: npx gulp prePublishNonBundle
437+
438+
# - name: Install Julia
439+
# uses: julia-actions/setup-julia@v1
440+
# with:
441+
# version: 1.5.2
442+
443+
# - name: Install Jualia Kernel
444+
# run: |
445+
# julia -e '
446+
# using Pkg
447+
# Pkg.add("IJulia")'
448+
449+
# - name: Run VSCode tests
450+
# uses: GabrielBB/[email protected]
451+
# with:
452+
# run: npm run testDataScience
453+
# env:
454+
# DISPLAY: 10
455+
# VSCODE_PYTHON_ROLLING: 1
456+
# VSC_PYTHON_FORCE_LOGGING: 1
457+
# VSC_PYTHON_CI_NON_PYTHON_NB_TEST: 1
458+
# VSC_PYTHON_CI_TEST_VSC_CHANNEL: 'insiders'
459+
# VSC_PYTHON_LOAD_EXPERIMENTS_FROM_FILE: 'true'
460+
# id: test_functional
461+
462+
# - name: Publish Test Report
463+
# uses: scacap/action-surefire-report@v1
464+
# with:
465+
# github_token: ${{ secrets.GITHUB_TOKEN }}
466+
# report_paths: ${{ env.TEST_RESULTS_GLOB }}
467+
# check_name: VSCode Test Report
468+
# if: steps.test_functional.outcome == 'failure' && failure()
469+

0 commit comments

Comments
 (0)