forked from DonJayamanne/pythonVSCode
-
Notifications
You must be signed in to change notification settings - Fork 1.2k
Ideas for speeding up and including flakey tests in PR #14265
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
Merged
Merged
Changes from all commits
Commits
Show all changes
13 commits
Select commit
Hold shift + click to select a range
0c5a26a
First idea
rchiodo af0f22a
Disable IPywidget on CI machines
rchiodo f94a5f3
Missed functional publish
rchiodo e70f831
Fix name and actual arguments
rchiodo 9061e00
Submit comment change to get build to happen again
rchiodo c59bdaf
Comment change to spawn new run
rchiodo 72836e1
Fix problem of running functional tests twice
rchiodo af0562b
Remove data science tests from functional tests
rchiodo 9a2d704
Add github action for PR for DS
rchiodo 80cbcca
Split groups based on size
rchiodo 4772539
Make sure to install local requirements too
rchiodo 58639fc
Test results not being published
rchiodo 217de7b
Mark trusted notebook tests as DataScience
rchiodo 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 hidden or 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,159 @@ | ||
name: Pull Request DataScience | ||
|
||
on: | ||
push: | ||
branches: | ||
- main | ||
pull_request: | ||
branches: | ||
- main | ||
check_run: | ||
types: [rerequested, requested_action] | ||
|
||
env: | ||
NODE_VERSION: 12.15.0 | ||
PYTHON_VERSION: 3.8 | ||
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. | ||
CACHE_NPM_DEPS: cache-npm | ||
CACHE_OUT_DIRECTORY: cache-out-directory | ||
CACHE_PIP_DEPS: cache-pip | ||
# Key for the cache created at the end of the the 'Cache ./pythonFiles/lib/python' step. | ||
CACHE_PYTHONFILES: cache-pvsc-pythonFiles | ||
COVERAGE_REPORTS: tests-coverage-reports | ||
CI_PYTHON_PATH: python | ||
TEST_RESULTS_DIRECTORY: . | ||
TEST_RESULTS_GLOB: '**/test-results*.xml' | ||
|
||
jobs: | ||
tests: | ||
name: Functional Jupyter Tests | ||
runs-on: ${{ matrix.os }} | ||
if: github.repository == 'microsoft/vscode-python' | ||
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] | ||
python: [3.8] | ||
test-suite: [group1, group2, group3, group4] | ||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v2 | ||
|
||
- name: Use Python ${{matrix.python}} | ||
uses: actions/setup-python@v2 | ||
with: | ||
python-version: ${{matrix.python}} | ||
|
||
- name: Upgrade pip | ||
run: python -m pip install -U pip | ||
|
||
- name: Use Node ${{env.NODE_VERSION}} | ||
uses: actions/[email protected] | ||
with: | ||
node-version: ${{env.NODE_VERSION}} | ||
|
||
# Start caching | ||
|
||
# Cache Python Dependencies. | ||
# Caching (https://github.com/actions/cache/blob/main/examples.md#python---pip | ||
- name: Cache pip on linux | ||
uses: actions/cache@v2 | ||
if: matrix.os == 'ubuntu-latest' | ||
with: | ||
path: ~/.cache/pip | ||
key: ${{ runner.os }}-pip-${{env.PYTHON_VERSION}}-${{ hashFiles('requirements.txt') }}-${{hashFiles('build/debugger-install-requirements.txt')}}-${{hashFiles('test-requirements.txt')}}-${{hashFiles('ipython-test-requirements.txt')}}-${{hashFiles('functional-test-requirements.txt')}}-${{hashFiles('conda-functional-requirements.txt')}} | ||
restore-keys: | | ||
${{ runner.os }}-pip-${{env.PYTHON_VERSION}}- | ||
|
||
- name: Cache pip on mac | ||
uses: actions/cache@v2 | ||
if: matrix.os == 'macos-latest' | ||
with: | ||
path: ~/Library/Caches/pip | ||
key: ${{ runner.os }}-pip-${{env.PYTHON_VERSION}}-${{ hashFiles('requirements.txt') }}-${{hashFiles('build/debugger-install-requirements.txt')}}-${{hashFiles('test-requirements.txt')}}-${{hashFiles('ipython-test-requirements.txt')}}-${{hashFiles('functional-test-requirements.txt')}}-${{hashFiles('conda-functional-requirements.txt')}} | ||
restore-keys: | | ||
${{ runner.os }}-pip-${{env.PYTHON_VERSION}}- | ||
|
||
- name: Cache pip on windows | ||
uses: actions/cache@v2 | ||
if: matrix.os == 'windows-latest' | ||
with: | ||
path: ~\AppData\Local\pip\Cache | ||
key: ${{ runner.os }}-pip-${{env.PYTHON_VERSION}}-${{ hashFiles('requirements.txt') }}-${{hashFiles('build/debugger-install-requirements.txt')}}-${{hashFiles('test-requirements.txt')}}-${{hashFiles('ipython-test-requirements.txt')}}-${{hashFiles('functional-test-requirements.txt')}}-${{hashFiles('conda-functional-requirements.txt')}} | ||
restore-keys: | | ||
${{ runner.os }}-pip-${{env.PYTHON_VERSION}}- | ||
|
||
# Caching of npm packages (https://github.com/actions/cache/blob/main/examples.md#node---npm) | ||
- name: Cache npm on linux/mac | ||
uses: actions/cache@v2 | ||
if: matrix.os != 'windows-latest' | ||
with: | ||
path: ~/.npm | ||
key: ${{ runner.os }}-node-${{ hashFiles('**/package-lock.json') }} | ||
restore-keys: | | ||
${{ runner.os }}-node- | ||
|
||
- name: Get npm cache directory | ||
if: matrix.os == 'windows-latest' | ||
id: npm-cache | ||
run: | | ||
echo "::set-output name=dir::$(npm config get cache)" | ||
- name: Cache npm on windows | ||
uses: actions/cache@v2 | ||
if: matrix.os == 'windows-latest' | ||
with: | ||
path: ${{ steps.npm-cache.outputs.dir }} | ||
key: ${{ runner.os }}-node-${{ hashFiles('**/package-lock.json') }} | ||
restore-keys: | | ||
${{ runner.os }}-node- | ||
|
||
- name: Cache compiled TS files | ||
id: out-cache | ||
uses: actions/cache@v2 | ||
with: | ||
path: ./out | ||
key: ${{runner.os}}-${{env.CACHE_OUT_DIRECTORY}}-${{hashFiles('src/**')}} | ||
|
||
# For faster/better builds of sdists. | ||
- run: python -m pip install wheel | ||
shell: bash | ||
|
||
# debugpy is not shipped, only installed for local tests. | ||
# In production, we get debugpy from python extension. | ||
- name: Install functional test 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 | ||
python -m pip --disable-pip-version-check install -r build/debugger-install-requirements.txt | ||
python ./pythonFiles/install_debugpy.py | ||
python -m pip install numpy | ||
python -m pip install --upgrade jupyter | ||
python -m pip install --upgrade -r build/test-requirements.txt | ||
python -m pip install --upgrade -r ./build/ipython-test-requirements.txt | ||
python -m pip install --upgrade -r ./build/conda-functional-requirements.txt | ||
python -m ipykernel install --user | ||
# This step is slow. | ||
|
||
- name: Install dependencies (npm ci) | ||
run: npm ci --prefer-offline | ||
# This step is slow. | ||
|
||
- name: Compile if not cached | ||
run: npx gulp prePublishNonBundle | ||
|
||
- name: Run functional tests | ||
run: npm run test:functional:parallel -- --${{matrix.test-suite}} | ||
env: | ||
VSCODE_PYTHON_ROLLING: 1 | ||
VSC_PYTHON_FORCE_LOGGING: 1 | ||
id: test_functional_group | ||
|
||
- name: Publish Test Report | ||
uses: scacap/action-surefire-report@v1 | ||
with: | ||
github_token: ${{ secrets.GITHUB_TOKEN }} | ||
report_paths: ${{ env.TEST_RESULTS_GLOB }} | ||
check_name: Functional Test Report | ||
if: steps.test_functional_group.outcome == 'failure' && failure() | ||
|
This file contains hidden or 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 hidden or 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
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.
Weed can optionally run this same workflow in ci (commits to main),
This way we have three running on main branch for every commit, and we don't need to copy paste this (just a thought, copy paste sux)
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 believe that's a 'push' right? Added that.