From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from gate001.proxmox.com (gate001.proxmox.com [IPv6:2a0f:8001:1:32::40]) by lore.proxmox.com (Postfix) with ESMTPS id D5DD91FF0AA for ; Fri, 21 Aug 2026 14:25:18 +0200 (CEST) Received: from gate001.proxmox.com (localhost.localdomain [127.0.0.1]) by gate001.proxmox.com (Proxmox) with ESMTP id 2A4102157B; Fri, 21 Aug 2026 14:25:18 +0200 (CEST) Mime-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset=UTF-8 Date: Fri, 21 Aug 2026 14:25:13 +0200 Message-Id: Subject: Re: [PATCH datacenter-manager v2 14/20] tests: add helpers for building API-handler-level integration tests From: "Lukas Wagner" To: "Thomas Ellmenreich" , "Lukas Wagner" , X-Mailer: aerc 0.21.0-0-g5549850facc2-dirty References: <20260820145220.418032-1-l.wagner@proxmox.com> <20260820145220.418032-15-l.wagner@proxmox.com> In-Reply-To: X-Bm-Milter-Handled: 55990f41-d878-4baa-be0a-ee34c49e34d2 X-Bm-Transport-Timestamp: 1787315086742 X-SPAM-LEVEL: Spam detection results: 0 AWL 0.688 Adjusted score from AWL reputation of From: address DMARC_MISSING 0.1 Missing DMARC policy KAM_DMARC_STATUS 0.01 Test Rule for DKIM or SPF Failure with Strict Alignment (newer systems) RCVD_IN_DNSWL_MED -2.3 Sender listed at https://www.dnswl.org/, medium trust SPF_HELO_NONE 0.001 SPF: HELO does not publish an SPF Record SPF_PASS -0.001 SPF: sender matches SPF record Message-ID-Hash: NILCR7JSYL3TPSAUAKBUCGXMS2IMH3CA X-Message-ID-Hash: NILCR7JSYL3TPSAUAKBUCGXMS2IMH3CA X-MailFrom: l.wagner@proxmox.com X-Mailman-Rule-Misses: dmarc-mitigation; no-senders; approved; loop; banned-address; emergency; member-moderation; nonmember-moderation; administrivia; implicit-dest; max-recipients; max-size; news-moderation; no-subject; digests; suspicious-header X-Mailman-Version: 3.3.10 Precedence: list List-Id: Proxmox Datacenter Manager development discussion List-Help: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: On Fri Aug 21, 2026 at 11:57 AM CEST, Thomas Ellmenreich wrote: > I tried to set up a quick tests just to see how everything worked and it > looks good, only noticed on thing. > > On Thu Aug 20, 2026 at 4:52 PM CEST, Lukas Wagner wrote: > > [snip] > >> +macro_rules! test_pve_client { >> + ($ty:ident { $($overrides:tt)* }) =3D> { >> + >> + pub struct $ty(crate::common::PveTestRemote); >> + >> + #[async_trait::async_trait] >> + impl pve_api_types::client::PveClient for $ty { >> + async fn list_nodes( >> + &self, >> + ) -> Result, p= roxmox_client::Error> { >> + let mut nodes =3D Vec::new(); >> + >> + for i in 0..self.0.nodes { >> + nodes.push(ClusterNodeIndexResponse { > ^ > Here, you forgot to add `pve_api_types:= :`, > forcing the user of the macro to import= it. > This means you can probably also remove= the > import of `ClusterNodeIndexResponse` fr= om > your tests. Good catch, thanks! > >> + cpu: Some(0.0), >> + level: None, >> + maxcpu: Some(4), >> + maxmem: Some(4096), >> + mem: Some(1000), >> + node: format!("{}-node-{i}", self.0.name), >> + ssl_fingerprint: None, >> + status: pve_api_types::ClusterNodeIndexResponse= Status::Online, >> + uptime: Some(1000), >> + }); >> + } >> + >> + Ok(nodes) >> + } >> + $($overrides)* >> + } >> + >> + impl $ty { >> + /// Name of the remote this client was created for. >> + pub fn remote(&self) -> &str { >> + &self.0.name >> + } >> + >> + /// Shared state of the remote this client was created for. >> + pub fn state(&self) -> crate::common::TestRemoteState { >> + self.0.state.clone() >> + } >> + } >> + }; >> +} >> + >> +pub(crate) use test_pve_client;