8000 test(scaling): hold the Proxmox and SSH fakes to the real APIs by adeelahmad · Pull Request #659 · adeelahmad/lense · GitHub
[go: up one dir, main page]

Skip to content

test(scaling): hold the Proxmox and SSH fakes to the real APIs - #659

Merged
adeelahmad merged 3 commits into
mainfrom
claude/project-thread-azm2mb
Oct 19, 2026
Merged

adeelahmad merged 3 commits into
mainfrom
claude/project-thread-azm2mb

Conversation

@adeelahmad
Copy link
Copy Markdown
Owner

Description

Before: the Proxmox VE fake answered whatever its author thought Proxmox would, and the SSH driver's tests stood a function in for SSH, so neither would catch a request the real thing refuses.

After: every request the Proxmox driver sends is checked against Proxmox's own API schema (converted from its API viewer, apidoc.js, into tests/data/openapi/proxmox-ve.json), and the fake's answers are built from that schema, so a parameter Proxmox doesn't take or a field it doesn't return fails the test. The SSH tests now run against a real SSH server on 127.0.0.1 (Paramiko's server side): it checks the client's public key, runs the driver's commands in a real sh, and the tests also prove that another key is refused and a changed host key is caught.

How: tests/openapi_contract.py learns form-encoded bodies (Proxmox's POST and PUT) with values coerced by the schema's types, and allows an empty body when nothing is required. Paramiko joins the dev group (it is already the opt-in ssh extra, so nothing ships that didn't).

Motivation and Context

Adeel asked for fakes faithful to the real APIs ("fake or mock the exact apis"). Proxmox and SSH were the last two providers without one.

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change; ! in the title)
  • Tests only

Checklist:

  • The title is a Conventional Commit.
  • My code follows the code style of this project (ruff check and format).
  • I added or updated tests (test_scaling_proxmox.py with the new test_lens_reads_only_fields_proxmox_answers_with, test_scaling_ssh.py).
  • Documentation updated (docs/scaling.md testing paragraph, docs/requirements.md Proxmox row).
  • Changelog fragment: n/a, tests only.

Done questions (AGENTS.md)

  • Goal: merges on green CI.
  • Agents: n/a, tests only.
  • Zero setup: n/a, nothing changes for an install.
  • Fewest clicks: n/a.
  • Configurable: n/a.
  • Light: n/a; Paramiko is a dev dependency here and stays an opt-in extra at runtime.
  • Private and secure: n/a, no new surface; the SSH tests now prove key refusal and host-key change against a real server.
  • Cost: n/a.
  • User decides: n/a.
  • Upgrades: n/a.
  • Honest: docs say what the fakes are held to.
  • Tested and documented.
  • Open: Proxmox's schema is its published API document; Paramiko (LGPL-2.1) is dev-only and already the opt-in ssh extra.
  • Reported in the thread.
  • Reuse: the existing OpenAPI contract helper and Paramiko, which the driver already uses.

Generated by Claude Code

Uh oh!

There was an error while loading. Please reload this page.

The Proxmox VE stand-in now takes only requests Proxmox's published API
schema allows and answers with what it describes; the schema is converted
from Proxmox's API viewer into tests/data/openapi/proxmox-ve.json, and the
contract helper reads form bodies by the types the schema gives.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01ALjNbLobvPe7VwvDL8j7V3
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01ALjNbLobvPe7VwvDL8j7V3
…t key doesn't stop the host

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01ALjNbLobvPe7VwvDL8j7V3
@adeelahmad
adeelahmad merged commit 9f07d8e into main Oct 19, 2026
22 checks passed
@adeelahmad
adeelahmad deleted the claude/project-thread-azm2mb branch October 19, 2026 03:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants

0