Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -289,6 +289,8 @@ jobs:

- name: Setup Bun
uses: oven-sh/setup-bun@0c5077e51419868618aeaa5fe8019c62421857d6 # v2
with:
bun-version: "1.3.14"

- name: Install dependencies
run: bun install --frozen-lockfile
Expand Down
22 changes: 22 additions & 0 deletions tests/test_ci_self_hosted_guard.sh
Original file line number Diff line number Diff line change
Expand Up @@ -863,6 +863,10 @@ check_web_test_runner_behavior() {
cat > "$fixture_dir/bin/bun" <<'EOF'
#!/usr/bin/env bash
set -euo pipefail
if [[ "${1:-}" == "--version" ]]; then
printf '%s\n' "${CMUX_WEB_TEST_RUNNER_BUN_VERSION:-1.3.14}"
exit 0
fi
printf '%s\n' "$@" > "$CMUX_WEB_TEST_RUNNER_ARGS_LOG"
EOF
chmod +x "$fixture_dir/bin/bun"
Expand All @@ -883,6 +887,24 @@ EOF
exit 1
fi

if PATH="$fixture_dir/bin:/usr/bin:/bin" \
CMUX_WEB_TEST_RUNNER_ARGS_LOG="$args_log" \
CMUX_WEB_TEST_RUNNER_BUN_VERSION="1.2.14" \
/bin/bash "$fixture_runner" >/dev/null 2>&1; then
Comment thread
lawrencecchen marked this conversation as resolved.
echo "FAIL: shared web test runner must reject Bun versions with process-global mock leakage"
rm -rf "$fixture_dir"
exit 1
fi

if PATH="$fixture_dir/bin:/usr/bin:/bin" \
CMUX_WEB_TEST_RUNNER_ARGS_LOG="$args_log" \
CMUX_WEB_TEST_RUNNER_BUN_VERSION="1.3.13" \
/bin/bash "$fixture_runner" >/dev/null 2>&1; then
echo "FAIL: shared web test runner must enforce the patch-level Bun isolation boundary"
Comment on lines +899 to +903

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 Badge Put the patch-boundary test before the fix

The 1.3.13 regression case first appears in commit 0e9a1794, after commit 7afcfd0b has already implemented the minimum-version guard, so the series never demonstrates that this precise patch-level test fails without the fix; the earlier 1.2.14 case could still pass with an incorrect major/minor-only guard. Move this boundary assertion into the test-only commit before the implementation so CI records the required red-to-green transition.

AGENTS.md reference: AGENTS.md:L127-L134

Useful? React with 👍 / 👎.

rm -rf "$fixture_dir"
exit 1
fi

if ! PATH="$fixture_dir/bin:/usr/bin:/bin" \
CMUX_WEB_TEST_RUNNER_ARGS_LOG="$args_log" \
/bin/bash "$fixture_runner" \
Expand Down
28 changes: 28 additions & 0 deletions web/scripts/run-tests.sh
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,34 @@ set -euo pipefail
WEB_ROOT="$(cd "$(dirname "${BASH_SOURCE[0]}")/.." && pwd)"
cd "$WEB_ROOT"

MINIMUM_BUN_VERSION="1.3.14"

bun_version_is_supported() {
awk -v actual="$1" -v required="$2" '
BEGIN {
split(actual, actual_parts, ".")
split(required, required_parts, ".")
for (part_index = 1; part_index <= 3; part_index++) {
actual_part = actual_parts[part_index] + 0
required_part = required_parts[part_index] + 0
if (actual_part > required_part) {
exit 0
}
if (actual_part < required_part) {
exit 1
}
}
exit 0
}
'
}

bun_version="$(bun --version)"
if ! bun_version_is_supported "$bun_version" "$MINIMUM_BUN_VERSION"; then
echo "Web tests require Bun $MINIMUM_BUN_VERSION or newer; found $bun_version" >&2
exit 1
fi

arguments_require_bun_discovery() {
local expects_value=0
local positional_only=0
Expand Down