Skip to content

ci: add CI and cover reindex_1024_mac validation paths - #7

Merged
man4ish merged 2 commits into
mainfrom
ci/restore-ci
Oct 3, 2026
Merged

man4ish merged 2 commits into
mainfrom
ci/restore-ci

Conversation

@man4ish

@man4ish man4ish commented Oct 3, 2026

Copy link
Copy Markdown
Collaborator

The repository had no CI, and the 98% coverage gate in pytest.ini failed on main at 97.08%. All 77 uncovered lines were in pubmed/reindex_1024_mac.py.

New tests: tests/pubmed/test_reindex_1024_mac_validation.py, offline and reusing the stubbed module from the checkpoint tests. It covers:

  • IndexingUnit namespace, name and remote-path validation;
  • the CLI's conflicting and out-of-range argument errors, and internal --worker-unit parsing;
  • supervisor manifest records and worker_completion_recorded;
  • malformed JSON and JSONL source records, and JSON arrays;
  • the shape and NaN/Inf checks in validate_vectors;
  • cleanup that continues after an OSError, free_disk_gib, and the process_chunk compatibility entry point.

Total coverage is now 98.56%: 179 tests pass, 18 of them new.

New CI: .github/workflows/ci.yml runs pytest, with the pytest.ini coverage gate, on Python 3.11 for pushes and PRs to main.

  • The tests import the scripts' real dependencies, so CI installs CPU-only torch, sentence-transformers, faiss-cpu, numpy, requests, pyyaml and playwright.
  • It then removes hf_xet, which tests/pubmed asserts is absent.
  • Read-only permissions.

Verified locally: the workflow's install step, replayed in a fresh Python 3.11 environment (torch from PyPI there, because the PyTorch index is blocked in the sandbox), then pytest: 179 passed, coverage 98.56%.

🤖 Generated with Claude Code

https://claude.ai/code/session_016nxi4bp7DP1ancERNUUfzj


Generated by Claude Code

claude added 2 commits October 3, 2026 05:09
The repository had no CI, and pytest.ini's 98% coverage gate failed on
main at 97.08%: all 77 uncovered lines were in pubmed/reindex_1024_mac.py.

tests/pubmed/test_reindex_1024_mac_validation.py adds offline tests for
IndexingUnit name and path validation, the CLI's argument errors and
internal worker-unit parsing, supervisor manifest records and
worker_completion_recorded, malformed JSON/JSONL source records,
validate_vectors shape and NaN checks, cleanup after an OSError,
free_disk_gib, and the process_chunk compatibility entry point. Total
coverage is now 98.56%.

.github/workflows/ci.yml runs pytest (with the pytest.ini coverage gate)
on Python 3.11 for pushes and pull requests to main. The tests import the
scripts' real dependencies, so it installs CPU-only torch,
sentence-transformers, faiss-cpu, and the rest, then removes hf_xet,
which tests/pubmed asserts is absent.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_016nxi4bp7DP1ancERNUUfzj
actions/setup-python's pip cache defaults to requirements.txt or
pyproject.toml, neither of which exists here, so the job stopped before
installing anything.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_016nxi4bp7DP1ancERNUUfzj
@man4ish
man4ish merged commit e0d3045 into main Oct 3, 2026
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants