mirror of
https://github.com/unslothai/unsloth.git
synced 2026-08-23 15:53:46 +00:00
* Anchor the host-defaults assertions and take the file off the skip list
test_install_host_defaults.sh has been quarantined since #7431 and failing for
longer, with a recorded reason that covers one of three drifts. None of them is
a regression: install.sh, install.ps1 and the README all still behave as the
test intends. Every failure comes from how the test carves out the text it
greps.
Both installers were sliced with a fixed tail. install.sh grew past its 50-line
window in #6258 and install.ps1 past its 25-line window in #7be1085, the day
after the test landed, so the prompt each assertion looks for sat just above the
window. Both now start at the block's own 'In interactive terminals' comment.
The README extractor stopped at a '#### Update' heading that was later deleted,
so its Launch section silently became the rest of the file and picked up the
-H 0.0.0.0 from the remote-access section 137 lines below. It now stops at the
next heading of any name.
Two assertions could not have failed. setup.sh's launch hint sits at line 2332
while tail -30 covered 2339 onward, so the negative check no longer looked at
the hint at all, and 'read' as a needle also matches 'readable' and
'_can_read_tty', so the prompt check passed with the prompt deleted. Both are
pinned to what they mean to protect; each of the six assertions now fails when
its target is removed.
With the extraction fixed the file passes 10/10, so it comes off the skip list
in run_all.sh, studio-backend-ci.yml and test_ci_shell_suite_coverage.py, which
have to change together.
* Give the setup.sh window a canary and stop at any heading level
The setup.sh launch-hint extraction was the only one of the four with no
positive assertion over it. The other three each pin something that must be
present, so a broken extraction fails loudly; this one had a lone
assert_not_contains, and a negative check over an empty window passes. Renaming
the printf label empties it, and the test then stays green with 0.0.0.0
hard-coded in the hint, which is the failure this PR exists to remove.
The README extractor's comment promised the next heading of any name while the
pattern only matched an h4, so demoting the following heading would widen the
window again.
* Tighten the comments on the anchored host-defaults assertions
39 lines
1.7 KiB
Bash
Executable file
39 lines
1.7 KiB
Bash
Executable file
#!/bin/sh
|
|
# SPDX-License-Identifier: AGPL-3.0-only
|
|
# Copyright 2026-present the Unsloth AI Inc. team. All rights reserved. See /studio/LICENSE.AGPL-3.0
|
|
# Run all installer tests.
|
|
set -e
|
|
|
|
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, 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 ;;
|
|
esac
|
|
# bash, not sh: every file under sh/ declares a bash shebang, and three of
|
|
# them fail on bashisms under dash, which is /bin/sh on Debian and Ubuntu
|
|
# (test_apt_distro_prompt, test_studio_home_node_dir, and
|
|
# test_with_llama_cpp_dir_link_behavior). The old hand-written list happened
|
|
# to name only dash-clean files, so discovering the directory is what
|
|
# exposed this. Backend CI already invokes them with bash.
|
|
bash "$_t"
|
|
done
|
|
|
|
echo ""
|
|
echo "=== Python tests ==="
|
|
python -m pytest "$TESTS_DIR/python/test_install_python_stack.py" -v
|
|
python -m pytest "$TESTS_DIR/python/test_cross_platform_parity.py" -v
|
|
python -m pytest "$TESTS_DIR/python/test_no_torch_filtering.py" -v
|
|
python -m pytest "$TESTS_DIR/python/test_studio_import_no_torch.py" -v
|
|
python -m pytest "$TESTS_DIR/python/test_tokenizers_and_torch_constraint.py" -v -k "not e2e"
|
|
|
|
echo ""
|
|
echo "All tests passed."
|