forked from DonJayamanne/pythonVSCode
-
Notifications
You must be signed in to change notification settings - Fork 1.2k
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
Move coverage to nightly and simplify reporting #15776
Merged
Merged
Changes from all commits
Commits
Show all changes
13 commits
Select commit
Hold shift + click to select a range
722d9f3
Enable coverage for venv and single workspace tests
karthiknadig 439a458
Upload coverage for single workspace
karthiknadig 5acd3fd
Try with spawn wrap
karthiknadig 9431e4d
Fix coverage artifact upload
karthiknadig 782b84d
Try running tests with coverage directly
karthiknadig 663f0d2
Run coverage separately
karthiknadig 6c76f05
Remove start page from coverage
karthiknadig d2d9a26
Add back codecov
karthiknadig 18933df
No need to move codecov.yml
karthiknadig f356418
Ensure nightly coverage runs on schedule only
karthiknadig 865d154
Nightly should only run coverage
karthiknadig bfcb692
Address comments
karthiknadig 65bcc47
Remove setting node version env for each job
karthiknadig File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -29,6 +29,3 @@ comment: | |
layout: 'diff, files' | ||
behavior: default | ||
require_changes: no | ||
|
||
fixes: | ||
- 'path with spaces/::' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,188 @@ | ||
name: Coverage | ||
|
||
on: | ||
schedule: | ||
# Run daily at 2:00 AM | ||
- cron: '0 2 * * *' | ||
|
||
env: | ||
NODE_VERSION: 12.15.0 | ||
PYTHON_VERSION: 3.9 | ||
MOCHA_REPORTER_JUNIT: true # Use the mocha-multi-reporters and send output to both console (spec) and JUnit (mocha-junit-reporter). Also enables a reporter which exits the process running the tests if it haven't already. | ||
ARTIFACT_NAME_VSIX: ms-python-insiders-vsix | ||
VSIX_NAME: ms-python-insiders.vsix | ||
TEST_RESULTS_DIRECTORY: . | ||
|
||
jobs: | ||
tests: | ||
name: Tests with Coverage | ||
# The value of runs-on is the OS of the current job (specified in the strategy matrix below) instead of being hardcoded. | ||
runs-on: ${{ matrix.os }} | ||
|
||
strategy: | ||
fail-fast: false | ||
matrix: | ||
# We're not running CI on macOS for now because it's one less matrix entry to lower the number of runners used, | ||
# macOS runners are expensive, and we assume that Ubuntu is enough to cover the Unix case. | ||
os: [ubuntu-latest, windows-latest] | ||
|
||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v2 | ||
|
||
- name: Install Node | ||
uses: actions/setup-node@v2.1.5 | ||
with: | ||
node-version: ${{env.NODE_VERSION}} | ||
|
||
- name: Install dependencies (npm ci) | ||
run: npm ci | ||
|
||
- name: Compile | ||
run: npx gulp prePublishNonBundle | ||
|
||
- name: Use Python ${{env.PYTHON_VERSION}} | ||
uses: actions/setup-python@v2 | ||
with: | ||
python-version: ${{env.PYTHON_VERSION}} | ||
|
||
- name: Install Python requirements | ||
run: | | ||
python -m pip --disable-pip-version-check install -t ./pythonFiles/lib/python --no-cache-dir --implementation py --no-deps --upgrade -r requirements.txt --no-user | ||
# We need to have debugpy so that tests relying on it keep passing, but we don't need install_debugpy's logic in the test phase. | ||
python -m pip --disable-pip-version-check install -t ./pythonFiles/lib/python --no-cache-dir --implementation py --no-deps --upgrade --pre debugpy | ||
|
||
- name: Install test requirements | ||
run: python -m pip install --upgrade -r build/test-requirements.txt | ||
|
||
- name: Install functional test requirements | ||
run: python -m pip install --upgrade -r ./build/functional-test-requirements.txt | ||
|
||
- name: Prepare pipenv for venv tests | ||
env: | ||
TEST_FILES_SUFFIX: testvirtualenvs | ||
PYTHON_VIRTUAL_ENVS_LOCATION: './src/tmp/envPaths.json' | ||
shell: pwsh | ||
run: | | ||
python -m pip install pipenv | ||
python -m pipenv run python ./build/ci/addEnvPath.py ${{env.PYTHON_VIRTUAL_ENVS_LOCATION}} pipenvPath | ||
|
||
- name: Prepare virtualenv for venv tests | ||
env: | ||
TEST_FILES_SUFFIX: testvirtualenvs | ||
PYTHON_VIRTUAL_ENVS_LOCATION: './src/tmp/envPaths.json' | ||
shell: pwsh | ||
run: | | ||
python -m pip install virtualenv | ||
python -m virtualenv .virtualenv/ | ||
if ('${{matrix.os}}' -match 'windows-latest') { | ||
& ".virtualenv/Scripts/python.exe" ./build/ci/addEnvPath.py ${{env.PYTHON_VIRTUAL_ENVS_LOCATION}} virtualEnvPath | ||
} else { | ||
& ".virtualenv/bin/python" ./build/ci/addEnvPath.py ${{env.PYTHON_VIRTUAL_ENVS_LOCATION}} virtualEnvPath | ||
} | ||
|
||
- name: Prepare venv for venv tests | ||
env: | ||
TEST_FILES_SUFFIX: testvirtualenvs | ||
PYTHON_VIRTUAL_ENVS_LOCATION: './src/tmp/envPaths.json' | ||
shell: pwsh | ||
run: | | ||
python -m venv .venv | ||
if ('${{matrix.os}}' -match 'windows-latest') { | ||
& ".venv/Scripts/python.exe" ./build/ci/addEnvPath.py ${{env.PYTHON_VIRTUAL_ENVS_LOCATION}} venvPath | ||
} else { | ||
& ".venv/bin/python" ./build/ci/addEnvPath.py ${{env.PYTHON_VIRTUAL_ENVS_LOCATION}} venvPath | ||
} | ||
|
||
- name: Prepare conda for venv tests | ||
env: | ||
TEST_FILES_SUFFIX: testvirtualenvs | ||
PYTHON_VIRTUAL_ENVS_LOCATION: './src/tmp/envPaths.json' | ||
shell: pwsh | ||
run: | | ||
# 1. For `terminalActivation.testvirtualenvs.test.ts` | ||
if ('${{matrix.os}}' -match 'windows-latest') { | ||
$condaPythonPath = Join-Path -Path $Env:CONDA -ChildPath python.exe | ||
$condaExecPath = Join-Path -Path $Env:CONDA -ChildPath Scripts | Join-Path -ChildPath conda | ||
} else{ | ||
$condaPythonPath = Join-Path -Path $Env:CONDA -ChildPath bin | Join-Path -ChildPath python | ||
$condaExecPath = Join-Path -Path $Env:CONDA -ChildPath bin | Join-Path -ChildPath conda | ||
} | ||
& $condaPythonPath ./build/ci/addEnvPath.py ${{env.PYTHON_VIRTUAL_ENVS_LOCATION}} condaExecPath $condaExecPath | ||
& $condaPythonPath ./build/ci/addEnvPath.py ${{env.PYTHON_VIRTUAL_ENVS_LOCATION}} condaPath | ||
|
||
# 2. For `interpreterLocatorService.testvirtualenvs.ts` | ||
|
||
& $condaExecPath create -n "test_env1" -y python | ||
& $condaExecPath create -p "./test_env2" -y python | ||
& $condaExecPath create -p "~/test_env3" -y python | ||
|
||
- name: Run TypeScript unit tests | ||
run: npm run test:unittests:cover | ||
|
||
- name: Run Python unit tests | ||
run: | | ||
python pythonFiles/tests/run_all.py | ||
|
||
# The virtual environment based tests use the `testSingleWorkspace` set of tests | ||
# with the environment variable `TEST_FILES_SUFFIX` set to `testvirtualenvs`, | ||
# which is set in the "Prepare environment for venv tests" step. | ||
# We also use a third-party GitHub Action to install xvfb on Linux, | ||
# run tests and then clean up the process once the tests ran. | ||
# See https://github.com/GabrielBB/xvfb-action | ||
- name: Run venv tests | ||
env: | ||
TEST_FILES_SUFFIX: testvirtualenvs | ||
CI_PYTHON_VERSION: ${{env.PYTHON_VERSION}} | ||
CI_DISABLE_AUTO_SELECTION: 1 | ||
uses: GabrielBB/xvfb-action@v1.4 | ||
with: | ||
run: npm run testSingleWorkspace:cover | ||
|
||
- name: Run single-workspace tests | ||
env: | ||
CI_PYTHON_VERSION: ${{env.PYTHON_VERSION}} | ||
CI_DISABLE_AUTO_SELECTION: 1 | ||
uses: GabrielBB/xvfb-action@v1.4 | ||
with: | ||
run: npm run testSingleWorkspace:cover | ||
|
||
# Enable these tests when coverage is setup for multiroot workspace tests | ||
# - name: Run multi-workspace tests | ||
# env: | ||
# CI_PYTHON_VERSION: ${{env.PYTHON_VERSION}} | ||
# CI_DISABLE_AUTO_SELECTION: 1 | ||
# uses: GabrielBB/xvfb-action@v1.4 | ||
# with: | ||
# run: npm run testMultiWorkspace:cover | ||
|
||
# Enable these tests when coverage is setup for debugger tests | ||
# - name: Run debugger tests | ||
# env: | ||
# CI_PYTHON_VERSION: ${{env.PYTHON_VERSION}} | ||
# CI_DISABLE_AUTO_SELECTION: 1 | ||
# uses: GabrielBB/xvfb-action@v1.4 | ||
# with: | ||
# run: npm run testDebugger:cover | ||
|
||
- name: Run TypeScript functional tests | ||
env: | ||
CI_PYTHON_VERSION: ${{env.PYTHON_VERSION}} | ||
CI_DISABLE_AUTO_SELECTION: 1 | ||
run: npm run test:functional:cover | ||
|
||
- name: Generate coverage reports | ||
run: npm run test:cover:report | ||
|
||
- name: Upload HTML report | ||
uses: actions/upload-artifact@v2 | ||
with: | ||
name: ${{ runner.os }}-coverage-report-html | ||
path: ./coverage | ||
retention-days: 1 | ||
|
||
- name: Upload coverage to codecov | ||
uses: codecov/codecov-action@v1 | ||
with: | ||
token: ${{ secrets.CODECOV_TOKEN }} | ||
file: ./coverage/cobertura-coverage.xml |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
@karthiknadig Looks like we accidently removed this step. Development build is no longer updated.