Add --compat-date flag and @all-compat-flags variant to wd_test#5773
Merged
Add --compat-date flag and @all-compat-flags variant to wd_test#5773
Conversation
harrishancock
approved these changes
Dec 29, 2025
550a7cd to
9abc558
Compare
Add a --compat-date CLI flag to `workerd test` that overrides the compatibility date for all workers. When this flag is used, workers must NOT specify compatibilityDate in the config - this allows the test harness to control the compat date externally. The wd_test macro now generates three variants: - name@ (default): oldest compat date (2000-01-01) - name@all-compat-flags: newest compat date (2999-12-31) - name@all-autogates: all autogates + oldest compat date Tests can selectively disable variants using generate_default_variant, generate_all_compat_flags_variant, and generate_all_autogates_variant flags. Also adds test cases to verify the compat-flag variants work correctly by checking Cloudflare.compatibilityFlags.formdata_parser_supports_files is enabled/disabled based on the compat date.
First we bulk remove compat date from all tests. Then we add enable-flags to make the default variant pass. Then we add disable-flags to make the all-compat-flags variant pass. Python tests don't run all-compat-flags and all-autogates variants. I made them all pass under those variants and then disabled the variants. The impact on CI times is just way too high to justify the value sadly. We need to find a way to improve python test CI times and then reenable them.
9abc558 to
0531893
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Add a --compat-date CLI flag to
workerd testthat overrides thecompatibility date for all workers. When this flag is used, workers
must NOT specify compatibilityDate in the config - this allows the
test harness to control the compat date externally.
The wd_test macro now generates three variants:
Tests can selectively disable variants using generate_default_variant,
generate_all_compat_flags_variant, and generate_all_autogates_variant
flags.
Also adds test cases to verify the compat-flag variants work correctly
by checking Cloudflare.compatibilityFlags.formdata_parser_supports_files
is enabled/disabled based on the compat date.
First we bulk remove compat date from all tests.
Then we add enable-flags to make the default variant pass.
Then we add disable-flags to make the all-compat-flags variant pass.
Python tests don't run all-compat-flags and all-autogates variants.
I made them all pass under those variants and then disabled the variants.
The impact on CI times is just way too high to justify the value sadly.
We need to find a way to improve python test CI times and then reenable them.