From: Thomas Lamprecht <t.lamprecht@proxmox.com>
To: Mira Limbeck <m.limbeck@proxmox.com>, pmg-devel@lists.proxmox.com
Subject: Re: [pmg-devel] [PATCH log-tracker 1/3] update tests
Date: Fri, 26 Feb 2021 14:08:56 +0100 [thread overview]
Message-ID: <c433083e-9a4f-04de-6eed-1cf3f1127abf@proxmox.com> (raw)
In-Reply-To: <2fafa7ed-16b0-91e8-ec21-ae95a62cd637@proxmox.com>
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
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.
next prev parent reply other threads:[~2021-02-26 13:09 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-02-19 10:31 Mira Limbeck
2021-02-19 10:31 ` [pmg-devel] [PATCH log-tracker 2/3] after-queue: fix wrong DStatus if relay is 'removed' before 'lmtp' line Mira Limbeck
2021-02-19 10:31 ` [pmg-devel] [PATCH log-tracker 3/3] add test case for relay removed before lmtp Mira Limbeck
2021-03-22 13:07 ` Mira Limbeck
2021-02-25 10:56 ` [pmg-devel] [PATCH log-tracker 1/3] update tests Thomas Lamprecht
2021-02-26 9:22 ` Mira Limbeck
2021-02-26 12:52 ` Mira Limbeck
2021-02-26 13:08 ` Thomas Lamprecht [this message]
2021-03-15 9:30 ` Thomas Lamprecht
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=c433083e-9a4f-04de-6eed-1cf3f1127abf@proxmox.com \
--to=t.lamprecht@proxmox.com \
--cc=m.limbeck@proxmox.com \
--cc=pmg-devel@lists.proxmox.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox