Skip to main content

hop3-testing

Testing framework for Hop3 deployment validation.

Overview

hop3-testing provides utilities and fixtures for testing Hop3 deployments. It supports running tests against Docker containers or remote servers, with a catalog of test applications covering various languages and frameworks.

Features

  • Multiple targets: Test against Docker containers or remote SSH servers
  • App catalog: Pre-built test applications for various languages
  • Deployment sessions: Automated deploy/verify/cleanup workflow
  • pytest fixtures: Integration with pytest for E2E testing
  • Category filtering: Run tests by language or framework

Installation

pip install hop3-testing

Quick Start

# List available tests
hop3-test list

# Run system tests on Docker
hop3-test run --docker

# Test specific apps
hop3-test apps 010-flask-pip-wsgi

# Test against remote server
hop3-test apps --host server.example.com

# Run CI tests
hop3-test ci

Commands

Command Description
hop3-test run Deploy Hop3 and run the catalog (system is a deprecated alias)
hop3-test run --reuse Test against an existing deployment (skip deploy)
hop3-test list List available tests (--show NAME for one test's details)
hop3-test run --provider hetzner --images ... E2E across cloud OS images (Hetzner)
hop3-test upgrade-chain Install a baseline release on a fresh box, then upgrade in-place through a version chain
hop3-test why <run-id> Replay a saved diagnostic bundle for a failed run

Test profile (fast/CI/full) is selected with --mode on run, not a separate subcommand: hop3-test run --docker --mode ci.

Upgrade chain

hop3-test upgrade-chain validates that a running server survives a chain of in-place upgrades. Each hop is a git ref, installed by that version's own hop3-deploy-server (checked out into a worktree and run via uv run), on a fresh box; every hop after the first is an in-place update, and each is asserted to come back healthy with a readable schema.

# Fresh Docker container: 0.6.2 → current tree
hop3-test upgrade-chain --docker

# Fresh Hetzner VPS (needs HETZNER_API_TOKEN + HETZNER_SERVER_ID)
hop3-test upgrade-chain --provider hetzner --image ubuntu-24.04

# Custom chain (release tags + `local` for the current tree)
hop3-test upgrade-chain --docker --chain 0.6.2,local

Cheapest smoke — exercises the whole mechanism (fresh install → in-place upgrade → assertions) with no old-version/worktree variable:

hop3-test upgrade-chain --docker --chain local,local

--host <server> is accepted but warns: it targets an existing server, not the clean slate an upgrade chain assumes. 0.6.0 is not a viable baseline (its hop3-rootd can't start) and is excluded from the default chain.

Common Options

Option Description
-v, --verbose Verbose output
--fail-fast Stop on first failure
--keep Keep apps deployed after testing
--docker Use Docker target
--host HOST Remote server hostname

Architecture

hop3-testing/
├── src/hop3_testing/
│   ├── cli/              # CLI commands
│   │   └── commands/     # Click command implementations
│   ├── catalog/          # Test discovery
│   │   ├── scanner.py    # Discovers test.toml files
│   │   └── models.py     # TestDefinition, Category
│   ├── apps/
│   │   ├── catalog.py    # AppSource dataclass
│   │   └── deployment.py # DeploymentSession
│   ├── targets/
│   │   ├── base.py       # DeploymentTarget ABC
│   │   ├── docker.py     # DockerTarget
│   │   └── remote.py     # RemoteTarget
│   └── results/          # Result storage and reporting
└── tests/

Test Categories

Category Languages/Frameworks
python Flask, FastAPI, Django
nodejs Express, Fastify
ruby Sinatra, Rails
go Fiber, Gin
rust Actix-web, Axum
static HTML, Hugo, Jekyll

Cloud Runs & the Image Sweep

Run full E2E tests across cloud OS images with hop3-test run --provider hetzner --images .... Each image is a full hop3-test run --provider hetzner (provision a fresh box → deploy → test → persist), so a cloud run shares run's lexicon: positional app names, --from, --branch, --with. Requires HETZNER_API_TOKEN and HETZNER_SERVER_ID (a dedicated throwaway box).

# List available images
hop3-test run --list-images

# Single distribution (a sweep-of-one)
hop3-test run --provider hetzner --image ubuntu-24.04 apps/test-apps-procfile

# Across multiple distributions
hop3-test run --provider hetzner --images ubuntu-24.04,debian-13,fedora-42

# From PyPI instead of local code
hop3-test run --provider hetzner --from pypi --images all

Cloud Run Options (run --provider hetzner)

Option Description
--image IMAGE Single OS image — a sweep-of-one (e.g. ubuntu-24.04)
--images LIST Comma-separated images or all
--list-images List available OS images
--from {local,git,pypi} Install source (same as run; default: local)
--branch BRANCH Git branch (with --from git; default: devel)
--with FEATURES Extra server features (repeatable or comma-separated)
-x, --fail-fast Stop on the first failing image
--continue-on-failure Don't stop on first failure (multi-distro)

Development

# Run tests
uv run pytest tests/ -v

# Lint and format
uv run ruff check src/
uv run ruff format src/

Documentation

Related Packages

License

Apache-2.0 - Copyright (c) 2024-2026, Abilian SAS

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

hop3_testing-0.7.1.tar.gz (182.2 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

hop3_testing-0.7.1-py3-none-any.whl (223.3 kB view details)

Uploaded Python 3

File details

Details for the file hop3_testing-0.7.1.tar.gz.

File metadata

  • Download URL: hop3_testing-0.7.1.tar.gz
  • Upload date:
  • Size: 182.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/7.0.0 CPython/3.14.2

File hashes

Hashes for hop3_testing-0.7.1.tar.gz
Algorithm Hash digest
SHA256 670470c8efb5f33028f6121d6311af713caf4600e547c16e90d62d5079d185be
MD5 14529afc63614fb6b6c895e8eb49fdc2
BLAKE2b-256 68158f8a785b1738d8ea751a9c78584989dc301a4542b66b6807e7ced34750a7

See more details on using hashes here.

File details

Details for the file hop3_testing-0.7.1-py3-none-any.whl.

File metadata

  • Download URL: hop3_testing-0.7.1-py3-none-any.whl
  • Upload date:
  • Size: 223.3 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/7.0.0 CPython/3.14.2

File hashes

Hashes for hop3_testing-0.7.1-py3-none-any.whl
Algorithm Hash digest
SHA256 c61654977ce6ef80798bd85c35b766e7964975a936e879630be4291b313a79b2
MD5 b8184e279e80aa2f180b78519719fb9e
BLAKE2b-256 79081a4381667f7fe06560a170035f5f61a400bd8cb7e385d58d18e31ede16b1

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page