-
Notifications
You must be signed in to change notification settings - Fork 590
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Use reproducible timestamps in more doc examples #2626
Conversation
This adds require("_date") to some example tests that use the current date via os.date. This allows reproducibility by replacing os.date() with a function that uses a static date from $SOURCE_DATE_EPOCH. See commit 9d7eaf0 for more details. Signed-off-by: Uli Schlachter <psychon@znc.in>
Codecov Report
@@ Coverage Diff @@
## master #2626 +/- ##
==========================================
- Coverage 85.23% 85.23% -0.01%
==========================================
Files 516 516
Lines 34845 34848 +3
==========================================
+ Hits 29701 29702 +1
- Misses 5144 5146 +2
|
@@ -1,6 +1,7 @@ | |||
--DOC_GEN_IMAGE | |||
--DOC_HIDE_ALL | |||
--DOC_NO_USAGE | |||
require("_date") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
--DOC_HIDE
is not required in this case?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hm, because of DOC_HIDE_ALL
above?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yup.
The test examples are primarily meant to generate images for the docs. For this, @DOC_awful_popup_wiboxtypes_EXAMPLE@
is replaced with something. By default, that's all the code used to generate the example and then the example image (or text, in some cases) itself. With --DOC_HIDE
we can "hide some hacks" and --DOC_HIDE_ALL
is used for cases where we only want the image (e.g. some overview of all the widgets).
With this patch and the one from #2622 applied, the date/time variations are fixed in my test setup. |
There was also a difference in AUTOGEN_awful_widget_layoutlist_bar.svg that didn't look time-related. |
@reinerh Thanks for testing!
Was it something like this? awesomeWM/apidoc@ab926e9#diff-1c97ba2002b724e67f79d5225c015ce3 It seems that the IDs that cairo generates in the SVG have a random offset...? In the end, the IDs that cairo uses some from here: https://gitlab.com/cairo/cairo/blob/ef8c379e0f560ced63c2a07566a3a7d608e3996c/src/cairo-surface.c#L264-285 |
@Elv13 Mergify got broken by the Travis switch. The pull request status says |
@psychon |
@psychon |
Oh, it needs to be updated here: https://github.com/blueyed/awesome/blob/81a0a8cc48654f3670c377e11ce8ee07366c0de5/.mergify.yml#L6-L7 (will do, and also remove Codacy for now). |
Yes, something like that. Now also visible in the reproducible-builds CI. |
This adds require("_date") to some example tests that use the current date via os.date. This allows reproducibility by replacing os.date() with a function that uses a static date from $SOURCE_DATE_EPOCH. See commit 9d7eaf0 for more details. Signed-off-by: Uli Schlachter <psychon@znc.in>
This adds require("_date") to some example tests that use the current date via os.date. This allows reproducibility by replacing os.date() with a function that uses a static date from $SOURCE_DATE_EPOCH. See commit 9d7eaf0 for more details. Signed-off-by: Uli Schlachter <psychon@znc.in>
This adds require("_date") to some example tests that use the current
date via os.date. This allows reproducibility by replacing os.date()
with a function that uses a static date from $SOURCE_DATE_EPOCH. See
commit 9d7eaf0 for more details.
Signed-off-by: Uli Schlachter psychon@znc.in
CC @reinerh Thanks for pointing out that this is indeed needed.