Skip to content

Add --compat-date flag and @all-compat-flags variant to wd_test#5773

Merged
danlapid merged 2 commits intomainfrom
dlapid/all-compat-flags-variant
Dec 29, 2025
Merged

Add --compat-date flag and @all-compat-flags variant to wd_test#5773
danlapid merged 2 commits intomainfrom
dlapid/all-compat-flags-variant

Conversation

@danlapid
Copy link
Copy Markdown
Collaborator

  • Add --compat-date flag and @all-compat-flags variant to wd_test

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.

  • Make all tests pass after adding all-compat-flags variant

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.

@danlapid danlapid requested review from a team as code owners December 25, 2025 15:43
@danlapid danlapid force-pushed the dlapid/all-compat-flags-variant branch from 550a7cd to 9abc558 Compare December 29, 2025 16:08
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.
@danlapid danlapid force-pushed the dlapid/all-compat-flags-variant branch from 9abc558 to 0531893 Compare December 29, 2025 16:19
@danlapid danlapid enabled auto-merge December 29, 2025 16:31
@danlapid danlapid merged commit 053d555 into main Dec 29, 2025
21 checks passed
@danlapid danlapid deleted the dlapid/all-compat-flags-variant branch December 29, 2025 16:38
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