Skip to content

Run the ConPTY lifecycle tests on windows-2022 #1595

Run the ConPTY lifecycle tests on windows-2022

Run the ConPTY lifecycle tests on windows-2022 #1595

Workflow file for this run

name: Code Quality & Tests
on:
push:
pull_request:
env:
PYTHON_VERSION: "3.11"
jobs:
black:
name: Black Formatting
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: ${{ env.PYTHON_VERSION }}
- name: Cache pip
uses: actions/cache@v4
with:
path: ~/.cache/pip
key: ${{ runner.os }}-pip-${{ hashFiles('requirements.txt') }}
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install -r requirements.txt
- name: Check formatting with Black
run: black . --check
isort:
name: Import Sorting
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: ${{ env.PYTHON_VERSION }}
- name: Cache pip
uses: actions/cache@v4
with:
path: ~/.cache/pip
key: ${{ runner.os }}-pip-${{ hashFiles('requirements.txt') }}
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install isort
- name: Sort imports with isort
run: isort . --check-only --diff
flake8:
name: Flake8 Linting
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: ${{ env.PYTHON_VERSION }}
- name: Cache pip
uses: actions/cache@v4
with:
path: ~/.cache/pip
key: ${{ runner.os }}-pip-${{ hashFiles('requirements.txt') }}
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install flake8
- name: Lint with flake8
run: flake8 .
mypy:
name: MyPy Type Checking
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: ${{ env.PYTHON_VERSION }}
- name: Cache pip
uses: actions/cache@v4
with:
path: ~/.cache/pip
key: ${{ runner.os }}-pip-${{ hashFiles('requirements.txt') }}
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install -r requirements.txt
- name: Type check with mypy
run: mypy . --check-untyped-defs
conpty-lifecycle:
# windows-latest is Windows Server 2025 (build 26100), the build that made
# ClosePseudoConsole() non-blocking, so the teardown-ordering assertions pass there
# whether or not the ordering is correct. Windows Server 2022 is build 20348, inside the
# affected range, which is the only place those assertions prove anything.
name: ConPTY Lifecycle (windows-2022)
runs-on: windows-2022
steps:
- uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: ${{ env.PYTHON_VERSION }}
cache: pip
cache-dependency-path: requirements.txt
- name: Upgrade pip
run: python -m pip install --upgrade pip
- name: Install requirements
run: pip install -r requirements.txt
- name: Run the ConPTY lifecycle tests
run: python -m pytest tests/test_conpty.py -v
tests:
name: Run Tests
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: ${{ env.PYTHON_VERSION }}
- name: Configure git for tests
run: |
git config --global user.email "test@example.com"
git config --global user.name "Test Runner"
git config --global init.defaultBranch main
- name: Cache pip
uses: actions/cache@v4
with:
path: ~/.cache/pip
key: ${{ runner.os }}-pip-${{ hashFiles('requirements.txt') }}
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install -r requirements.txt
pip install coverage
- name: Run tests with coverage
run: |
export $(cat .env.dev.example | xargs)
coverage run -m pytest tests/ -v
coverage xml
coverage report
- name: Upload coverage reports
uses: codecov/codecov-action@v3