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 5D9916A700 for ; Mon, 15 Mar 2021 10:31:11 +0100 (CET) Received: from firstgate.proxmox.com (localhost [127.0.0.1]) by firstgate.proxmox.com (Proxmox) with ESMTP id 4DB3E1E637 for ; Mon, 15 Mar 2021 10:30:41 +0100 (CET) Received: from proxmox-new.maurer-it.com (proxmox-new.maurer-it.com [212.186.127.180]) (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 id D36D91E62A for ; Mon, 15 Mar 2021 10:30:40 +0100 (CET) Received: from proxmox-new.maurer-it.com (localhost.localdomain [127.0.0.1]) by proxmox-new.maurer-it.com (Proxmox) with ESMTP id 9CB7142660 for ; Mon, 15 Mar 2021 10:30:40 +0100 (CET) Message-ID: Date: Mon, 15 Mar 2021 10:30:39 +0100 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:87.0) Gecko/20100101 Thunderbird/87.0 Content-Language: en-US From: Thomas Lamprecht To: Mira Limbeck , pmg-devel@lists.proxmox.com References: <20210219103147.28013-1-m.limbeck@proxmox.com> <261ad9c6-a149-f37b-a040-525bf4d37d4e@proxmox.com> <971b5023-4953-1ef4-2519-2f0069274e37@proxmox.com> <2fafa7ed-16b0-91e8-ec21-ae95a62cd637@proxmox.com> In-Reply-To: Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-SPAM-LEVEL: Spam detection results: 0 AWL -0.048 Adjusted score from AWL reputation of From: address KAM_DMARC_STATUS 0.01 Test Rule for DKIM or SPF Failure with Strict Alignment NICE_REPLY_A -0.001 Looks like a legit reply (A) 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 Subject: Re: [pmg-devel] [PATCH log-tracker 1/3] update tests X-BeenThere: pmg-devel@lists.proxmox.com X-Mailman-Version: 2.1.29 Precedence: list List-Id: Proxmox Mail Gateway development discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 15 Mar 2021 09:31:11 -0000 On 26.02.21 14:08, Thomas Lamprecht wrote: > On 26.02.21 13:52, Mira Limbeck wrote: >> On 2/26/21 10:22 AM, Mira Limbeck wrote: >>> On 2/25/21 11:56 AM, Thomas Lamprecht wrote: >>>> On 19.02.21 11:31, Mira Limbeck wrote: >>>>> As we only have month, day and time available but not the year, we have >>>>> to update the tests every year. >>>> I'm probably just missing context but why exactly is that the case? >>>> >>> The logs only contain month, day and time of the day which we parse. We do this based on the current date and timezone. >>> >>> So depending on the current date and the date in the logs, we either assume it to be in the past or in the future. This results in a different calculated CTIME then and the tests need to be updated accordingly. >> Correction, we always assume it to be in the past. But without the year info we assume it is no older than 1 year. This means when the test results we check against was created before that, the CTIME does not match anymore now. > > > Can't we just run the test under a fixed time? For common test harnesses which > run as specific commands one could use something like > any update on this? > faketime 2020-12-01 ./test-command > > in the respective make target. > > For cargo test based ones we could just add a wrapper helper around getting > the time and mock that in the #[cfg(not(test))] and #[cfg(test)], respectively.