Skip to content

feat(ci): add comprehensive tests + build job + expanded CI#1

Merged
ledutheo merged 1 commit into
mainfrom
feat/add-tests-and-ci
Jun 3, 2026
Merged

feat(ci): add comprehensive tests + build job + expanded CI#1
ledutheo merged 1 commit into
mainfrom
feat/add-tests-and-ci

Conversation

@ledutheo

@ledutheo ledutheo commented Jun 3, 2026

Copy link
Copy Markdown
Owner

What

  • Tests: 21 new tests in tests/test_cli.py using typer.testing.CliRunner + heavy mocking (subprocess, shutil.which, platform, builtins.open, typer.confirm). Covers:

    • All commands (info, clean dry-run + interactive, update with/without AUR, search happy+empty paths, backup success+fail, version)
    • Helper run_command error paths
    • Smoke tests for registration
  • Tests are cross-platform (no real pacman/tar/sudo needed).

  • CI expansion (.github/workflows/ci.yml):

    • lint job now also runs ruff format --check, lints tests/, installs via .[dev]
    • New test job with matrix on Python 3.10 / 3.11 / 3.12 (pytest)
    • New build job: uv build, verify dist/ artifacts, smoke-install the wheel and exercise the syskit entrypoint
  • Tooling:

    • pyproject.toml: [project.optional-dependencies] dev = [ruff, mypy, pytest, build], [tool.pytest.ini_options]
    • Dynamic __version__ via importlib.metadata (no more hard-coded in 3 places)
    • README dev section updated with test/lint/format commands

All local checks (ruff, mypy, pytest, build smoke) ✅

Why

Closes the "add tests, a build job, or other things" request. Makes the project much more robust and the CI actually useful (previously only lint that was red).

Test plan

  • ruff check . && ruff format --check .
  • mypy src/
  • pytest (21 tests)
  • python -m build + wheel install + syskit version
  • CI will run the 3 jobs on push/PR

Next ideas (roadmap items)

  • More commands + their tests
  • Coverage reporting in CI
  • AUR package + real e2e on Arch runner?
  • Pre-commit hooks

Ready for review!

- Add pytest + 21 tests for all CLI commands (using CliRunner + mocks)
- New jobs in CI: lint (now with format check + tests dir), test (matrix 3.10-3.12), build (uv build + smoke install)
- pyproject: [project.optional-dependencies] dev, pytest config
- Dynamic __version__ from importlib.metadata (single source of truth)
- Update README dev instructions
- Bump/fix CI actions already done previously

All checks (ruff, mypy, pytest, build) now pass locally and in CI.
@ledutheo ledutheo merged commit 192afb8 into main Jun 3, 2026
5 checks 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.

1 participant