core/.github/workflows/full-pytest.yml
Shay f93f756e44
Some checks failed
smoke / smoke (-m "not quarantine") (pull_request) Successful in 5m35s
lane-shas / verify pinned lane SHAs (pull_request) Failing after 28m37s
ci: order-of-magnitude CI optimization for single 2-vCPU Act runner
Root cause of PR checks stuck "Waiting to run": full-pytest on main ran
~12k tests including the slow registry on a 1.5-CPU / 1.2 GiB job cgroup
for hours, monopolizing the only runner.

Workflows:
- full-pytest.yml: fast lane only (`not quarantine and not slow`)
- nightly-full-pytest.yml: full suite including slow (schedule + manual)
- lane-shas.yml: PR path filters so pin verification is skipped when
  the change cannot affect lane report bytes

Docs: docs/ci-optimization.md + testing-lanes CI mapping.

Infra (VM, same change window): job cgroup 2 CPU / 1800 MiB; hung
full-pytest task stopped so the queue can drain PR smoke/lane-shas.
2026-07-14 20:40:52 -07:00

74 lines
2.4 KiB
YAML
Raw Blame History

This file contains invisible Unicode characters

This file contains invisible Unicode characters that are indistinguishable to humans but may be processed differently by a computer. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

name: full-pytest
# Post-merge gate — runs the **fast** lane on every push to main.
#
# Why not full+slow here:
# Host is a 2vCPU / ~4GiB VM shared with Forgejo + Postgres + Traefik.
# Job containers were capped at 1.5 CPU / 1.2GiB. Running the entire
# ~12k-test suite including the slow registry (one 16min fixture floor)
# monopolized the single Act runner for hours and starved PR smoke /
# lane-shas ("Waiting to run").
#
# Coverage contract:
# - This workflow: ``not quarantine and not slow`` (make test-fast).
# - Slow/soak/proof matrix: ``nightly-full-pytest.yml`` (schedule + manual).
# - PR gate remains smoke.yml (minutes) + path-filtered lane-shas.yml.
#
# See docs/testing-lanes.md and docs/ci-optimization.md.
on:
push:
branches: [main]
permissions:
contents: read
concurrency:
group: full-pytest-${{ github.ref }}
cancel-in-progress: true
jobs:
pytest:
name: full pytest (fast lane, not quarantine and not slow)
runs-on: ubuntu-latest
# Fast lane should finish well under this on a healthy runner.
timeout-minutes: 30
steps:
- name: checkout
uses: actions/checkout@v4
with:
fetch-depth: 1
- name: set up uv
uses: astral-sh/setup-uv@v5
with:
python-version: '3.12.13'
enable-cache: true
- name: install dependencies
run: |
uv pip install -e ".[dev]" pyyaml
- name: pytest fast lane (parallel)
env:
PYTHONPATH: ${{ github.workspace }}
CORE_SHOWCASE_SKIP_BUDGET: "1"
# Avoid uv hardlink warning noise across filesystems on Act.
UV_LINK_MODE: copy
run: |
# -n 2 matches prior CI; host is 2 vCPU — do not raise without more cores.
uv run pytest -m "not quarantine and not slow" -n 2 --tb=short -q --maxfail=10
- name: report quarantine + slow registry size (informational)
if: always()
env:
PYTHONPATH: ${{ github.workspace }}
run: |
uv run python -c "
import sys
sys.path.insert(0, '.')
from conftest import QUARANTINE, SLOW_FILES, SLOW_TESTS
print(f'::notice title=Quarantine size::{len(QUARANTINE)} tests quarantined.')
print(f'::notice title=Slow registry::{len(SLOW_FILES)} files + {len(SLOW_TESTS)} exact tests classified slow (nightly only).')
"