From e8af11faa567ce62d85ead51e110a2030b00d6c5 Mon Sep 17 00:00:00 2001 From: Claude Date: Sun, 16 Nov 2025 12:28:02 +0000 Subject: [PATCH 1/2] Split tests and coverage into separate GitHub Actions jobs - Created separate 'test' job: runs tests without coverage for faster feedback - Created separate 'coverage' job: runs tests with coverage measurement - Tests in 'test' job no longer install pytest-cov (faster installation) - Both jobs run in parallel for better CI efficiency - Updated 'build' job to depend on both test and coverage - Updated 'coverage-report' job to depend on coverage job --- .github/workflows/ci.yml | 46 +++++++++++++++++++++++++++++++++++++--- 1 file changed, 43 insertions(+), 3 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 6a9267b..7ac8775 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -35,7 +35,7 @@ jobs: run: | python -m pip install --upgrade pip pip install -r requirements.txt - pip install pytest pytest-cov pytest-xdist pytest-timeout + pip install pytest pytest-xdist pytest-timeout - name: Check Python version run: | @@ -43,6 +43,46 @@ jobs: python -c "import sys; print(f'Python {sys.version_info.major}.{sys.version_info.minor}.{sys.version_info.micro}')" - name: Run tests with pytest + run: | + pytest tests/ -v --tb=short + continue-on-error: false + + coverage: + runs-on: ubuntu-latest + strategy: + matrix: + python-version: ['3.13'] + + steps: + - name: Checkout code + uses: actions/checkout@v4 + + - name: Set up Python ${{ matrix.python-version }} + uses: actions/setup-python@v5 + with: + python-version: ${{ matrix.python-version }} + allow-prereleases: true + + - name: Cache pip packages + uses: actions/cache@v4 + with: + path: ~/.cache/pip + key: ${{ runner.os }}-pip-${{ hashFiles('**/requirements.txt') }} + restore-keys: | + ${{ runner.os }}-pip- + + - name: Install dependencies + run: | + python -m pip install --upgrade pip + pip install -r requirements.txt + pip install pytest pytest-cov pytest-xdist pytest-timeout + + - name: Check Python version + run: | + python --version + python -c "import sys; print(f'Python {sys.version_info.major}.{sys.version_info.minor}.{sys.version_info.micro}')" + + - name: Run tests with coverage run: | pytest tests/ -v --cov=vnc_lib --cov-report=xml --cov-report=html --cov-report=term-missing --tb=short continue-on-error: false @@ -124,7 +164,7 @@ jobs: build: runs-on: ubuntu-latest - needs: [test, lint] + needs: [test, coverage, lint] steps: - name: Checkout code uses: actions/checkout@v4 @@ -152,7 +192,7 @@ jobs: coverage-report: runs-on: ubuntu-latest - needs: test + needs: coverage steps: - name: Checkout code uses: actions/checkout@v4 From adc550e93ee19a0b642b6f1cf100ac4c28db6460 Mon Sep 17 00:00:00 2001 From: Claude Date: Sun, 16 Nov 2025 12:30:23 +0000 Subject: [PATCH 2/2] Remove coverage flags from pytest.ini default options Coverage was running in test job because pytest.ini had --cov flags in addopts, which are applied to ALL pytest runs by default. Changes: - Removed --cov=vnc_lib from default addopts - Removed --cov-report flags from default addopts - Removed --cov-fail-under from default addopts - Kept coverage configuration sections for when --cov is explicitly used - Now coverage only runs when explicitly requested via command line flags This ensures the 'test' job runs fast without coverage overhead, while the 'coverage' job still runs with full coverage measurement. --- pytest.ini | 5 ----- 1 file changed, 5 deletions(-) diff --git a/pytest.ini b/pytest.ini index 37b93d7..4ea02b4 100644 --- a/pytest.ini +++ b/pytest.ini @@ -12,11 +12,6 @@ addopts = -v --strict-markers --tb=short - --cov=vnc_lib - --cov-report=term-missing - --cov-report=html - --cov-report=xml - --cov-fail-under=65 # Coverage options [coverage:run]