mirror of
https://github.com/microsoft/pyright.git
synced 2024-10-03 19:37:39 +03:00
Create test for virtual environment (#6007)
* Create test for virtual environment * Figure out why python path test is failing * Eliminate quotes on venv_path * Actually set the python path * Try just printing path on windows * Print a different variable * Try other echo patterns * user powershell commands to append * Fix prettier
This commit is contained in:
parent
0e95e48650
commit
21aee77eb5
43
.github/workflows/validation.yml
vendored
43
.github/workflows/validation.yml
vendored
@ -2,6 +2,7 @@ name: 'Validation'
|
||||
|
||||
env:
|
||||
NODE_VERSION: '16' # Shipped with VS Code.
|
||||
PYTHON_VERSION: 3.11
|
||||
|
||||
on:
|
||||
push:
|
||||
@ -107,6 +108,48 @@ jobs:
|
||||
run: npm test
|
||||
working-directory: packages/pyright-internal
|
||||
|
||||
# Install python so we can create a VENV for tests
|
||||
- name: Use Python ${{env.PYTHON_VERSION}}
|
||||
uses: actions/setup-python@v4
|
||||
id: install_python
|
||||
with:
|
||||
python-version: ${{env.PYTHON_VERSION}}
|
||||
|
||||
- name: Create Venv
|
||||
run: |
|
||||
${{ steps.install_python.outputs.python-path }} -m venv .venv
|
||||
|
||||
- name: Activate and install pytest (linux)
|
||||
if: runner.os != 'Windows'
|
||||
run: |
|
||||
source .venv/bin/activate
|
||||
python -m pip install pytest
|
||||
python -c "import sys;print('python_venv_path=' + sys.executable)" >> $GITHUB_ENV
|
||||
|
||||
- name: Activate and install pytest (windows)
|
||||
if: runner.os == 'Windows'
|
||||
run: |
|
||||
.venv\scripts\activate
|
||||
python -m pip install pytest
|
||||
python -c "import sys;print('python_venv_path=' + sys.executable)" | Out-File -FilePath $env:GITHUB_ENV -Append
|
||||
|
||||
- name: Echo python_venv_path
|
||||
run: |
|
||||
echo python_venv_path=${{env.python_venv_path}}
|
||||
|
||||
- name: Run import tests with venv
|
||||
env:
|
||||
CI_IMPORT_TEST_VENVPATH: '../../'
|
||||
CI_IMPORT_TEST_VENV: '.venv'
|
||||
run: npm run test:imports
|
||||
working-directory: packages/pyright-internal
|
||||
|
||||
- name: Run import tests with pythonpath
|
||||
env:
|
||||
CI_IMPORT_TEST_PYTHONPATH: ${{env.python_venv_path}}
|
||||
run: npm run test:imports
|
||||
working-directory: packages/pyright-internal
|
||||
|
||||
build:
|
||||
runs-on: ubuntu-latest
|
||||
name: Build
|
||||
|
3
.gitignore
vendored
3
.gitignore
vendored
@ -123,3 +123,6 @@ junit.xml
|
||||
# OS files
|
||||
.DS_Store
|
||||
Thumbs.db
|
||||
|
||||
# Potential venv
|
||||
.venv
|
@ -12,7 +12,8 @@
|
||||
"build": "tsc",
|
||||
"clean": "shx rm -rf ./dist ./out",
|
||||
"test": "jest --forceExit",
|
||||
"test:coverage": "jest --forceExit --reporters=jest-junit --reporters=default --coverage --coverageReporters=cobertura --coverageReporters=html --coverageReporters=json"
|
||||
"test:coverage": "jest --forceExit --reporters=jest-junit --reporters=default --coverage --coverageReporters=cobertura --coverageReporters=html --coverageReporters=json",
|
||||
"test:imports": "jest importResolver.test --forceExit --runInBand"
|
||||
},
|
||||
"dependencies": {
|
||||
"@iarna/toml": "2.2.5",
|
||||
|
File diff suppressed because it is too large
Load Diff
Loading…
Reference in New Issue
Block a user