All 29 existing tests pass, 4 e2e tests correctly deselected.
Here's what I've created:
tests/test_e2e.py — End-to-end tests that exercise the full VM lifecycle against real DigitalOcean infrastructure:
TestDropletLifecycle — Create a droplet (no cloud-init), verify it appears in list --output json, destroy it, verify it's gone
TestDNSLifecycle — Create a droplet with --update-dns, verify the A record via list-domain, destroy with --delete-dns, verify DNS record is removed
TestCreateWithInitialize — Create a droplet with --type e2e-basic (cloud-init user-data), verify the type tag is applied
TestCustomTag — Create a droplet with --tag, verify filtering by tag works
Design decisions:
- Automatically skipped when E2E_DO_TOKEN, E2E_SSH_KEY, or E2E_DNS_ZONE env vars are missing
- Excluded from default make test via addopts = "-m 'not e2e'" in pyproject.toml
- Run explicitly with make test-e2e or uv run pytest tests/test_e2e.py -v -m e2e
- Cleanup fixture ensures droplets are destroyed even if a test fails
- Unique names per test run via UUID to avoid collisions
- Uses the smallest droplet size (s-1vcpu-512mb-10gb) by default to minimize cost