chore(ci): wyrzuc coverage z CI + lokalny make coverage-ai#242
Open
mpasternak wants to merge 3 commits into
Open
chore(ci): wyrzuc coverage z CI + lokalny make coverage-ai#242mpasternak wants to merge 3 commits into
make coverage-ai#242mpasternak wants to merge 3 commits into
Conversation
Coveralls.io okresowo zwracal HTTP 520 (Cloudflare backend error) przy uploadzie raportu z CI, blokujac zielony build. Coverage data generowane na CI nigdy nie byly faktycznie ogladane. Zmiany: - .github/workflows/tests.yml: usun --cov flags i krok upload do Coveralls - .github/workflows/coveralls-finish.yml: usun caly workflow (parallel-finish nie ma juz czego finiszowac) - Makefile: usun targety clean-coverage, combine-coverage, coveralls-upload + odepnij je z chain'ow tests: i full-tests: - pyproject.toml: usun sekcje [tool.coverage.*] oraz dependency coveralls i pytest-cov - pytest.ini: usun zakomentowany blok --cov-report z addopts - uv.lock: regen (drop coveralls/coverage/pytest-cov + transitive) Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Lokalne narzedzie (NIE wpiete w CI) do generowania raportu pokrycia
zoptymalizowanego pod konsumpcje przez AI: sortowanie ascending po %,
filtr migracji/testow/trywialnych __init__.py, zwiezle zakresy linii
missing zamiast pojedynczych numerow, top-N najgorszych plikow.
Format wyjsciowy (~30 tokenow per plik, 3x mniej niz JSON):
src/bpp/foo.py COVER=12.5% STMTS=80 MISS=70 BRANCH=5 MISSING=5-12,18-25
Uzycie:
make coverage-ai # default: <90%, top 30, no playwright
make coverage-ai COVERAGE_THRESHOLD=80 COVERAGE_LIMIT=50
make coverage-ai COVERAGE_PYTEST_ARGS='-m ""' # rowniez playwright
Wprowadzone elementy:
- pyproject.toml: re-add pytest-cov + minimal [tool.coverage.*] config
(config jest inertny w CI — CI nie wola --cov)
- bin/coverage_for_ai.py: parser coverage.json -> compact LLM-friendly text
- Makefile: target `coverage-ai` z konfigurowalnym threshold/limit/args
- .gitignore: coverage.json + cov_html/ (efemeryczne artefakty)
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
- bin/coverage_for_ai.py: ruff zwinal kilka lamanych linii - uv.lock: idna 3.11 -> 3.16 (CVE-2026-45409, fixable, blokowal pip-audit gate; problem byl pre-existing na dev od 2026-05-21) Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Summary
--covw pytest, Makefile targetyclean-coverage/combine-coverage/coveralls-upload, sekcje[tool.coverage.*], depcoveralls,pytest-covoraz cala redundancja--cov-reportwpytest.ini.make coverage-ai— narzedzie zoptymalizowane pod konsumpcje przez agenta AI/LLM: sortuje pliki ascending po %, filtruje migracje/testy/trywialne__init__.py, emituje zwiezle zakresy linii missing zamiast pojedynczych numerow, ucina do top-N. Format<path> COVER=X% STMTS=N MISS=N BRANCH=N MISSING=L-L,L-Lto ~30 tokenow per plik (3x mniej niz rownowazny JSON).Uzycie
Wyjscie idzie na stdout — agent pipuje do swojego kontekstu lub
make coverage-ai > /tmp/cov.txt.Przykladowe wyjscie:
Decyzje projektowe
pytest-covzostaje jako dev dep, ale CI nie wola--cov— plugin jest neutralny dopoki nie podasz flagi, wiec instalacja CI nie cierpi.[tool.coverage.*]sekcje wracaja dopyproject.toml— sa inertne dopoki ktos nie odpalicoverageCLI; bez nichmake coverage-aimusialby duplikowac config.bin/coverage_for_ai.pyzamiast inline w Makefile — czytelniejsze, latwiej rozszerzyc, ma docstring z przykladami uzycia.Test plan
make coverage-ai(na lokalnej maszynie) — sprawdz ze tworzycoverage.jsoni wypluwa rankingmake helppokazujecoverage-aiw sekcji Testygrep -rn coveralls .github Makefile pyproject.toml pytest.ini-> 0 hits🤖 Generated with Claude Code