Skip to content

Commit 903aa80

Browse files
try fix
1 parent 086c5c1 commit 903aa80

1 file changed

Lines changed: 31 additions & 0 deletions

File tree

tools/test.sh

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,37 @@ COVERAGE_CLI="$ROOT_DIR/packages/dart_node_coverage/bin/coverage.dart"
1818
# Minimum coverage threshold (can be overridden by MIN_COVERAGE env var)
1919
MIN_COVERAGE="${MIN_COVERAGE:-80}"
2020

21+
# Detect Chromium executable for browser tests (can be overridden by CHROME_EXECUTABLE env var)
22+
if [[ -z "${CHROME_EXECUTABLE:-}" ]]; then
23+
case "$(uname -s)" in
24+
Darwin)
25+
for candidate in \
26+
"/opt/homebrew/Caskroom/chromium/latest/chrome-mac/Chromium.app/Contents/MacOS/Chromium" \
27+
"/Applications/Chromium.app/Contents/MacOS/Chromium"; do
28+
[[ -x "$candidate" ]] && { CHROME_EXECUTABLE="$candidate"; break; }
29+
done
30+
;;
31+
Linux)
32+
for candidate in chromium chromium-browser; do
33+
command -v "$candidate" >/dev/null 2>&1 && { CHROME_EXECUTABLE="$(command -v "$candidate")"; break; }
34+
done
35+
# Dev Container Chromium cache fallback
36+
if [[ -z "${CHROME_EXECUTABLE:-}" ]]; then
37+
for dir in /home/vscode/.cache/chromium-*/chrome-linux; do
38+
[[ -x "$dir/chrome" ]] && { CHROME_EXECUTABLE="$dir/chrome"; break; }
39+
done
40+
fi
41+
;;
42+
esac
43+
fi
44+
45+
if [[ -n "${CHROME_EXECUTABLE:-}" ]]; then
46+
export CHROME_EXECUTABLE
47+
echo "Chromium: $CHROME_EXECUTABLE"
48+
else
49+
echo "WARNING: No Chromium found — browser tests will fail"
50+
fi
51+
2152
# Package type definitions
2253
NODE_PACKAGES="dart_node_core dart_node_express dart_node_ws dart_node_better_sqlite3"
2354
NODE_INTEROP_PACKAGES="dart_node_mcp dart_node_react_native too_many_cooks"

0 commit comments

Comments
 (0)