diff --git a/src/workerd/server/tests/python/BUILD.bazel b/src/workerd/server/tests/python/BUILD.bazel index cf0aad224b2..0df293cc141 100644 --- a/src/workerd/server/tests/python/BUILD.bazel +++ b/src/workerd/server/tests/python/BUILD.bazel @@ -15,25 +15,13 @@ copy_file( ) py_wd_test( - src = "hello/hello.wd-test", + "hello", args = ["--experimental"], - data = glob( - [ - "hello/*", - ], - exclude = ["**/*.wd-test"], - ), ) py_wd_test( - src = "sdk/sdk.wd-test", + "sdk", args = ["--experimental"], - data = glob( - [ - "sdk/*", - ], - exclude = ["**/*.wd-test"], - ), tags = [ # TODO(someday): Fix asan failure for this, see https://github.com/cloudflare/workerd/pull/3140#discussion_r1858273318 "no-asan", @@ -41,47 +29,23 @@ py_wd_test( ) py_wd_test( - src = "env-param/env.wd-test", + "env-param", args = ["--experimental"], - data = glob( - [ - "env-param/*", - ], - exclude = ["**/*.wd-test"], - ), ) py_wd_test( - src = "asgi/asgi.wd-test", + "asgi", args = ["--experimental"], - data = glob( - [ - "asgi/*", - ], - exclude = ["**/*.wd-test"], - ), ) py_wd_test( - src = "random/random.wd-test", + "random", args = ["--experimental"], - data = glob( - [ - "random/*", - ], - exclude = ["**/*.wd-test"], - ), ) py_wd_test( - src = "subdirectory/subdirectory.wd-test", + "subdirectory", args = ["--experimental"], - data = glob( - [ - "subdirectory/**", - ], - exclude = ["**/*.wd-test"], - ), ) -gen_import_tests(PYODIDE_IMPORTS_TO_TEST) +# gen_import_tests(PYODIDE_IMPORTS_TO_TEST) diff --git a/src/workerd/server/tests/python/py_wd_test.bzl b/src/workerd/server/tests/python/py_wd_test.bzl index 0621dfac6ef..e5082e73ddf 100644 --- a/src/workerd/server/tests/python/py_wd_test.bzl +++ b/src/workerd/server/tests/python/py_wd_test.bzl @@ -1,13 +1,25 @@ load("//:build/wd_test.bzl", "wd_test") def py_wd_test( - src, - data = [], + directory = None, + src = None, + data = None, name = None, args = [], size = "enormous", tags = [], **kwargs): + if data == None: + data = native.glob( + [ + directory + "/**", + ], + exclude = ["**/*.wd-test"], + ) + if src == None: + src = native.glob([directory + "/*.wd-test"])[0] + if name == None and directory != None: + name = directory + "@" data += ["//src/workerd/server/tests/python:pyodide_dev.capnp.bin@rule"] args = args + ["--pyodide-bundle-disk-cache-dir", "$(location //src/workerd/server/tests/python:pyodide_dev.capnp.bin@rule)/..", "--experimental"]