From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from gate001.proxmox.com (gate001.proxmox.com [45.144.208.40]) by lore.proxmox.com (Postfix) with ESMTPS id B6DBF1FF0AD for ; Fri, 21 Aug 2026 11:57:33 +0200 (CEST) Received: from gate001.proxmox.com (localhost.localdomain [127.0.0.1]) by gate001.proxmox.com (Proxmox) with ESMTP id 73AB12158E; Fri, 21 Aug 2026 11:57:33 +0200 (CEST) Mime-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset=UTF-8 Date: Fri, 21 Aug 2026 11:57:30 +0200 Message-Id: Subject: Re: [PATCH datacenter-manager v2 14/20] tests: add helpers for building API-handler-level integration tests From: "Thomas Ellmenreich" To: "Lukas Wagner" , X-Mailer: aerc 0.20.0 References: <20260820145220.418032-1-l.wagner@proxmox.com> <20260820145220.418032-15-l.wagner@proxmox.com> In-Reply-To: <20260820145220.418032-15-l.wagner@proxmox.com> X-Bm-Milter-Handled: 55990f41-d878-4baa-be0a-ee34c49e34d2 X-Bm-Transport-Timestamp: 1787306224002 X-SPAM-LEVEL: Spam detection results: 0 AWL 0.713 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: NEG43OCJS4UE4P4OVQC5Q6AWBVDDO6PU X-Message-ID-Hash: NEG43OCJS4UE4P4OVQC5Q6AWBVDDO6PU X-MailFrom: t.ellmenreich@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: 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, pr= oxmox_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 i= t. This means you can probably also remove t= he import of `ClusterNodeIndexResponse` from your tests. > + 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::ClusterNodeIndexResponseS= tatus::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;