Skip to content

Commit

Permalink
[nfc] lower test timeouts
Browse files Browse the repository at this point in the history
  • Loading branch information
mikea committed Aug 21, 2024
1 parent 2c4fea3 commit b619cb0
Show file tree
Hide file tree
Showing 8 changed files with 134 additions and 12 deletions.
10 changes: 8 additions & 2 deletions .bazelrc
Original file line number Diff line number Diff line change
@@ -1,7 +1,13 @@
common --enable_platform_specific_config
build --verbose_failures
build --build_tag_filters=-off-by-default,-slow
test --test_tag_filters=-off-by-default,-slow
build --build_tag_filters=-off-by-default
test --test_tag_filters=-off-by-default
# exclude enormous tests by default
build --test_size_filters=-enormous

# use lower test timeouts: https://bazel.build/reference/test-encyclopedia#role-test-runner
# corresponds to small,medium,large,enormous tests (medium is default)
build --test_timeout=1,15,60,240

# Not using bzlmod for dependencies yet
common --noenable_bzlmod
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,7 @@ jobs:
run: |
cat <<EOF >> .bazelrc
build --build_tag_filters=-off-by-default
test --test_tag_filters=-off-by-default
test --test_tag_filters=-off-by-default --test_size_filters=small,medium,large,enormous
EOF
- name: Generate list of excluded Bazel targets
# Exclude large benchmarking binaries created in debug and asan configurations to avoid
Expand Down
1 change: 1 addition & 0 deletions src/cloudflare/internal/test/ai/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ wd_test(
)

wd_test(
size = "large",
src = "python-ai-api-test.wd-test",
args = ["--experimental"],
data = glob([
Expand Down
1 change: 1 addition & 0 deletions src/cloudflare/internal/test/d1/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ wd_test(
)

wd_test(
size = "large",
src = "python-d1-api-test.wd-test",
args = ["--experimental"],
data = glob([
Expand Down
1 change: 1 addition & 0 deletions src/cloudflare/internal/test/vectorize/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ wd_test(
)

wd_test(
size = "large",
src = "python-vectorize-api-test.wd-test",
data = glob([
"*.py",
Expand Down
126 changes: 120 additions & 6 deletions src/workerd/api/node/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -26,10 +26,124 @@ kj_test(
deps = ["//src/workerd/tests:test-fixture"],
)

[wd_test(
src = f,
wd_test(
src = "tests/assert-test.wd-test",
args = ["--experimental"],
data = [f.removesuffix(".wd-test") + ".js"],
) for f in glob(
["**/*.wd-test"],
)]
data = ["tests/assert-test.js"],
)

wd_test(
size = "large",
src = "tests/buffer-nodejs-test.wd-test",
args = ["--experimental"],
data = ["tests/buffer-nodejs-test.js"],
)

wd_test(
src = "tests/crypto_dh-test.wd-test",
args = ["--experimental"],
data = ["tests/crypto_dh-test.js"],
)

wd_test(
src = "tests/crypto_hash-test.wd-test",
args = ["--experimental"],
data = ["tests/crypto_hash-test.js"],
)

wd_test(
src = "tests/crypto_hkdf-test.wd-test",
args = ["--experimental"],
data = ["tests/crypto_hkdf-test.js"],
)

wd_test(
src = "tests/crypto_hmac-test.wd-test",
args = ["--experimental"],
data = ["tests/crypto_hmac-test.js"],
)

wd_test(
src = "tests/crypto_keys-test.wd-test",
args = ["--experimental"],
data = ["tests/crypto_keys-test.js"],
)

wd_test(
src = "tests/crypto_pbkdf2-test.wd-test",
args = ["--experimental"],
data = ["tests/crypto_pbkdf2-test.js"],
)

wd_test(
src = "tests/crypto_random-test.wd-test",
args = ["--experimental"],
data = ["tests/crypto_random-test.js"],
)

wd_test(
src = "tests/crypto_scrypt-test.wd-test",
args = ["--experimental"],
data = ["tests/crypto_scrypt-test.js"],
)

wd_test(
src = "tests/crypto_spkac-test.wd-test",
args = ["--experimental"],
data = ["tests/crypto_spkac-test.js"],
)

wd_test(
src = "tests/crypto_x509-test.wd-test",
args = ["--experimental"],
data = ["tests/crypto_x509-test.js"],
)

wd_test(
src = "tests/diagnostics-channel-test.wd-test",
args = ["--experimental"],
data = ["tests/diagnostics-channel-test.js"],
)

wd_test(
src = "tests/mimetype-test.wd-test",
args = ["--experimental"],
data = ["tests/mimetype-test.js"],
)

wd_test(
src = "tests/node-compat-v2-test.wd-test",
args = ["--experimental"],
data = ["tests/node-compat-v2-test.js"],
)

wd_test(
src = "tests/path-test.wd-test",
args = ["--experimental"],
data = ["tests/path-test.js"],
)

wd_test(
size = "large",
src = "tests/streams-test.wd-test",
args = ["--experimental"],
data = ["tests/streams-test.js"],
)

wd_test(
src = "tests/string-decoder-test.wd-test",
args = ["--experimental"],
data = ["tests/string-decoder-test.js"],
)

wd_test(
src = "tests/util-nodejs-test.wd-test",
args = ["--experimental"],
data = ["tests/util-nodejs-test.js"],
)

wd_test(
src = "tests/zlib-nodejs-test.wd-test",
args = ["--experimental"],
data = ["tests/zlib-nodejs-test.js"],
)
2 changes: 1 addition & 1 deletion src/workerd/server/tests/compile-tests/BUILD.bazel
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
sh_test(
name = "helloworld_compile_test",
size = "small",
size = "medium",
srcs = ["compile-test.sh"],
args = [
"$(location //src/workerd/server:workerd)",
Expand Down
3 changes: 1 addition & 2 deletions src/workerd/server/tests/python/import_tests.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -44,18 +44,17 @@ def gen_import_tests(to_test):
name = worker_py_fname + "@rule",
out = worker_py_fname,
content = [generate_import_py_file(to_test[lib])],
tags = ["slow"],
)
write_file(
name = wd_test_fname + "@rule",
out = wd_test_fname,
content = [generate_wd_test_file(lib)],
tags = ["slow"],
)

py_wd_test(
src = wd_test_fname,
args = ["--experimental", "--pyodide-package-disk-cache-dir", "../all_pyodide_wheels"],
data = [worker_py_fname, "@all_pyodide_wheels//:whls"],
tags = ["slow"],
size = "enormous",
)

0 comments on commit b619cb0

Please sign in to comment.