Skip to content

Commit

Permalink
py_ew_test: Add skip_flags argument (#3369)
Browse files Browse the repository at this point in the history
This allows us to say which combinations don't work, which is more
explicit than saying which ones do work.

Release note: None
  • Loading branch information
hoodmane authored Jan 20, 2025
1 parent 1487334 commit dd63afd
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 13 deletions.
17 changes: 6 additions & 11 deletions src/workerd/server/tests/python/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,7 @@ py_wd_test("env-param")

py_wd_test(
"asgi",
# TODO: update bundle to include asgi fix and test on 0.26.0a2
python_flags = ["development"],
skip_python_flags = ["0.27.1"],
)

py_wd_test("random")
Expand All @@ -39,22 +38,18 @@ py_wd_test(
gen_import_tests(
PYODIDE_IMPORTS_TO_TEST,
# TODO: Micropip version mismatch for 0.27.0
pkg_python_versions = {
pkg_skip_versions = {
"micropip": [
"0.26.0a2",
"development",
"0.27.1",
],
"langchain-core": [
"0.26.0a2",
"development",
"0.27.1",
],
"langchain_openai": [
"0.26.0a2",
"development",
"0.27.1",
],
"langsmith": [
"0.26.0a2",
"development",
"0.27.1",
],
},
)
4 changes: 2 additions & 2 deletions src/workerd/server/tests/python/import_tests.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ def generate_wd_test_file(requirement):
return WD_FILE_TEMPLATE.format(requirement, requirement)

# to_test is a dictionary from library name to list of imports
def gen_import_tests(to_test, pkg_python_versions = {}):
def gen_import_tests(to_test, pkg_skip_versions = {}):
for lib in to_test.keys():
prefix = "import/" + lib
worker_py_fname = prefix + "/worker.py"
Expand All @@ -52,7 +52,7 @@ def gen_import_tests(to_test, pkg_python_versions = {}):
name = prefix,
directory = lib,
src = wd_test_fname,
python_flags = pkg_python_versions.get(lib, "all"),
skip_python_flags = pkg_skip_versions.get(lib, []),
args = ["--experimental", "--pyodide-package-disk-cache-dir", "../all_pyodide_wheels"],
data = [worker_py_fname, "@all_pyodide_wheels//:whls"],
size = "enormous",
Expand Down
2 changes: 2 additions & 0 deletions src/workerd/server/tests/python/py_wd_test.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -13,12 +13,14 @@ def py_wd_test(
data = None,
name = None,
python_flags = "all",
skip_python_flags = [],
args = [],
size = "enormous",
tags = [],
**kwargs):
if python_flags == "all":
python_flags = FEATURE_FLAGS.keys()
python_flags = [flag for flag in python_flags if flag not in skip_python_flags]
if data == None and directory != None:
data = native.glob(
[
Expand Down

0 comments on commit dd63afd

Please sign in to comment.