test: reorganize suite into unit/integration/canaries directories

Replace the hand-maintained INTEGRATION_NAMES classifier (and the
bespoke run_tests.py around it) with a directory-driven split:

  tests/unit/         unit tests, always run
  tests/integration/  Docker-dependent, skip cleanly without Docker
  tests/canaries/     upstream-regression checks, opt-in via
                      CLAUDE_BOTTLE_RUN_CANARIES=1

The pinned-pipelock-image check moves to the canary suite — it tests
upstream packaging, not our code, so it shouldn't gate every dev push.
A scheduled canaries.yml workflow runs it weekly.

The manifest-runtime tests collapse the four assertRaises cases for
distinct 'runtime' values into one subTest loop and drop the
error-message-wording assertions; the contract is "any value is
rejected", not "the error literally contains 'auto-detect'".

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
This commit is contained in:
2026-05-11 16:23:02 -04:00
parent 83fe5741f5
commit 4462863d56
16 changed files with 157 additions and 207 deletions
+27 -10
View File
@@ -1,10 +1,14 @@
# Run the project's full test suite on every PR push and on push to main.
# Run the project's test suite on every PR push and on push to main.
#
# The suite uses stdlib `unittest` (see tests/run_tests.py) — no external
# Python dependencies are required to execute it. Integration tests need a
# reachable Docker daemon; if Docker is unavailable on the runner those
# tests skip cleanly via tests/_docker.py:skip_unless_docker, so the job
# still passes (with skips visible in the run output).
# The suite uses stdlib `unittest` discovery — no external Python
# dependencies are required to execute it. Tests are split by directory:
#
# tests/unit/ — pure unit tests; always run
# tests/integration/ — need a reachable Docker daemon; skip cleanly
# (via tests/_docker.py:skip_unless_docker) when
# Docker isn't available on the runner
# tests/canaries/ — upstream regression canaries; run on a separate
# schedule (see canaries.yml), not here
#
# This workflow assumes the Gitea Actions runner exposes the host Docker
# socket to the job container so `docker` commands inside the job can
@@ -20,8 +24,21 @@ on:
pull_request:
jobs:
test:
name: run tests/run_tests.py
unit:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: "3.12"
- name: Run unit tests
run: python3 -m unittest discover -t . -s tests/unit -v
integration:
runs-on: ubuntu-latest
steps:
- name: Checkout
@@ -41,5 +58,5 @@ jobs:
echo "docker not on PATH — integration tests will skip"
fi
- name: Run full test suite
run: python3 tests/run_tests.py
- name: Run integration tests
run: python3 -m unittest discover -t . -s tests/integration -v