ci: backend-agnostic integration tests, per-backend skip visibility, and artifact-based coverage #414

Open
opened 2026-07-18 14:13:41 -04:00 by didericis-claude · 0 comments
Collaborator

Background

PR #349 moved the coverage job to a self-hosted KVM runner. During review, the following improvements were identified but deferred to keep the PR scope manageable.

Tasks

1. Backend-agnostic integration tests

Integration tests should not assume a specific backend. Currently:

  • Several test files are named test_orchestrator_docker_* with Docker-specific assumptions baked into fixtures and networking
  • test_sandbox_escape.py carries @skip_unless_docker() even though the Firecracker backend is fully Docker-independent at runtime (Docker is only a build-time dep for the gateway image — confirmed: the Firecracker gateway runs in a microVM via SSH, not a Docker container)
  • setUpClass reads BOT_BOTTLE_BACKEND already, but the fixture layer (networking, container/VM lifecycle) needs abstraction

Goal: each integration test reads BOT_BOTTLE_BACKEND and exercises the full test via whatever backend is specified. Backend-specific skip guards should check capability (e.g. /dev/kvm accessible) not Docker availability.

2. Explicit skip visibility per backend

When running the integration suite, skipped backends should be surfaced clearly — not silent no-ops inside test output. A preflight step per backend job should print a pass/fail capability check so a missing backend shows up as a distinct skipped/cancelled job in CI rather than hidden unittest.skip lines.

3. Coverage via artifact combination (deferred from #349)

Instead of re-running tests inside the coverage job, each test job should:

  1. Run with coverage run and upload the resulting .coverage file as an artifact
  2. The coverage job downloads all artifacts, runs coverage combine, then diff_coverage.py

This eliminates the double test-run and makes coverage a pure aggregation step. Requires actions/upload-artifact + actions/download-artifact in each job and a reworked coverage job.

Related

  • PR #349 (the KVM runner migration that prompted this)
  • docs/decisions/0004-coverage-policy.md
## Background PR #349 moved the `coverage` job to a self-hosted KVM runner. During review, the following improvements were identified but deferred to keep the PR scope manageable. ## Tasks ### 1. Backend-agnostic integration tests Integration tests should not assume a specific backend. Currently: - Several test files are named `test_orchestrator_docker_*` with Docker-specific assumptions baked into fixtures and networking - `test_sandbox_escape.py` carries `@skip_unless_docker()` even though the Firecracker backend is fully Docker-independent at runtime (Docker is only a build-time dep for the gateway image — confirmed: the Firecracker gateway runs in a microVM via SSH, not a Docker container) - `setUpClass` reads `BOT_BOTTLE_BACKEND` already, but the fixture layer (networking, container/VM lifecycle) needs abstraction Goal: each integration test reads `BOT_BOTTLE_BACKEND` and exercises the full test via whatever backend is specified. Backend-specific skip guards should check capability (e.g. `/dev/kvm` accessible) not Docker availability. ### 2. Explicit skip visibility per backend When running the integration suite, skipped backends should be surfaced clearly — not silent no-ops inside test output. A preflight step per backend job should print a pass/fail capability check so a missing backend shows up as a distinct skipped/cancelled job in CI rather than hidden `unittest.skip` lines. ### 3. Coverage via artifact combination (deferred from #349) Instead of re-running tests inside the `coverage` job, each test job should: 1. Run with `coverage run` and upload the resulting `.coverage` file as an artifact 2. The `coverage` job downloads all artifacts, runs `coverage combine`, then `diff_coverage.py` This eliminates the double test-run and makes coverage a pure aggregation step. Requires `actions/upload-artifact` + `actions/download-artifact` in each job and a reworked `coverage` job. ## Related - PR #349 (the KVM runner migration that prompted this) - `docs/decisions/0004-coverage-policy.md`
didericis-claude added the Kind/TestingKind/Enhancement labels 2026-07-18 14:13:41 -04:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: didericis/bot-bottle#414