Skip to content
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

Switch the TZ to UTC temporarily for running the News tests #2121

Merged
merged 3 commits into from
Apr 26, 2023

Conversation

tchaudhry91
Copy link
Contributor

Hi,
I was beginning work on another issue, when I discovered that make test was failing on my system.

--- FAIL: TestPrintNewsFeed (0.03s)
    --- FAIL: TestPrintNewsFeed/all-verbose (0.01s)
        news_test.go:143: snapshot not equal:
            --- Previous
            +++ Current
            @@ -11,3 +11,3 @@
             
            -2020-01-04 Now using Zstandard instead of xz for package compression
            +2020-01-05 Now using Zstandard instead of xz for package compression
             As announced on the mailing list, on Friday, Dec 27 2019, our package compression scheme has changed from xz (.pkg.tar.xz) to zstd (.pkg.tar.zst).
            @@ -23,3 +23,3 @@
             
            -2020-01-15 rsync compatibility
            +2020-01-16 rsync compatibility
             Our rsync package was shipped with bundled zlib to provide compatibility
            @@ -36,3 +36,3 @@
             
            -2020-02-22 Planet Arch Linux migration
            +2020-02-23 Planet Arch Linux migration
             The software behind planet.archlinux.org was implemented in Python 2 and is no longer maintained upstream. This functionality has now been implemented in archlinux.org's archweb backend which is actively maintained but offers a slightly different experience.
            
    --- FAIL: TestPrintNewsFeed/all-quiet (0.01s)
        news_test.go:143: snapshot not equal:
            --- Previous
            +++ Current
            @@ -1,6 +1,6 @@
             2019-12-20 Xorg cleanup requires manual intervention
            -2020-01-04 Now using Zstandard instead of xz for package compression
            -2020-01-15 rsync compatibility
            +2020-01-05 Now using Zstandard instead of xz for package compression
            +2020-01-16 rsync compatibility
             2020-02-17 sshd needs restarting after upgrading to openssh-8.2p1
            -2020-02-22 Planet Arch Linux migration
            +2020-02-23 Planet Arch Linux migration
             2020-02-24 The Future of the Arch Linux Project Leader
            
FAIL

The issue is that my local TZ is IST. Thereby causing the date mismatch (off by 1) in the snapshot for items that roll-over into the next date.
This fix makes the tests pass and I think that the actual functioning of yay is not impacted by the TZ as such. But probably something for someone more experienced in the system to check.

@tchaudhry91 tchaudhry91 requested a review from Jguer as a code owner April 17, 2023 06:05
pkg/news/news_test.go Outdated Show resolved Hide resolved
pkg/news/news_test.go Outdated Show resolved Hide resolved
Co-authored-by: Jo <me@jguer.space>
Copy link
Owner

@Jguer Jguer left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the PR 😄

@Jguer Jguer merged commit 15400c5 into Jguer:next Apr 26, 2023
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants