Skip to content

Commit 5e8aa11

Browse files
authored
More tweeks to GitHub actions for faster CI (#38)
1 parent 0f329fa commit 5e8aa11

8 files changed

+67
-163
lines changed

.github/PULL_REQUEST_TEMPLATE.md

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,4 +14,3 @@ For #
1414
- [ ] Unit tests & system/integration tests are added/updated.
1515
- [ ] [Test plan](https://github.com/Microsoft/vscode-jupyter/blob/main/.github/test_plan.md) is updated as appropriate.
1616
- [ ] [`package-lock.json`](https://github.com/Microsoft/vscode-jupyter/blob/main/package-lock.json) has been regenerated by running `npm install` (if dependencies have changed).
17-
- [ ] The wiki is updated with any design decisions/details.

.github/workflows/insiders.yml

Lines changed: 54 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ on:
66
- main
77
pull_request:
88
branches:
9-
- main
9+
- main
1010
check_run:
1111
types: [rerequested, requested_action]
1212

@@ -121,9 +121,59 @@ jobs:
121121
- name: Check dependencies
122122
run: npm run checkDependencies
123123

124+
125+
### Non-smoke tests
126+
ts_tests:
127+
name: Type Script Tests
128+
# The value of runs-on is the OS of the current job (specified in the strategy matrix below) instead of being hardcoded.
129+
runs-on: ${{ matrix.os }}
130+
if: github.repository == 'microsoft/vscode-jupyter'
131+
strategy:
132+
fail-fast: false
133+
matrix:
134+
# We're not running CI on macOS for now because it's one less matrix entry to lower the number of runners used,
135+
# macOS runners are expensive, and we assume that Ubuntu is enough to cover the UNIX case.
136+
os: [ubuntu-latest, windows-latest]
137+
test-suite: [ts-unit]
138+
env:
139+
NODE_VERSION: 12.15.0
140+
steps:
141+
- name: Checkout
142+
uses: actions/checkout@v2
143+
144+
- name: Cache npm files
145+
uses: actions/cache@v2
146+
with:
147+
path: ~/.npm
148+
key: ${{runner.os}}-${{env.CACHE_NPM_DEPS}}-${{hashFiles('package-lock.json')}}
149+
150+
- name: Cache compiled TS files
151+
# Use an id for this step so that its cache-hit output can be accessed and checked in the next step.
152+
id: out-cache
153+
uses: actions/cache@v2
154+
with:
155+
path: ./out
156+
key: ${{runner.os}}-${{env.CACHE_OUT_DIRECTORY}}-${{hashFiles('src/**')}}
157+
158+
- name: Install dependencies (npm ci)
159+
run: npm ci
160+
161+
- name: Compile if not cached
162+
run: npx gulp prePublishNonBundle
163+
if: steps.out-cache.outputs.cache-hit == false
164+
165+
- name: Use Node ${{env.NODE_VERSION}}
166+
uses: actions/[email protected]
167+
with:
168+
node-version: ${{env.NODE_VERSION}}
169+
170+
# Run TypeScript unit tests only for Python 3.X.
171+
- name: Run TypeScript unit tests
172+
run: npm run test:unittests:cover
173+
124174
### Non-smoke tests
125175
tests:
126-
name: Tests
176+
name: Tests (with Python)
127177
# The value of runs-on is the OS of the current job (specified in the strategy matrix below) instead of being hardcoded.
128178
runs-on: ${{ matrix.os }}
129179
if: github.repository == 'microsoft/vscode-jupyter'
@@ -135,7 +185,8 @@ jobs:
135185
os: [ubuntu-latest, windows-latest]
136186
# Run the tests on the oldest and most recent versions of Python.
137187
python: [2.7, 3.8]
138-
test-suite: [ts-unit, python-unit, single-workspace, functional]
188+
# test-suite: [python-unit, single-workspace, functional]
189+
test-suite: [functional]
139190
env:
140191
# Something in Node 12.16.0 breaks the TS debug adapter, and ubuntu-latest bundles Node 12.16.1.
141192
# We can remove this when we switch over to the python-based DA in https://github.com/microsoft/vscode-jupyter/issues/7136.
@@ -183,11 +234,6 @@ jobs:
183234
with:
184235
node-version: ${{env.NODE_VERSION}}
185236

186-
# Run TypeScript unit tests only for Python 3.X.
187-
- name: Run TypeScript unit tests
188-
run: npm run test:unittests:cover
189-
if: matrix.test-suite == 'ts-unit' && startsWith(matrix.python, 3.)
190-
191237
# - name: pip install ipython requirements
192238
# run: |
193239
# python -m pip install numpy

.github/workflows/release.yml

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -298,14 +298,6 @@ jobs:
298298
run: npm run testSingleWorkspace
299299
if: matrix.test-suite == 'single-workspace'
300300

301-
- name: Run debugger tests
302-
env:
303-
CI_PYTHON_VERSION: ${{matrix.python}}
304-
uses: GabrielBB/[email protected]
305-
with:
306-
run: npm run testDebugger
307-
if: matrix.test-suite == 'debugger'
308-
309301
- name: Run functional tests
310302
run: npm run test:functional
311303
if: matrix.test-suite == 'functional'

build/ci/templates/test_phases.yml

Lines changed: 2 additions & 121 deletions
Original file line numberDiff line numberDiff line change
@@ -98,8 +98,8 @@ steps:
9898
# > python -m pip --disable-pip-version-check install -t ./pythonFiles/lib/python --no-cache-dir --implementation py --no-deps --upgrade -r requirements.txt
9999
- bash: |
100100
python -m pip install --upgrade -r build/test-requirements.txt
101-
python -m pip --disable-pip-version-check install -t ./pythonFiles/lib/python --no-cache-dir --implementation py --no-deps --upgrade -r requirements.txt
102-
python -m pip --disable-pip-version-check install -t ./pythonFiles/lib/python --no-cache-dir --implementation py --no-deps --upgrade --pre debugpy
101+
# python -m pip --disable-pip-version-check install -t ./pythonFiles/lib/python --no-cache-dir --implementation py --no-deps --upgrade -r requirements.txt
102+
# python -m pip --disable-pip-version-check install -t ./pythonFiles/lib/python --no-cache-dir --implementation py --no-deps --upgrade --pre debugpy
103103
displayName: 'pip install system test requirements'
104104
condition: and(succeeded(), eq(variables['NeedsPythonTestReqs'], 'true'))
105105
@@ -203,13 +203,6 @@ steps:
203203
displayName: 'pip install jupyter'
204204
condition: and(succeeded(), eq(variables['NeedsIPythonReqs'], 'true'), contains(variables['TestsToRun'], 'testSmoke'))
205205
206-
- bash: |
207-
python -m pip --disable-pip-version-check install -r build/debugger-install-requirements.txt
208-
python ./pythonFiles/install_debugpy.py
209-
failOnStderr: true
210-
displayName: 'Install DEBUGPY wheels'
211-
condition: and(eq(variables['NeedsPythonTestReqs'], 'true'), eq(variables['PythonVersion'], '3.7'))
212-
213206
# Run the Python IPython tests in our codebase. Produces a JUnit-style log file that
214207
# will be uploaded after all tests are complete.
215208
#
@@ -258,95 +251,6 @@ steps:
258251
buildPlatform: '$(Agent.Os)-Py$(pythonVersion)'
259252
buildConfiguration: 'UnitTests'
260253

261-
# Venv tests: Prepare the various virtual environments and record their details into the
262-
# JSON file that venvTests require to run.
263-
#
264-
# This task only runs if the string 'venvTests' exists in variable 'TestsToRun'
265-
#
266-
# This task has a bunch of steps, all of which are to fill the `EnvPath` struct found in
267-
# the file:
268-
# `src/test/common/terminals/environmentActionProviders/terminalActivation.testvirtualenvs.ts`
269-
#
270-
# Example command line (windows pwsh):
271-
# // This is done in powershell. Copy/paste the code below.
272-
- pwsh: |
273-
# venv/bin or venv\\Scripts (windows)?
274-
$environmentExecutableFolder = 'bin'
275-
if ($Env:AGENT_OS -match '.*Windows.*') {
276-
$environmentExecutableFolder = 'Scripts'
277-
}
278-
279-
# pipenv
280-
python -m pip install pipenv
281-
python -m pipenv run python build/ci/addEnvPath.py $(PYTHON_VIRTUAL_ENVS_LOCATION) pipenvPath
282-
283-
# venv
284-
# what happens when running under Python 2.7?
285-
python -m venv .venv
286-
& ".venv/$environmentExecutableFolder/python" ./build/ci/addEnvPath.py $(PYTHON_VIRTUAL_ENVS_LOCATION) venvPath
287-
288-
# virtualenv
289-
python -m pip install virtualenv
290-
python -m virtualenv .virtualenv
291-
& ".virtualenv/$environmentExecutableFolder/python" ./build/ci/addEnvPath.py $(PYTHON_VIRTUAL_ENVS_LOCATION) virtualEnvPath
292-
293-
# conda
294-
295-
# 1. For `terminalActivation.testvirtualenvs.test.ts`
296-
297-
$condaExecPath = Join-Path -Path $Env:CONDA -ChildPath $environmentExecutableFolder | Join-Path -ChildPath conda
298-
if( '$(Agent.Os)' -match '.*Windows.*' ){
299-
$condaPythonPath = Join-Path -Path $Env:CONDA -ChildPath python
300-
} else{
301-
$condaPythonPath = Join-Path -Path $Env:CONDA -ChildPath $environmentExecutableFolder | Join-Path -ChildPath python
302-
& $condaPythonPath ./build/ci/addEnvPath.py $(PYTHON_VIRTUAL_ENVS_LOCATION) condaExecPath $condaExecPath
303-
}
304-
& $condaPythonPath ./build/ci/addEnvPath.py $(PYTHON_VIRTUAL_ENVS_LOCATION) condaPath
305-
306-
# 2. For `interpreterLocatorService.testvirtualenvs.ts`
307-
308-
& $condaExecPath create -n "test_env1" -y python
309-
& $condaExecPath create -p "./test_env2" -y python
310-
& $condaExecPath create -p "$Env:HOME/test_env3" -y python
311-
312-
# Set the TEST_FILES_SUFFIX
313-
Write-Host '##vso[task.setvariable variable=TEST_FILES_SUFFIX;]testvirtualenvs'
314-
315-
displayName: 'Prepare Venv-Test Environment'
316-
condition: and(succeeded(), contains(variables['TestsToRun'], 'venvTests'))
317-
318-
# Run the virtual environment based tests.
319-
# This set of tests is simply using the `testSingleWorkspace` set of tests, but
320-
# with the environment variable `TEST_FILES_SUFFIX` set to `testvirtualenvs`, which
321-
# got set in the Prepare Venv-Test Environment task above.
322-
# **Note**: Azure DevOps tasks set environment variables via a specially formatted
323-
# string sent to stdout.
324-
#
325-
# This task only runs if the string 'venvTests' exists in variable 'TestsToRun'
326-
#
327-
# Example command line (windows pwsh):
328-
# > $Env:TEST_FILES_SUFFIX=testvirtualenvs
329-
# > npm run testSingleWorkspace
330-
- script: |
331-
cat $PYTHON_VIRTUAL_ENVS_LOCATION
332-
333-
npm run testSingleWorkspace
334-
335-
displayName: 'Run Venv-Tests'
336-
condition: and(succeeded(), contains(variables['TestsToRun'], 'venvTests'))
337-
env:
338-
DISPLAY: :10
339-
340-
# Upload the test results to Azure DevOps to facilitate test reporting in their UX.
341-
- task: PublishTestResults@2
342-
displayName: 'Publish Venv-Tests results'
343-
condition: contains(variables['TestsToRun'], 'venvTests')
344-
inputs:
345-
testResultsFiles: '$(MOCHA_FILE)'
346-
testRunTitle: 'venvTest-$(Agent.Os)-Py$(pythonVersion)'
347-
buildPlatform: '$(Agent.Os)-Py$(pythonVersion)'
348-
buildConfiguration: 'SystemTests'
349-
350254
# Set the CI_PYTHON_PATH variable that forces VS Code system tests to use
351255
# the specified Python interpreter.
352256
#
@@ -434,29 +338,6 @@ steps:
434338
buildPlatform: '$(Agent.Os)-Py$(pythonVersion)'
435339
buildConfiguration: 'SystemTests'
436340

437-
# Run the debugger integration tests.
438-
#
439-
# This task only runs if the string 'testDebugger' exists in variable `TestsToRun`.
440-
#
441-
# Example command line (windows pwsh):
442-
# > npm run testDebugger
443-
- script: |
444-
npm run testDebugger
445-
displayName: 'Run debugger tests'
446-
condition: and(succeeded(), contains(variables['TestsToRun'], 'testDebugger'))
447-
env:
448-
DISPLAY: :10
449-
450-
# Upload the test results to Azure DevOps to facilitate test reporting in their UX.
451-
- task: PublishTestResults@2
452-
displayName: 'Publish debugger tests results'
453-
condition: contains(variables['TestsToRun'], 'testDebugger')
454-
inputs:
455-
testResultsFiles: '$(MOCHA_FILE)'
456-
testRunTitle: 'debugger-$(Agent.Os)-Py$(pythonVersion)'
457-
buildPlatform: '$(Agent.Os)-Py$(pythonVersion)'
458-
buildConfiguration: 'SystemTests'
459-
460341
# Run the performance tests.
461342
#
462343
# This task only runs if the string 'testPerformance' exists in variable `TestsToRun`.

build/ci/vscode-python-ci-manual.yaml

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -44,9 +44,6 @@ stages:
4444
# focused on integration
4545
TestsToRun: 'testSingleWorkspace'
4646
NeedsPythonTestReqs: true
47-
'Debugger':
48-
TestsToRun: 'testDebugger'
49-
NeedsPythonTestReqs: true
5047
'Smoke':
5148
TestsToRun: 'testSmoke'
5249
NeedsPythonTestReqs: true
@@ -105,10 +102,6 @@ stages:
105102
PythonVersion: '3.5'
106103
TestsToRun: 'testSingleWorkspace'
107104
NeedsPythonTestReqs: true
108-
'Debugger':
109-
PythonVersion: '3.5'
110-
TestsToRun: 'testDebugger'
111-
NeedsPythonTestReqs: true
112105
#maxParallel: 3
113106
pool:
114107
vmImage: 'ubuntu-16.04'

build/ci/vscode-python-ci.yaml

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -52,9 +52,6 @@ stages:
5252
# focused on integration
5353
TestsToRun: 'testSingleWorkspace'
5454
NeedsPythonTestReqs: true
55-
'Debugger':
56-
TestsToRun: 'testDebugger'
57-
NeedsPythonTestReqs: true
5855
# 'Smoke':
5956
# TestsToRun: 'testSmoke'
6057
# NeedsPythonTestReqs: true

build/ci/vscode-python-pr-validation.yaml

Lines changed: 11 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -51,13 +51,10 @@ stages:
5151
NeedsPythonTestReqs: true
5252
NeedsPythonFunctionalReqs: true
5353
SplitFunctionalTests: false
54-
# 'Single Workspace':
55-
# TestsToRun: 'testSingleWorkspace'
54+
# 'DataScience':
55+
# TestsToRun: 'testDataScience'
5656
# NeedsPythonTestReqs: true
57-
'DataScience':
58-
TestsToRun: 'testDataScience'
59-
NeedsPythonTestReqs: true
60-
NeedsPythonFunctionalReqs: true
57+
# NeedsPythonFunctionalReqs: true
6158
# 'Smoke':
6259
# TestsToRun: 'testSmoke'
6360
# NeedsPythonTestReqs: true
@@ -119,11 +116,11 @@ stages:
119116
# steps:
120117
# - template: templates/test_phases.yml
121118

122-
- stage: Reports
123-
dependsOn:
124-
- Linux
125-
# - Mac
126-
# - Windows
127-
condition: always()
128-
jobs:
129-
- template: templates/jobs/coverage.yml
119+
# - stage: Reports
120+
# dependsOn:
121+
# - Linux
122+
# # - Mac
123+
# # - Windows
124+
# condition: always()
125+
# jobs:
126+
# - template: templates/jobs/coverage.yml

package.json

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2986,7 +2986,6 @@
29862986
"test:functional:cover": "npm run test:functional",
29872987
"test:functional:split": "node ./build/ci/scripts/runFunctionalTests.js",
29882988
"test:cover:report": "nyc --nycrc-path build/.nycrc report --reporter=text --reporter=html --reporter=text-summary --reporter=cobertura",
2989-
"testDebugger": "node ./out/test/testBootstrap.js ./out/test/debuggerTest.js",
29902989
"testSingleWorkspace": "node ./out/test/testBootstrap.js ./out/test/standardTest.js",
29912990
"preTestJediLSP": "node ./out/test/languageServers/jedi/lspSetup.js",
29922991
"testJediLSP": "node ./out/test/languageServers/jedi/lspSetup.js && cross-env CODE_TESTS_WORKSPACE=src/test VSC_PYTHON_CI_TEST_GREP='Language Server:' node ./out/test/testBootstrap.js ./out/test/standardTest.js && node ./out/test/languageServers/jedi/lspTeardown.js",

0 commit comments

Comments
 (0)