Fix test generation for data updates #1059
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.
This fixes a few things that were bugging me about the release process.
zdump
output and test generation code was all written for an old 32-bit version ofzdump
. But the newer 64-bit versions have different flags and output. This resulted in an overly-verbose output format, and accidentally skipping the first and last transitions when generating unit tests. (Or in the case of fixed-offset zones, generating no tests at all.)zic
andzdump
in macOS are horrendously old and only support 32-bit data. I've been manually compiling the binaries from tzdb instead, then temporarily changingdata-zic.js
anddata-zdump.js
to reference the custom versions.countries
unit tests weren't auto-generated, so we have to keep manually tweaking them when data changes during a release. This is error-prone and inconsistent (e.g. it turns out some new zones were missing from the test file).So after a fair amount of comparing the output of
zdump
on various machines, this PR does the following:zic
andzdump
binaries by passing--zic-path=/path/to/zic
and--zdump-path=/path/to/zdump
arguments to thegrunt data
tasks.zic
orzdump
doesn't support 64-bit data, and switch between the-V
and-v
flags depending on what's supported.zdump
output validation and comments.zone.countries()
andtz.zonesForCountry()
.