From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from firstgate.proxmox.com (firstgate.proxmox.com [212.224.123.68]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits)) (No client certificate requested) by lists.proxmox.com (Postfix) with ESMTPS id 75ADC932F1 for ; Fri, 16 Sep 2022 10:35:04 +0200 (CEST) Received: from firstgate.proxmox.com (localhost [127.0.0.1]) by firstgate.proxmox.com (Proxmox) with ESMTP id 69B2A216FE for ; Fri, 16 Sep 2022 10:34:34 +0200 (CEST) Received: from proxmox-new.maurer-it.com (proxmox-new.maurer-it.com [94.136.29.106]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits)) (No client certificate requested) by firstgate.proxmox.com (Proxmox) with ESMTPS for ; Fri, 16 Sep 2022 10:34:33 +0200 (CEST) Received: from proxmox-new.maurer-it.com (localhost.localdomain [127.0.0.1]) by proxmox-new.maurer-it.com (Proxmox) with ESMTP id 9EFCD44474 for ; Fri, 16 Sep 2022 10:34:33 +0200 (CEST) Message-ID: <0db22740-013f-d1c6-2d82-47a2d853022f@proxmox.com> Date: Fri, 16 Sep 2022 10:34:32 +0200 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:105.0) Gecko/20100101 Thunderbird/105.0 Content-Language: en-GB To: Stefan Hanreich , Proxmox Backup Server development discussion References: <20220915140857.1041222-1-s.hanreich@proxmox.com> <6d281db9-90e8-9164-6979-4b73b04cc627@proxmox.com> <7ecef7a9-afda-f0fd-55d1-924d4819745b@proxmox.com> <5c890689-bd43-1057-6ecf-62c8e615a176@proxmox.com> <1d9bffa3-950b-360a-e472-8633fad2b49e@proxmox.com> From: Thomas Lamprecht In-Reply-To: <1d9bffa3-950b-360a-e472-8633fad2b49e@proxmox.com> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable X-SPAM-LEVEL: Spam detection results: 0 AWL 0.892 Adjusted score from AWL reputation of From: address BAYES_00 -1.9 Bayes spam probability is 0 to 1% KAM_DMARC_STATUS 0.01 Test Rule for DKIM or SPF Failure with Strict Alignment NICE_REPLY_A -1.816 Looks like a legit reply (A) SPF_HELO_NONE 0.001 SPF: HELO does not publish an SPF Record SPF_PASS -0.001 SPF: sender matches SPF record Subject: Re: [pbs-devel] [PATCH proxmox-backup] fix #4095: make http client read proxy config from envvars X-BeenThere: pbs-devel@lists.proxmox.com X-Mailman-Version: 2.1.29 Precedence: list List-Id: Proxmox Backup Server development discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 16 Sep 2022 08:35:04 -0000 Am 16/09/2022 um 10:17 schrieb Stefan Hanreich: > Yes, I was also not very happy with how I had to test it. If i really w= anted to test it properly I'd add tests to the ProxyConfig as well as the= HttpsConnector, but that seemed a bit out of scope for this patch series= ,=C2=A0which=C2=A0is=C2=A0why=C2=A0I=C2=A0resorted=C2=A0to=C2=A0this=C2=A0= (seemingly)=C2=A0basic=C2=A0test. >=20 > It=C2=A0was=C2=A0more=C2=A0of=C2=A0a=C2=A0basic=C2=A0sanity=C2=A0check=C2= =A0to=C2=A0see=C2=A0if=C2=A0I=C2=A0didn't=C2=A0break=C2=A0some=C2=A0stuff= =2E Sure, but test code should be near the thing actually tested. Note also t= hat if we would add https to ProxyConfig in the future it would fail a "dista= nt" crate in a bit confusing way (the "slightly confusing" part could probabl= y be avoided by checking either the actual error or a comment for why it's exp= ected to fail), all noticeable and thus fixable before rollout, so nothing _tha= t bad_, don't get me wrong, but it would Just Work=E2=84=A2 otherwise. I'm also a bit wondering how setting environment variables affects other = tests in general, iow. how isolated this all is. I'd not 100% sure if rust spawns = a separate process per test and also then it may be a bit cleaner to first get the c= urrent env variable one is modifying and restoring that value at the end of the test= =2E I don't think that would be an issue here, as we shouldn't rely on any connection= s at all, so more of a general wondering-thing. > Do you think it would make sense to create a separate patch series that= unit=C2=A0tests=C2=A0ProxyConfig=C2=A0with=C2=A0some=C2=A0(im)possible=C2= =A0proxy=C2=A0settings? The current ProxyConfig is 89 Lines with comments and generous extra line= s of rather straight forward code, so while a clear cut specific test defin= itively wouldn't be hurting, investing to much time in any would probably amount = to a rather mediocre ROI. With that in mind: your choice, if you send a somewh= at sensible one I'll definitively apply it.