Skip to content

Commit 40a9903

Browse files
committed
Reduce Python test time
By not making snapshots for tests that don't need them
1 parent 84871c7 commit 40a9903

File tree

1 file changed

+32
-34
lines changed

1 file changed

+32
-34
lines changed

src/workerd/server/tests/python/BUILD.bazel

Lines changed: 32 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -5,33 +5,41 @@ python_test_setup()
55

66
# Each test takes a while to start up, so if possible add additional tests to many-tests or sdk or
77
# some other existing test.
8-
py_wd_test("hello")
9-
10-
py_wd_test("many-tests")
11-
12-
py_wd_test("env-param")
13-
14-
py_wd_test("asgi")
15-
16-
py_wd_test("asgi-sse")
17-
18-
py_wd_test("random")
19-
20-
py_wd_test("subdirectory")
21-
22-
py_wd_test("sdk")
8+
[py_wd_test(directory) for directory in [
9+
"hello",
10+
"top-level-env",
11+
"asgi",
12+
"asgi-sse",
13+
"random",
14+
"sdk",
15+
"python-rpc",
16+
"workflow-entrypoint",
17+
"worker-entrypoint",
18+
"durable-object",
19+
]]
20+
21+
# These tests all work fine without make_snapshot=False
22+
# but it saves some time and does not lose any coverage.
23+
[py_wd_test(
24+
directory,
25+
make_snapshot = False,
26+
) for directory in [
27+
"env-param",
28+
"subdirectory",
29+
"undefined-handler",
30+
"vendor_dir",
31+
"vendor_dir_compat_flag",
32+
"filter-non-py-files",
33+
"default-class-with-legacy-global-handlers",
34+
]]
2335

2436
gen_rust_import_tests()
2537

26-
py_wd_test("undefined-handler")
27-
28-
py_wd_test("vendor_dir")
29-
30-
py_wd_test("dont-snapshot-pyodide")
31-
32-
py_wd_test("filter-non-py-files")
33-
34-
py_wd_test("durable-object")
38+
py_wd_test(
39+
"dont-snapshot-pyodide",
40+
# Passes on newer Python versions but it tests a 0.26.0a2-specific behavior.
41+
python_flags = ["0.26.0a2"],
42+
)
3543

3644
py_wd_test(
3745
"durable-object-websocket",
@@ -40,21 +48,11 @@ py_wd_test(
4048
use_snapshot = None,
4149
)
4250

43-
py_wd_test("worker-entrypoint")
44-
4551
py_wd_test(
4652
"jspi",
4753
skip_python_flags = ["0.26.0a2"],
4854
)
4955

50-
py_wd_test("python-rpc")
51-
52-
py_wd_test("workflow-entrypoint")
53-
54-
py_wd_test("vendor_dir_compat_flag")
55-
56-
py_wd_test("default-class-with-legacy-global-handlers")
57-
5856
py_wd_test(
5957
"fastapi",
6058
make_snapshot = False,

0 commit comments

Comments
 (0)