-
Notifications
You must be signed in to change notification settings - Fork 290
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
Faster ci tests #11867
Faster ci tests #11867
Conversation
.github/workflows/build-test.yml
Outdated
jupyter: [raw, local] | ||
python: [nonConda, conda] | ||
pythonVersion: ['3.9', '3.10'] | ||
jupyter: [raw] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Its upto maintainers of the code to have different test matrices for each area
We only run all tests in zmq and run specific tests in remote, jupyter, conda, etc
Codecov Report
@@ Coverage Diff @@
## main #11867 +/- ##
=======================================
- Coverage 63% 61% -2%
=======================================
Files 490 491 +1
Lines 34454 34541 +87
Branches 5590 5600 +10
=======================================
- Hits 21752 21265 -487
- Misses 10635 11249 +614
+ Partials 2067 2027 -40
|
592e135
to
1f96e81
Compare
import { KernelProcess } from './kernelProcess.node'; | ||
import { PortAttributesProviders } from '../port/portAttributeProvider.node'; | ||
|
||
suite('kernel Launcher', () => { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Converted an integration test into unit test
Plan is to do this more often where possible
} else { | ||
const env = await api.environments.resolveEnvironment(pythonPathOrPythonId); | ||
return this.trackResolvedEnvironment(env, false); | ||
traceWarning( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Our CI tests fail, as python env haven't loaded completely and in our test code we try to get details of virtual envs which Python hasn't yet discovered
@@ -19,7 +19,7 @@ import { disposeAllDisposables } from '../../../platform/common/helpers'; | |||
import { IShowDataViewerFromVariablePanel } from '../../../messageTypes'; | |||
|
|||
/* eslint-disable @typescript-eslint/no-explicit-any, no-invalid-this */ | |||
suite('DataScience - VSCode Notebook - (DataViewer)', function () { | |||
suite('DataScience - VSCode Notebook - (DataViewer) @webview', function () { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Tagging all tests so we can run specific tests
1689f87
to
fd75019
Compare
@@ -106,6 +106,9 @@ const config = { | |||
typeof process.env.IS_PRE_RELEASE_VERSION_OF_JUPYTER_EXTENSION === 'string' | |||
? process.env.IS_PRE_RELEASE_VERSION_OF_JUPYTER_EXTENSION | |||
: 'true' | |||
), | |||
VSC_JUPYTER_CI_TEST_GREP: JSON.stringify( | |||
typeof process.env.VSC_JUPYTER_CI_TEST_GREP === 'string' ? process.env.VSC_JUPYTER_CI_TEST_GREP : '' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Required to get grep
working for Mocha in web tests.
No way to pass env variables into Mocha, but to inject them when building.
@@ -22,7 +22,7 @@ import { JupyterVariableDataProvider } from '../../../webviews/extension-side/da | |||
import { IDataViewer, IDataViewerDataProvider } from '../../../webviews/extension-side/dataviewer/types'; | |||
import { MockMemento } from '../../mocks/mementos'; | |||
|
|||
suite('DataScience - DataViewer', () => { | |||
suite('DataViewer', () => { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Removed all of the unencessary DataScience -
prefixes
} | ||
const interpreter = isWeb() | ||
? undefined | ||
: await waitForCondition( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Original code was incorrect, we cannot have interpreter in web.
@@ -38,6 +39,9 @@ suite('Kernel Event', function () { | |||
let previousDisableJupyterAutoStartValue: boolean; | |||
this.timeout(120_000); | |||
suiteSetup(async function () { | |||
if (isWeb()) { | |||
return this.skip(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not required in web
@@ -23,7 +23,7 @@ const logsDir = path.join(ExtensionRootDir, 'logs'); | |||
|
|||
async function captureScreenShot(name, res) { | |||
const screenshot = require('screenshot-desktop'); | |||
fs.ensureDirSync(path.join(logsDir, name)); | |||
fs.ensureDirSync(logsDir); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Bug fix
const interpreter = await waitForCondition( | ||
() => interpreterService.getActiveInterpreter(), | ||
defaultNotebookTestTimeout, | ||
'Active Interpreter is undefined.2' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Changed to try and wait for Python extension to get the actiev interpreter.
Hacky work around for Python extnesion issue microsoft/vscode-python#20147
Doesn't seem to work always, but left this here.
Also added .2
suffix to identify where where things were failing, left this here
mocha.setup({ | ||
ui: 'tdd', | ||
// eslint-disable-next-line @typescript-eslint/no-explicit-any | ||
reporter: CustomReporter as any | ||
reporter: CustomReporter as any, | ||
grep |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We can now run specific tests in VS Code web as well
pythonVersion: '3.9' | ||
webOrDesktop: 'web' | ||
# Mandatory tests | ||
- jupyterConnection: remote |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@DonJayamanne can you give us a deep dive of how the include
works with matrix? We now have 17 jobs and it's hard to know how each job is generated by reading the matrix, include and when clauses in the steps down below.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
when clauses in the steps down below.
Can you give me an example if thsi
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm referring to https:/microsoft/vscode-jupyter/pull/11867/files#diff-063ca77e012f959eba648db60e6868875fd1e70e5f5ac081193d848f8d61ef32R633 the if
clauses. It's not easy to know how a job is generated (which makes it hard to troubleshoot locally)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe we can also go through the new job list and each owner can check whether the prior steps are required for their tests and investigate how we can simplify each job.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Aah yes, unfortunately thats because we need different CLIs to run each test,
E.g. running web tests and running standard tests require different CLIs, see run: npm run testWebExtension
b387076
to
8d0262d
Compare
Summary
1. The goal is to have a certain set of Jobs that MUST pass for PRs
These jobs will run the following tests:
@
in name of the test@mandatory
in the tests,2. Almost all tests have been grouped into individual groups
I've added the following tags to describe each group, some of the include
@mandatory
@mandatory
tests are analogous tosmoke tests
@kernelCore
@iw
- Interactive window@debugger
- Debugger tests@webView
- Web View tests, such as plot viewer@lsp
- Language services, such as code completion, hover provider, etc@kernelPicker
- Kernel Picker tests@kernelInstall
- Tests for installation of ipykernel, etc@python
- Testing actiavtion of python envs, conda, etc@jupyter
- Testing starting of Jupyter servers@widgets
- Widget tests@export
- Import/export testsTodo: