Use UTC in update_version_file_test, rake task #3066
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
I noticed when setting up my development environment, some tests in the
update_versions_file_test.rb
are failing, specifically because this time comparison isn't working as expected. It turns out thatts
(which is passed from the rake task tocompact_index_public_versions
as theupdated_at
value) is in my home timezone but everything else is UTC:See below:
Explicitly setting UTC for both the rake task and also the
created_at
time in the test that calls the rake task meant the tests passed happily!There's a great chance I'm missing something so please let me know if this isn't necessary but I figured it might be better to be explicit about the timezone anyway.