From 4604078e99cc06064ac2ceb1d4da58a35e2bcc17 Mon Sep 17 00:00:00 2001 From: claude-im Date: Mon, 6 Jul 2026 22:03:24 +0100 Subject: [PATCH 1/2] ci: Add GitHub Actions workflow to run the test suite Runs `uv run pytest` on every push and pull request, pinning the interpreter from .python-version via astral-sh/setup-uv. The workflow YAML is force-added because *.yaml is git-ignored repo-wide. CLAUDE.md is updated to document the pytest suite and correct the stale "no test suite exists" note. Co-Authored-By: Claude Opus 4.8 --- .github/workflows/test.yaml | 19 +++++++++++++++++++ CLAUDE.md | 20 ++++++++++++++++++-- 2 files changed, 37 insertions(+), 2 deletions(-) create mode 100644 .github/workflows/test.yaml diff --git a/.github/workflows/test.yaml b/.github/workflows/test.yaml new file mode 100644 index 0000000..dfc2852 --- /dev/null +++ b/.github/workflows/test.yaml @@ -0,0 +1,19 @@ +--- +name: test + +on: +- push +- pull_request + +jobs: + test: + runs-on: ubuntu-latest + steps: + - name: Checkout + uses: actions/checkout@v4 + - name: Install uv + uses: astral-sh/setup-uv@v6 + with: + python-version-file: .python-version + - name: Run tests + run: uv run pytest diff --git a/CLAUDE.md b/CLAUDE.md index 15a04ec..0735247 100644 --- a/CLAUDE.md +++ b/CLAUDE.md @@ -47,8 +47,24 @@ current configuration and takes no arguments. markers (`:white_check_mark:` success, `:cross_mark:`/`:boom:` failure). - SSL warnings are silenced at import via `urllib3.disable_warnings(urllib3.exceptions.InsecureRequestWarning)`. -- No test suite, linter config, or build step exists. The README advertises - `black` code style; new code should match it. +- No linter config or build step exists. The README advertises `black` code + style; new code should match it. See *Testing* below for the test suite. + +## Testing + +A `pytest` suite lives in `tests/`, with `pytest` declared in the `dev` +dependency group in `pyproject.toml`. Run it with: + +```bash +uv run pytest +``` + +Tests cover the pure, side-effect-free helpers within tools. Because tools are +hyphenated standalone scripts (e.g. `load-er.py`) rather than importable +modules, tests load them by path via `importlib` — see +`tests/test_load_er.py`. Extract logic into such helpers so it can be tested +without live Squonk2 API calls. GitHub Actions runs the suite on every push and +pull request (`.github/workflows/test.yaml`). ## Standard tool structure From 1ef34bdd9419177dee35be0a58b0c128aa3049a4 Mon Sep 17 00:00:00 2001 From: claude-im Date: Mon, 6 Jul 2026 22:05:18 +0100 Subject: [PATCH 2/2] docs: Add test workflow status badge to README Co-Authored-By: Claude Opus 4.8 --- README.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/README.md b/README.md index 650e844..369575e 100644 --- a/README.md +++ b/README.md @@ -2,6 +2,8 @@ ![GitHub tag (latest SemVer)](https://img.shields.io/github/v/tag/informaticsmatters/squonk2-python-cl-tools) +[![test](https://github.com/InformaticsMatters/squonk2-python-cl-tools/actions/workflows/test.yaml/badge.svg)](https://github.com/InformaticsMatters/squonk2-python-cl-tools/actions/workflows/test.yaml) + [![Code style: black](https://img.shields.io/badge/code%20style-black-000000.svg)](https://github.com/psf/black) A collection of Python-based Command line tools to help manage and maintain