Repository navigation
test(scaling): hold the Proxmox and SSH fakes to the real APIs - #659
Merged
Merged
Conversation
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
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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, intotests/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 realsh, and the tests also prove that another key is refused and a changed host key is caught.How:
tests/openapi_contract.pylearns 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-insshextra, 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
!in the title)Checklist:
test_scaling_proxmox.pywith the newtest_lens_reads_only_fields_proxmox_answers_with,test_scaling_ssh.py).docs/scaling.mdtesting paragraph,docs/requirements.mdProxmox row).Done questions (AGENTS.md)
sshextra.Generated by Claude Code