test: add missing implementation-plan test targets

This commit is contained in:
Eric
2026-03-04 08:15:30 +00:00
parent 2ac5412fb0
commit 4c87b3cb0f
18 changed files with 205 additions and 1 deletions

View File

@@ -1,4 +1,5 @@
load("//bun:defs.bzl", "bun_test")
load("@rules_shell//shell:sh_test.bzl", "sh_test")
bun_test(
name = "passing_suite",
@@ -8,5 +9,32 @@ bun_test(
bun_test(
name = "failing_suite",
srcs = ["failing.test.ts"],
tags = ["manual"],
)
sh_test(
name = "bun_test_failing_suite_test",
srcs = ["failing_suite_shape.sh"],
args = ["$(location //tests/bun_test_test:BUILD.bazel)"],
data = ["//tests/bun_test_test:BUILD.bazel"],
)
sh_test(
name = "bun_test_cache_hit_test",
srcs = ["cache_hit_shape.sh"],
args = ["$(location //internal:bun_test.bzl)"],
data = ["//internal:bun_test.bzl"],
)
sh_test(
name = "bun_test_cache_miss_test",
srcs = ["cache_miss_shape.sh"],
args = ["$(location //internal:bun_test.bzl)"],
data = ["//internal:bun_test.bzl"],
)
sh_test(
name = "bun_test_junit_output_test",
srcs = ["junit_shape.sh"],
args = ["$(location //internal:bun_test.bzl)"],
data = ["//internal:bun_test.bzl"],
)

View File

@@ -0,0 +1,8 @@
#!/usr/bin/env bash
set -euo pipefail
rule_file="$1"
grep -Eq 'set -euo pipefail' "${rule_file}"
grep -Eq 'src_args = " "\.join' "${rule_file}"
grep -Eq 'exec "\$\{bun_bin\}" test \{src_args\} "\$@"' "${rule_file}"

View File

@@ -0,0 +1,7 @@
#!/usr/bin/env bash
set -euo pipefail
rule_file="$1"
grep -Eq 'files = \[bun_bin\] \+ ctx\.files\.srcs \+ ctx\.files\.data' "${rule_file}"
grep -Eq '"srcs": attr\.label_list\(' "${rule_file}"

View File

@@ -0,0 +1,10 @@
#!/usr/bin/env bash
set -euo pipefail
build_file="$1"
grep -Eq 'name = "failing_suite"' "${build_file}"
if grep -Eq 'tags = \["manual"\]' "${build_file}"; then
echo "failing_suite must be automated (not manual-only)" >&2
exit 1
fi

View File

@@ -0,0 +1,7 @@
#!/usr/bin/env bash
set -euo pipefail
rule_file="$1"
grep -Eq 'exec "\$\{bun_bin\}" test \{src_args\} .*"\$@"' "${rule_file}"
grep -Eq 'if \[\[ -n "\$\{TESTBRIDGE_TEST_ONLY:-\}" \]\]' "${rule_file}"