Skip to content

use different timezones to run CI tests #1259

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

Open
wants to merge 4 commits into
base: master
Choose a base branch
from

Conversation

gutsytechster
Copy link
Collaborator

@gutsytechster gutsytechster commented Mar 17, 2025

The test fails when it runs at midnight or, in general, when a time difference causes changes in dates for UTC and non-UTC time zones.

Some tests expect the local timezone to be picked resulting in a different expectation than the actual result. The result of the search_dates method picks UTC when nothing is provided in the absence of date & time.

Additionally, I reckon the issue was introduced in #1111, where datetime.datetime.utcnow().month was replaced with datetime.datetime.today().month.

Copy link

codecov bot commented Mar 17, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 98.14%. Comparing base (02bd2e5) to head (30c4bd3).

Additional details and impacted files
@@           Coverage Diff           @@
##           master    #1259   +/-   ##
=======================================
  Coverage   98.14%   98.14%           
=======================================
  Files         234      234           
  Lines        2748     2748           
=======================================
  Hits         2697     2697           
  Misses         51       51           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@gutsytechster gutsytechster force-pushed the dateparser-fix-CI-tests branch 2 times, most recently from a10e9fd to 13b563b Compare March 17, 2025 20:03
@gutsytechster gutsytechster reopened this Mar 17, 2025
@gutsytechster gutsytechster force-pushed the dateparser-fix-CI-tests branch from 13b563b to c2fc6ef Compare March 17, 2025 20:06
@gutsytechster gutsytechster force-pushed the dateparser-fix-CI-tests branch from c2fc6ef to 57e09d6 Compare March 17, 2025 20:12
The search_dates default behavior is to use UTC timezone when no overridden
setting is provided, hence the test must define the expectations in UTC
timezone.
@gutsytechster gutsytechster force-pushed the dateparser-fix-CI-tests branch from 25af3fb to 30c4bd3 Compare March 17, 2025 20:45
Copy link
Member

@Gallaecio Gallaecio left a comment

Choose a reason for hiding this comment

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

Nice! Maybe a single TZ job would be enough, but 🤷

@gutsytechster
Copy link
Collaborator Author

@Gallaecio yeah. The only difference between the two is that one observes DST while the other doesn't. So I kept both of them.

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.

2 participants