Skip to content

Python tests: Use compat date matching the enable date of the Python version - #7219

Open
hoodmane wants to merge 2 commits into
mainfrom
hoodmane/python-test-compat-dates
Open

Python tests: Use compat date matching the enable date of the Python version#7219
hoodmane wants to merge 2 commits into
mainfrom
hoodmane/python-test-compat-dates

Conversation

@hoodmane

@hoodmane hoodmane commented Sep 2, 2026

Copy link
Copy Markdown
Contributor

The goal here is to increase the real-world relevance of the tests. Before this
change, we test the oldest compat date and the newest compat date if we run
these variants but we don't test compat dates from the range that are most
likely to be used with each Python variant. This makes it so that each Python
test passes the enable date of the Python version it uses as the compat date.

I added a no_default_compat_date option to wd_test to remove the
--compat-date=... argument because we get the compat dates directly from
compatibility-date.capnp which can't flow into starlark so we can't pass it as
the compat_date argument to wd_test. Instead, I template the dates into the
wd-test file.

I took the minimum of the date in maximum-compatibility-date.txt and the
enable date to deal with flags with future enable dates. I also added an extra
--allow-future-compatibility-date flag to workerd since it seems that
maximum-compatibility-date.txt can contain future dates which workerd normally
rejects.

Only quite minor changes were needed to the actual tests. I separated the
template changes into a different commit because they are noisy.

cc @fhanau

@hoodmane
hoodmane requested review from a team as code owners September 2, 2026 18:00
@ask-bonk

ask-bonk Bot commented Sep 2, 2026

Copy link
Copy Markdown
Contributor

LGTM

github run

@hoodmane
hoodmane force-pushed the hoodmane/python-test-compat-dates branch 2 times, most recently from a7b64a1 to 918939c Compare September 2, 2026 18:25
…version

The goal here is to increase the real-world relevance of the tests. Before this
change, we test the oldest compat date and the newest compat date if we run
these variants but we don't test compat dates from the range that are most
likely to be used with each Python variant. This makes it so that each Python
test passes the enable date of the Python version it uses as the compat date.

I added a `no_default_compat_date` option to wd_test to remove the
`--compat-date=...` argument because we get the compat dates directly from
compatibility-date.capnp which can't flow into starlark so we can't pass it as
the `compat_date` argument to `wd_test`. Instead, I template the dates into the
wd-test file.

I took the minimum of the date in `maximum-compatibility-date.txt` and the
enable date to deal with flags with future enable dates. I also added an extra
`--allow-future-compatibility-date` flag to workerd since it seems that
`maximum-compatibility-date.txt` can contain future dates which workerd normally
rejects.

Only quite minor changes were needed to the actual tests. I separated the
template changes into a different commit because they are noisy.
This is pretty noisy so I separated it into its own commit.
@hoodmane
hoodmane force-pushed the hoodmane/python-test-compat-dates branch from 918939c to 1e1562b Compare September 2, 2026 19:23
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.

1 participant