Skip to content
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

WIP - Full functional tests #63

Closed
wants to merge 8 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 14 additions & 8 deletions .github/workflows/pr.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,8 @@ env:
COVERAGE_REPORTS: tests-coverage-reports
VSC_PYTHON_FORCE_LOGGING: true # Enable this to turn on console output for the logger
TEST_RESULTS_DIRECTORY: .
CI_PYTHON_PATH: python
VSCODE_PYTHON_ROLLING: 1

jobs:
build-vsix:
Expand Down Expand Up @@ -216,10 +218,6 @@ jobs:
- name: Install dependencies (npm ci)
run: npm ci

- name: Compile if not cached
run: npx gulp prePublishNonBundle
if: steps.out-cache.outputs.cache-hit == false

- name: Use Python ${{matrix.python}}
uses: actions/setup-python@v2
with:
Expand All @@ -239,14 +237,22 @@ jobs:
run: |
python -m pip install numpy
python -m pip install --upgrade -r ./build/functional-test-requirements.txt
python -m pip install --upgrade -r ./build/conda-functional-requirements.txt
if: matrix.test-suite == 'functional'

- name: Set CI_PYTHON_PATH and CI_DISABLE_AUTO_SELECTION
- name: Set CI_PYTHON_PATH
run: |
echo "::set-env name=CI_PYTHON_PATH_!::python"
echo "::set-env name=VSCODE_PYTHON_ROLLING_1::1"

- name: Dump
run: |
echo "::set-env name=CI_PYTHON_PATH::python"
echo "::set-env name=CI_DISABLE_AUTO_SELECTION::1"
env
shell: bash
if: matrix.test-suite != 'ts-unit'

- name: Compile if not cached
run: npx gulp prePublishNonBundle
if: steps.out-cache.outputs.cache-hit == false

# # Upload unit test coverage reports for later use in the "reports" job.
# - name: Upload unit test coverage reports
Expand Down
4 changes: 2 additions & 2 deletions .vscode/launch.json
Original file line number Diff line number Diff line change
Expand Up @@ -289,11 +289,11 @@
// Remove `X` prefix to test with real browser to host DS ui (for DS functional tests).
"XVSC_PYTHON_DS_UI_BROWSER": "1",
// Remove `X` prefix to test with real python (for DS functional tests).
"XVSCODE_PYTHON_ROLLING": "1",
"VSCODE_PYTHON_ROLLING": "1",
// Remove 'X' to turn on all logging in the debug output
"XVSC_PYTHON_FORCE_LOGGING": "1",
// Remove `X` prefix and update path to test with real python interpreter (for DS functional tests).
"XCI_PYTHON_PATH": "<Python Path>",
"CI_PYTHON_PATH": "/Users/donjayamanne/Desktop/Development/crap/docBug/venv2/bin/python",
// Remove 'X' prefix to dump output for debugger. Directory has to exist prior to launch
"XDEBUGPY_LOG_DIR": "${workspaceRoot}/tmp/Debug_Output"
},
Expand Down
6 changes: 1 addition & 5 deletions src/client/common/interpreterPathService.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@

'use strict';

import * as fs from 'fs-extra';
import { inject, injectable } from 'inversify';
import { ConfigurationChangeEvent, ConfigurationTarget, Event, EventEmitter, Uri } from 'vscode';
import { IWorkspaceService } from './application/types';
Expand All @@ -28,10 +27,7 @@ export const isGlobalSettingCopiedKey = 'isGlobalSettingCopiedKey';
const CI_PYTHON_PATH = getCIPythonPath();

export function getCIPythonPath(): string {
if (process.env.CI_PYTHON_PATH && fs.existsSync(process.env.CI_PYTHON_PATH)) {
return process.env.CI_PYTHON_PATH;
}
return 'python';
return process.env.CI_PYTHON_PATH || 'python';
}
@injectable()
export class InterpreterPathService implements IInterpreterPathService {
Expand Down
5 changes: 1 addition & 4 deletions src/test/common.ts
Original file line number Diff line number Diff line change
Expand Up @@ -250,13 +250,10 @@ export async function deleteFiles(globPattern: string) {
return Promise.all(items.map((item) => fs.remove(item).catch(noop)));
}
function getPythonPath(): string {
if (process.env.CI_PYTHON_PATH && fs.existsSync(process.env.CI_PYTHON_PATH)) {
return process.env.CI_PYTHON_PATH;
}
// tslint:disable-next-line:no-suspicious-comment
// TODO: Change this to python3.
// See https://github.com/microsoft/vscode-python/issues/10910.
return 'python';
return process.env.CI_PYTHON_PATH || 'python';
}

/**
Expand Down