Skip to content

Local UI to run and train LLMs and diffusion models. Supports GGUF, MLX, Qwen3.8, DeepSeek-V4.1, MiniMax-H3, Gemma 4, FLUX and more.

Anchor the host-defaults assertions and take the file off the skip list (#7774)

Daniel Hanfb8a992449d7
diff --git a/.github/workflows/studio-backend-ci.yml b/.github/workflows/studio-backend-ci.yml
index dd5efbb2998..01c27e786a7 100644
--- a/.github/workflows/studio-backend-ci.yml
+++ b/.github/workflows/studio-backend-ci.yml
@@ -243,13 +243,10 @@ jobs:
# grows without one.
#
# Skipped:
- # test_install_host_defaults.sh: asserts an install.ps1 layout that
- # has drifted (separate followup).
- # test_install_rollback_lifecycle.sh: already runs on both platforms
- # in cross-platform-parity-ci.yml.
+ # test_install_rollback_lifecycle.sh: covered by cross-platform-parity-ci.yml.
run: |
set -e
- skip="test_install_host_defaults.sh test_install_rollback_lifecycle.sh"
+ skip="test_install_rollback_lifecycle.sh"
found=0
for s in tests/sh/test_*.sh; do
case " $skip " in
diff --git a/tests/run_all.sh b/tests/run_all.sh
index 2497ba8fe73..80854140dbc 100755
--- a/tests/run_all.sh
+++ b/tests/run_all.sh
@@ -9,13 +9,11 @@ TESTS_DIR="$(cd "$(dirname "$0")" && pwd)"
echo "=== Bash tests ==="
# Discovered, not listed: a hand-maintained list drifts (this one had fallen
# eight files behind sh/, and the Backend CI copy of it had fallen seven).
-# Backend CI discovers the same directory and skips the same file, plus
-# test_install_rollback_lifecycle.sh which cross-platform-parity-ci.yml already
-# runs on both platforms. tests/studio/test_ci_shell_suite_coverage.py fails if
-# either side stops discovering, or skips something undocumented.
-# test_install_host_defaults.sh: asserts an install.ps1 layout that has
-# drifted (separate followup).
-SH_SKIP="test_install_host_defaults.sh"
+# Backend CI discovers the same directory, skipping only
+# test_install_rollback_lifecycle.sh (covered by cross-platform-parity-ci.yml).
+# tests/studio/test_ci_shell_suite_coverage.py fails if either side stops
+# discovering, or skips something undocumented.
+SH_SKIP=""
for _t in "$TESTS_DIR"/sh/test_*.sh; do
case " $SH_SKIP " in
*" $(basename "$_t") "*) echo "skipping $(basename "$_t")"; continue ;;
diff --git a/tests/sh/test_install_host_defaults.sh b/tests/sh/test_install_host_defaults.sh
index 8e1278b6e22..62f4c076cc1 100755
--- a/tests/sh/test_install_host_defaults.sh
+++ b/tests/sh/test_install_host_defaults.sh
@@ -50,12 +50,14 @@ assert_not_contains \
"$_launcher" "studio -H 0.0.0.0"
echo ""
+# Anchored on content, not a line count: both installers outgrew their tail windows.
echo "=== install.sh end-of-install block ==="
-_end=$(tail -50 "$INSTALL_SH")
+_end=$(awk '/In interactive terminals/{found=1} found{print}' "$INSTALL_SH")
+# "read" alone also matches "readable" and "_can_read_tty", so pin the full prompt.
assert_contains \
"install.sh: interactive block prompts user (read)" \
- "$_end" "read"
+ "$_end" "read -r _reply"
assert_not_contains \
"install.sh: no 'studio -H 0.0.0.0' in end-of-install commands" \
"$_end" "studio -H 0.0.0.0"
@@ -63,7 +65,7 @@ assert_not_contains \
echo ""
echo "=== install.ps1 end-of-install block ==="
-_ps1_end=$(tail -25 "$INSTALL_PS1")
+_ps1_end=$(awk '/In interactive terminals/{found=1} found{print}' "$INSTALL_PS1")
assert_contains \
"install.ps1: interactive block prompts user (Read-Host)" \
"$_ps1_end" "Read-Host"
@@ -74,7 +76,11 @@ assert_not_contains \
echo ""
echo "=== studio/setup.sh launch hint ==="
-_setup_tail=$(tail -30 "$SETUP_SH")
+_setup_tail=$(awk '/"launch"/{found=1} found{print}' "$SETUP_SH")
+# Canary: an empty window would let the negative assertion below pass vacuously.
+assert_contains \
+ "studio/setup.sh: extraction found the launch hint" \
+ "$_setup_tail" "unsloth studio -p 8888"
assert_not_contains \
"studio/setup.sh: launch hint has no '-H 0.0.0.0'" \
"$_setup_tail" "studio -H 0.0.0.0"
@@ -83,8 +89,9 @@ echo ""
echo "=== README.md Launch section ==="
# The primary Launch example must not include -H 0.0.0.0; the LAN/cloud
-# note appears as an opt-in line outside the code block.
-_readme_launch=$(awk '/^#### Launch$/{found=1} found{print} /^#### Update$/{found=0}' "$README")
+# note is an opt-in line outside it. Stop at the next heading of any level:
+# '#### Update' was later deleted, silently extending the section to the file end.
+_readme_launch=$(awk '/^#### Launch$/{found=1; print; next} found && /^#{1,6} /{exit} found{print}' "$README")
assert_contains \
"README: Launch section exists" \
"$_readme_launch" "unsloth studio"
diff --git a/tests/studio/test_ci_shell_suite_coverage.py b/tests/studio/test_ci_shell_suite_coverage.py
index 4b7768a9b61..d4d7c3a561e 100644
--- a/tests/studio/test_ci_shell_suite_coverage.py
+++ b/tests/studio/test_ci_shell_suite_coverage.py
@@ -40,7 +40,6 @@ _SH_DIR = REPO_ROOT / "tests" / "sh"
# Files deliberately not run by the auto-discovered Backend CI step. Each needs
# a reason here AND in the workflow; anything else in tests/sh must run.
_EXPECTED_CI_SKIPS = {
- "test_install_host_defaults.sh": "asserts an install.ps1 layout that has drifted",
"test_install_rollback_lifecycle.sh": "runs on both platforms in cross-platform-parity-ci.yml",
}