Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

py_ew_test: Add skip_flags argument #3369

Merged
merged 1 commit into from
Jan 20, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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]
anonrig marked this conversation as resolved.
Show resolved Hide resolved
if data == None and directory != None:
data = native.glob(
[
Expand Down
Loading