Skip to content

Tests for prompting to install missing ipykernel #14266

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 5 commits into from
Oct 6, 2020

Conversation

DonJayamanne
Copy link

@DonJayamanne DonJayamanne commented Oct 5, 2020

For #13970

Basically as discussed in our other branch,

  • Create *.vscode.test.ts tests to run in VSCode
  • This is an end to end VS Code test
  • Plan is to move the existing old (*.ds.test.ts) into this so that we run Native Notebooks using same way (i.e. drop ds.test.ts as we've decided to do in other branch - probably already done).

I need to commit a few other changes, but that's related to setting up of the tests (changes to scripts in package & the like).
Let me know what your initial thoughts are.

});

test('Ensure prompt is displayed when ipykernel module is not found and it gets installed', async () => {
const promptDisplayed = createDeferred();
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Test is simple:

  • Create a notebook with existing kernel
  • Ensure kernel exists, however ipykernel is not installed (to replicate bug).
  • Open notebook
  • Confirm prompt to install ipykernel is displayed
  • Click Install in prompt
  • Verify ipykernel was successfully installed.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Basically this is a full end to end test

  • With real bits
  • Shutting down Jupyter once done (same code as used in Native Notebooks)
  • This is a very slow test, we are installing IPYKernel (i don't expect other tests to be as slow)

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Don't we already have the '.ui.test.ts' files? Wondering why you created this new extension.

Or is this just in preparation for consolidating them in the other repo?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We don't have anymore ui.test.ts. We removed UI Tests, as it wasn't getting used.

Going with vscode.test.ts as this what was agreed on Teams for tests running with VS Code.

Or is this just in preparation for consolidating them in the other repo?

Yes

@codecov-commenter
Copy link

codecov-commenter commented Oct 5, 2020

Codecov Report

Merging #14266 into main will decrease coverage by 0.04%.
The diff coverage is 100.00%.

Impacted file tree graph

@@            Coverage Diff             @@
##             main   #14266      +/-   ##
==========================================
- Coverage   59.96%   59.91%   -0.05%     
==========================================
  Files         706      709       +3     
  Lines       39180    39334     +154     
  Branches     5681     5698      +17     
==========================================
+ Hits        23494    23567      +73     
- Misses      14449    14529      +80     
- Partials     1237     1238       +1     
Impacted Files Coverage Δ
...cience/interactive-ipynb/nativeEditorOldWebView.ts 16.66% <100.00%> (ø)
...discovery/locators/services/windowsStoreLocator.ts 100.00% <0.00%> (ø)
src/client/pythonEnvironments/common/posixUtils.ts 91.66% <0.00%> (ø)
...covery/locators/services/posixKnownPathsLocator.ts 100.00% <0.00%> (ø)
.../pythonEnvironments/common/externalDependencies.ts 66.66% <0.00%> (+6.06%) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update ef44f29...cb8df03. Read the comment docs.

python -m pip uninstall ipykernel --yes
displayName: 'Prepare Virtual Env for Kernel Tests'
workingDirectory: $(Build.SourcesDirectory)/src/test/datascience
condition: and(succeeded(), contains(variables['TestsToRun'], 'testDataScienceInVSCode'))
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

TODO: Only run on linux agent.
This is a slow test, no point running on all OS & Python versions (code path will be identical).

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is that for linux only even locally? If not then I would think the activate command needs to be different for windows as it doesn't use source

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Linux only on CI, locally it will work for Windows. However its upto the engineer to create the venv & ensure it has been registered as a kernel.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@DonJayamanne seems fair.

@sonarqubecloud
Copy link

sonarqubecloud bot commented Oct 6, 2020

Kudos, SonarCloud Quality Gate passed!

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities (and Security Hotspot 0 Security Hotspots to review)
Code Smell A 0 Code Smells

No Coverage information No Coverage information
0.0% 0.0% Duplication

"env": {
"VSC_PYTHON_CI_TEST_GREP": "", // Modify this to run a subset of the single workspace tests
"VSC_PYTHON_CI_TEST_INVERT_GREP": "", // Initialize this to invert the grep (exclude tests with value defined in grep).
"CI_PYTHON_PATH": "<PythonPath>", // Initialize this to invert the grep (exclude tests with value defined in grep).

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We usually add an X to the beginning of this.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In this case, this is required. X only when its optional.

@DonJayamanne DonJayamanne merged commit 7049770 into microsoft:main Oct 6, 2020
@DonJayamanne DonJayamanne deleted the installerTest branch October 6, 2020 18:31
DonJayamanne added a commit that referenced this pull request Oct 30, 2020
* 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)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
no-changelog No news entry required
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants