test: add more tests
This commit is contained in:
@@ -165,3 +165,54 @@ sh_test(
|
||||
args = ["$(location :workspace_filtered_script)"],
|
||||
data = [":workspace_filtered_script"],
|
||||
)
|
||||
|
||||
bun_script(
|
||||
name = "workspace_parallel_script",
|
||||
script = "say",
|
||||
package_json = "workspace_run/package.json",
|
||||
data = [
|
||||
"workspace_run/packages/pkg-a/package.json",
|
||||
"workspace_run/packages/pkg-a/say.ts",
|
||||
"workspace_run/packages/pkg-b/package.json",
|
||||
"workspace_run/packages/pkg-b/say.ts",
|
||||
],
|
||||
workspaces = True,
|
||||
execution_mode = "parallel",
|
||||
)
|
||||
|
||||
sh_test(
|
||||
name = "bun_script_workspace_parallel_test",
|
||||
srcs = ["run_workspace_parallel.sh"],
|
||||
args = ["$(location :workspace_parallel_script)"],
|
||||
data = [":workspace_parallel_script"],
|
||||
)
|
||||
|
||||
bun_script(
|
||||
name = "workspace_flagged_script",
|
||||
script = "say",
|
||||
package_json = "workspace_run/package.json",
|
||||
data = [
|
||||
"workspace_run/packages/pkg-a/package.json",
|
||||
"workspace_run/packages/pkg-a/say.ts",
|
||||
"workspace_run/packages/pkg-b/package.json",
|
||||
"workspace_run/packages/pkg-b/say.ts",
|
||||
],
|
||||
workspaces = True,
|
||||
execution_mode = "parallel",
|
||||
no_exit_on_error = True,
|
||||
shell = "system",
|
||||
)
|
||||
|
||||
sh_test(
|
||||
name = "bun_script_workspace_flag_shape_test",
|
||||
srcs = ["verify_launcher_flags.sh"],
|
||||
args = [
|
||||
"$(location :workspace_flagged_script)",
|
||||
"--workspaces",
|
||||
"--parallel",
|
||||
"--no-exit-on-error",
|
||||
"--shell",
|
||||
"system",
|
||||
],
|
||||
data = [":workspace_flagged_script"],
|
||||
)
|
||||
|
||||
15
tests/script_test/run_workspace_parallel.sh
Executable file
15
tests/script_test/run_workspace_parallel.sh
Executable file
@@ -0,0 +1,15 @@
|
||||
#!/usr/bin/env bash
|
||||
set -euo pipefail
|
||||
|
||||
script_bin="$1"
|
||||
output="$(${script_bin})"
|
||||
|
||||
if [[ ${output} != *"pkg-a"* ]]; then
|
||||
echo "Expected workspace parallel run output to include pkg-a: ${output}" >&2
|
||||
exit 1
|
||||
fi
|
||||
|
||||
if [[ ${output} != *"pkg-b"* ]]; then
|
||||
echo "Expected workspace parallel run output to include pkg-b: ${output}" >&2
|
||||
exit 1
|
||||
fi
|
||||
12
tests/script_test/verify_launcher_flags.sh
Executable file
12
tests/script_test/verify_launcher_flags.sh
Executable file
@@ -0,0 +1,12 @@
|
||||
#!/usr/bin/env bash
|
||||
set -euo pipefail
|
||||
|
||||
binary="$1"
|
||||
shift
|
||||
|
||||
for expected in "$@"; do
|
||||
if ! grep -Fq -- "${expected}" "${binary}"; then
|
||||
echo "Expected ${binary} to contain ${expected}" >&2
|
||||
exit 1
|
||||
fi
|
||||
done
|
||||
Reference in New Issue
Block a user