Skip to content

fix: disable tests broken by daylight savings #10414

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

Merged

Conversation

spikecurtis
Copy link
Contributor

Timezone tests hard-code the offset, which is now different due to daylight savings

Copy link
Contributor Author

Current dependencies on/for this PR:

This comment was auto-generated by Graphite.

Copy link

@cdr-bot cdr-bot bot left a comment

Choose a reason for hiding this comment

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

This PR is a hotfix and has been automatically approved.

  • ✅ Base is main
  • ✅ Has hotfix label
  • ✅ Head is from coder/coder
  • ✅ Less than 100 lines

@spikecurtis spikecurtis enabled auto-merge (squash) October 30, 2023 06:39
@spikecurtis spikecurtis merged commit c2e3648 into main Oct 30, 2023
@spikecurtis spikecurtis deleted the 10-30-fix_disable_tests_broken_by_daylight_savings branch October 30, 2023 06:44
@github-actions github-actions bot locked and limited conversation to collaborators Oct 30, 2023
@Emyrk
Copy link
Member

Emyrk commented Oct 30, 2023

Oof. So either need to find locations without daylight savings or detect it and change the test accordingly?

@spikecurtis
Copy link
Contributor Author

Oof. So either need to find locations without daylight savings or detect it and change the test accordingly?

The other thought I had is to make that function also take the time.Time, which would be time.Now() in production, but could be a known time with a known offset in tests.

Anyway, what real value are we getting by asserting particular US/Ireland location offsets? Could also just replace those commented out test cases with Abu Dhabi and call it a day.

@Emyrk
Copy link
Member

Emyrk commented Oct 30, 2023

Yea, I started the refactor to pass in a time, I also uses time.Time.IsDST() to adjust the test to allow DST to pass.

In the end though, the refactor to pass in a time kinda makes the function api a little strange since the time.Time has a .Location(), and you also pass in a time.Location?

In the end this is for insights to make sure the data is relative to the user's local timezone, and the buckets are daily. So I stopped spending time on getting the tests to be "perfect". 🤷

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants