Skip to content

Commit 262c14f

Browse files
author
Kartik Raj
authored
Fix smoke tests & correctly running tests using Python 2.7 (#11517)
* Fixes to running tests with Python 2.7 * Fix smoke tests pipeline
1 parent 87dd3d6 commit 262c14f

File tree

2 files changed

+57
-2
lines changed

2 files changed

+57
-2
lines changed

.github/workflows/ci.yml

Lines changed: 56 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,11 @@ jobs:
2828
- name: Checkout
2929
uses: actions/checkout@v2
3030

31+
- name: Show all env vars
32+
run: |
33+
printenv
34+
shell: bash
35+
3136
- name: Use Python ${{env.PYTHON_VERSION}}
3237
uses: actions/setup-python@v1
3338
with:
@@ -92,6 +97,11 @@ jobs:
9297
- name: Checkout
9398
uses: actions/checkout@v2
9499

100+
- name: Show all env vars
101+
run: |
102+
printenv
103+
shell: bash
104+
95105
- name: Retrieve cached npm files
96106
uses: actions/cache@v1
97107
with:
@@ -201,6 +211,11 @@ jobs:
201211
- name: Checkout
202212
uses: actions/checkout@v2
203213

214+
- name: Show all env vars
215+
run: |
216+
printenv
217+
shell: bash
218+
204219
- name: Retrieve cached npm files
205220
uses: actions/cache@v1
206221
with:
@@ -255,7 +270,7 @@ jobs:
255270
- name: Install test requirements
256271
run: python -m pip install --upgrade -r build/test-requirements.txt
257272

258-
- name: Install IPython test requirements
273+
- name: pip install ipython requirements
259274
run: |
260275
python -m pip install numpy
261276
python -m pip install --upgrade -r ./build/ipython-test-requirements.txt
@@ -330,6 +345,13 @@ jobs:
330345
& $condaExecPath create -p "./test_env2" -y python
331346
& $condaExecPath create -p "~/test_env3" -y python
332347
348+
- name: Set CI_PYTHON_PATH and CI_DISABLE_AUTO_SELECTION
349+
run: |
350+
echo "::set-env name=CI_PYTHON_PATH::python"
351+
echo "::set-env name=CI_DISABLE_AUTO_SELECTION::1"
352+
shell: bash
353+
if: matrix.test-suite != 'ts-unit'
354+
333355
# Run TypeScript unit tests only for Python 3.X.
334356
- name: Run TypeScript unit tests
335357
run: npm run test:unittests:cover
@@ -402,6 +424,16 @@ jobs:
402424
- name: Checkout
403425
uses: actions/checkout@v2
404426

427+
- name: Show all env vars
428+
run: |
429+
printenv
430+
shell: bash
431+
432+
- name: Use Python ${{matrix.python}}
433+
uses: actions/setup-python@v1
434+
with:
435+
python-version: ${{matrix.python}}
436+
405437
- name: Retrieve cached npm files
406438
uses: actions/cache@v1
407439
with:
@@ -411,6 +443,23 @@ jobs:
411443
- name: Install dependencies (npm ci)
412444
run: npm ci --prefer-offline
413445

446+
- name: pip install system test requirements
447+
run: |
448+
python -m pip install --upgrade -r build/test-requirements.txt
449+
python -m pip --disable-pip-version-check install -t ./pythonFiles/lib/python --no-cache-dir --implementation py --no-deps --upgrade -r requirements.txt
450+
python -m pip --disable-pip-version-check install -t ./pythonFiles/lib/python/old_ptvsd --no-cache-dir --implementation py --no-deps --upgrade 'ptvsd==4.3.2'
451+
python -m pip --disable-pip-version-check install -t ./pythonFiles/lib/python/debugpy/no_wheels --no-cache-dir --implementation py --no-deps --upgrade --pre debugpy
452+
shell: bash
453+
454+
- name: pip install ipython requirements
455+
run: |
456+
python -m pip install numpy
457+
python -m pip install --upgrade -r ./build/ipython-test-requirements.txt
458+
459+
- name: pip install jupyter
460+
run: |
461+
python -m pip install --upgrade jupyter
462+
414463
- name: Download VSIX
415464
uses: actions/download-artifact@v1
416465
with:
@@ -425,6 +474,12 @@ jobs:
425474
npx tsc -p ./
426475
shell: bash
427476

477+
- name: Set CI_PYTHON_PATH and CI_DISABLE_AUTO_SELECTION
478+
run: |
479+
echo "::set-env name=CI_PYTHON_PATH::python"
480+
echo "::set-env name=CI_DISABLE_AUTO_SELECTION::1"
481+
shell: bash
482+
428483
- name: Run smoke tests
429484
env:
430485
DISPLAY: 10

src/client/common/configSettings.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -605,7 +605,7 @@ export class PythonSettings implements IPythonSettings {
605605
? this.interpreterPathService.get(this.workspaceRoot)
606606
: pythonSettings.get<string>('pythonPath')
607607
)!;
608-
if (this.pythonPath.length === 0 || this.pythonPath === 'python') {
608+
if (!process.env.CI_DISABLE_AUTO_SELECTION && (this.pythonPath.length === 0 || this.pythonPath === 'python')) {
609609
const autoSelectedPythonInterpreter = this.interpreterAutoSelectionService.getAutoSelectedInterpreter(
610610
this.workspaceRoot
611611
);

0 commit comments

Comments
 (0)