Skip to content

test: unit test suite for distribution-consistency checker (issue #8, slice 1)#12

Merged
wesleysimplicio merged 1 commit into
masterfrom
fix/issue-8
Jul 14, 2026
Merged

test: unit test suite for distribution-consistency checker (issue #8, slice 1)#12
wesleysimplicio merged 1 commit into
masterfrom
fix/issue-8

Conversation

@wesleysimplicio

Copy link
Copy Markdown
Owner

Closes #8

Summary

This repo is the public distribution repo for simplicio (committed release binaries + npm/pypi/Homebrew packaging + install scripts), not the agent's Rust source — there is no Cargo.toml/*.rs here, so cargo test/check/build do not apply. The testable "pacote principal" reachable from this repo today is its own tooling, starting with the highest-risk piece: scripts/verify_distribution_consistency.py, the packaging/version-drift auditor.

This PR delivers the first real, useful slice of the testing epic:

  • tests/unit/test_verify_distribution_consistency.py + tests/unit/conftest.py (RepoBuilder fixture): covers every finding branch of the checker — happy path, each ERROR case (missing branch-policy text, /main/ install references, version.txt/manifest mismatch), each WARN case (wrapper version drift, ecosystem-doc drift, stale/unparseable beta date, contradictory beta copy), and the parser helpers' error paths (malformed Formula/pyproject version strings).
  • Deterministic & isolated: date.today() is frozen via monkeypatch in every beta-date test; every test builds its own throwaway repo tree under pytest's tmp_path; no network access; no execution-order dependence.
  • Coverage: 98% line coverage on the module (20 tests), gated at --cov-fail-under=85, clearing both the 85% project-wide and 90% critical-area thresholds from the issue for this module.
  • CI: .github/workflows/tests.yml runs pytest tests/unit --cov=scripts --cov-fail-under=85 on pushes/PRs touching scripts//tests/, independent of the existing binary-release workflow.
  • Docs: README.md and CONTRIBUTING.md now state the official test command; docs/testing-strategy.md records what's covered, what's explicitly out of scope, and the remaining follow-up plan.

Acceptance criteria from issue #8 addressed by this slice

  • Convenção tests/unit, nomenclatura e comando oficial de testes definidos
  • Infraestrutura compartilhada de fixtures (RepoBuilder em conftest.py)
  • Primeiro módulo de maior risco totalmente coberto (feliz/limite/erro)
  • Testes determinísticos, sem rede, sem relógio real, sem estado global não isolado
  • Suíte reproduzível localmente e no CI (evidence abaixo)
  • README/CONTRIBUTING contém o comando oficial de testes
  • Cobertura 85%/90% no projeto inteiro — only this module is source right now; remaining modules (npm installers, install scripts) are follow-up work, documented in docs/testing-strategy.md
  • Branch coverage monitorada — follow-up once more modules exist

This epic is intentionally larger than one PR (per the issue's own step-by-step plan). docs/testing-strategy.md lists the prioritized next slices (npm installer tests with fs/network fakes, install-script tests, project-wide branch coverage roll-up) so the epic can be tracked to completion across multiple PRs.

Test plan

  • pip install -r requirements-dev.txt && python -m pytest tests/unit -v --cov=scripts --cov-report=term-missing --cov-fail-under=85 — 20 passed, 98.04% coverage, gate passes
  • Did not run cargo test/check/build (not applicable — no Rust source in this repo)
  • CI run on this PR (workflow added in this PR; will show green on the PR checks)

Kick off the testing epic (issue #8) with a first fully-covered slice.

Closes #8
@wesleysimplicio
wesleysimplicio merged commit d31a250 into master Jul 14, 2026
1 check failed
wesleysimplicio pushed a commit that referenced this pull request Jul 14, 2026
Brings in PR #12 (unit test suite, CONTRIBUTING.md, testing-strategy docs,
pyproject.toml, requirements-dev.txt, tests.yml workflow) alongside the
existing CI quality-gate workflow from this branch. .gitignore merged to
keep entries from both sides.
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.

[Quality Epic] Implantar estratégia completa de testes automatizados no pacote principal

1 participant