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.
Python agentaichatgptdeepseekfine-tuninggemmaimage-generationllamallmllmsopenaipythonqwenreinforcement-learningself-hostedstable-diffusiontext-to-speechttsuiunsloth
Run shell suites and Windows browser checks in parallel (#12899)
oobabooga06b90151aff4
diff --git a/.github/workflows/studio-backend-ci.yml b/.github/workflows/studio-backend-ci.ymlindex 7a30863fc7c..8b719f36281 100644--- a/.github/workflows/studio-backend-ci.yml+++ b/.github/workflows/studio-backend-ci.yml@@ -613,17 +613,42 @@ jobs:# Skipped:# test_install_rollback_lifecycle.sh: covered by cross-platform-parity-ci.yml.run: |- set -e+ set -euo pipefail+ shopt -s nullglobskip="test_install_rollback_lifecycle.sh"- found=0+ suites=()for s in tests/sh/test_*.sh; docase " $skip " in*" $(basename "$s") "*) echo "skipping $s (see workflow comment)"; continue ;;esac- found=$((found + 1))+ suites+=("$s")+ done+ found=${#suites[@]}+ [ "$found" -gt 0 ] || { echo "::error::no shell tests discovered under tests/sh"; exit 1; }+ export suite_logs+ suite_logs=$(mktemp -d "$RUNNER_TEMP/shell-suites.XXXXXX")+ # Each suite already owns its fixtures. Keep its output and exit status+ # separate, then collect every result even when another suite fails.+ failed=0+ printf '%s\0' "${suites[@]}" | xargs -0 -P 4 -n 1 bash -c '+ s=$1+ name=${s##*/}+ echo "Starting $s"+ rc=0+ timeout --signal=TERM --kill-after=10s 480s bash "$s" > "$suite_logs/$name.log" 2>&1 || rc=$?+ printf "%s\n" "$rc" > "$suite_logs/$name.status"+ echo "Finished $s (exit $rc)"+ ' _ || failed=1+ for s in "${suites[@]}"; do+ name=${s##*/}echo "::group::$s"- bash "$s"+ cat "$suite_logs/$name.log" || failed=1+ rc=$(cat "$suite_logs/$name.status" 2>/dev/null) || rc=1+ if [ "$rc" != 0 ]; then+ echo "::error::$s exited $rc (124 means the suite timed out)"+ failed=1+ fiecho "::endgroup::"done- [ "$found" -gt 0 ] || { echo "::error::no shell tests discovered under tests/sh"; exit 1; }echo "ran $found shell installer test files"+ exit "$failed"diff --git a/.github/workflows/studio-frontend-ci.yml b/.github/workflows/studio-frontend-ci.ymlindex 254d736b1e9..1f09e3ad01d 100644--- a/.github/workflows/studio-frontend-ci.yml+++ b/.github/workflows/studio-frontend-ci.yml@@ -700,16 +700,28 @@ jobs:timeout-minutes: 3run: python tests/studio/playwright_composer_icons.py chromium firefox- - name: Data settings deletion choices in Chromium+ - name: Data settings deletion choices in Chromium and Firefoxworking-directory: ${{ github.workspace }}- run: python tests/studio/playwright_data_settings.py-- - name: Data settings deletion choices in Firefox- working-directory: ${{ github.workspace }}- env:- PW_ENGINE: firefox- PW_OUT: logs/data_settings_firefox_report.json- run: python tests/studio/playwright_data_settings.py+ run: |+ mkdir -p logs+ # each driver owns its Vite server, optimizer cache, and report+ PW_ENGINE=chromium PW_PORT=5420 PW_OUT=logs/data_settings_report.json \+ VITE_TEST_CACHE_DIR="$RUNNER_TEMP/vite-data-chromium" \+ python tests/studio/playwright_data_settings.py > logs/data_settings_chromium.log 2>&1 &+ chromium_pid=$!+ PW_ENGINE=firefox PW_PORT=5421 PW_OUT=logs/data_settings_firefox_report.json \+ VITE_TEST_CACHE_DIR="$RUNNER_TEMP/vite-data-firefox" \+ python tests/studio/playwright_data_settings.py > logs/data_settings_firefox.log 2>&1 &+ firefox_pid=$!+ failed=0+ wait "$chromium_pid" || failed=1+ wait "$firefox_pid" || failed=1+ for engine in chromium firefox; do+ echo "::group::Data settings: $engine"+ cat "logs/data_settings_$engine.log" || failed=1+ echo "::endgroup::"+ done+ exit "$failed"- name: Upload alignment failure artifactsif: failure()diff --git a/.github/workflows/workflow-trigger-lint.yml b/.github/workflows/workflow-trigger-lint.ymlindex 1d677be6032..e7a5a106d57 100644--- a/.github/workflows/workflow-trigger-lint.yml+++ b/.github/workflows/workflow-trigger-lint.yml@@ -141,6 +141,7 @@ jobs:tests/studio/test_ui_shard_engines.py \tests/studio/test_zoo_suite_parallel_isolation.py \tests/studio/test_core_setup_zoo_revision_notice.py \+ tests/studio/test_ci_parallel_browser_results.py \tests/studio/test_ci_shell_suite_coverage.py \tests/studio/test_pip_cache_naming.py \tests/studio/test_compile_caches_are_per_worker.py \diff --git a/studio/frontend/vite.config.ts b/studio/frontend/vite.config.tsindex 0b24777958f..bf8e6cd80e8 100644--- a/studio/frontend/vite.config.ts+++ b/studio/frontend/vite.config.ts@@ -24,13 +24,13 @@ function smokeModuleDelay(): Plugin {};}-// https://vite.dev/config/export default defineConfig({+ // concurrent browser checks use separate dependency optimizer caches.+ cacheDir: process.env.VITE_TEST_CACHE_DIR || "node_modules/.vite",// Reasoning's highlighter loads only the grammar it needs in its module worker.worker: { format: "es" },plugins: [react(), tailwindcss(), smokeModuleDelay()],- // Keep an unrelated PostCSS config in an ancestor directory from leaking- // into Unsloth installs. Tailwind is provided by its dedicated Vite plugin.+ // prevent ancestor PostCSS configs from leaking into installs; Tailwind uses its Vite plugin.css: {postcss: {plugins: [],diff --git a/tests/studio/playwright_data_settings.py b/tests/studio/playwright_data_settings.pyindex 1628326b6cb..17a10ca2a22 100644--- a/tests/studio/playwright_data_settings.py+++ b/tests/studio/playwright_data_settings.py@@ -850,7 +850,8 @@ def run_restore_notifications(page):expect(dialog.get_by_role("heading")).to_have_text(f"{heading} ({count})")confirm = "Unarchive" if action == "restore" else "Delete"dialog.get_by_role("button", name = confirm, exact = True).click()- expect(dialog).to_have_count(0)+ # allow shared runners 30 seconds for 23 sequential mocked HTTP requests+ expect(dialog).to_have_count(0, timeout = 30_000)completed = count if failure_index is None else failure_indexexpected_events = [kind] if completed and action == "restore" else []observed = page.evaluate("window.__dataFixture.notifications")diff --git a/tests/studio/test_ci_parallel_browser_results.py b/tests/studio/test_ci_parallel_browser_results.pynew file mode 100644index 00000000000..a47626e29f6--- /dev/null+++ b/tests/studio/test_ci_parallel_browser_results.py@@ -0,0 +1,64 @@+# SPDX-License-Identifier: AGPL-3.0-only+# Copyright 2026-present the Unsloth AI Inc. team. All rights reserved. See /studio/LICENSE.AGPL-3.0++import os+from pathlib import Path+import shutil+import subprocess++import pytest+import yaml+++WORKFLOW = Path(__file__).resolve().parents[2] / ".github/workflows/studio-frontend-ci.yml"+++def _workflow_bash():+ if os.name != "nt":+ return shutil.which("bash")+ git = shutil.which("git")+ if not git:+ return None+ candidate = Path(git).resolve().parent.parent / "bin" / "bash.exe"+ return str(candidate) if candidate.is_file() else None+++BASH = _workflow_bash()+pytestmark = pytest.mark.skipif(not BASH, reason = "requires the workflow's bash shell")++[email protected]("failing", ["", "chromium", "firefox"])+def test_browser_children_are_isolated_and_both_results_gate(tmp_path, failing):+ steps = yaml.safe_load(WORKFLOW.read_text(encoding = "utf-8"))["jobs"]["windows"]["steps"]+ script = next(+ s["run"]+ for s in steps+ if s.get("name") == "Data settings deletion choices in Chromium and Firefox"+ )+ stub = r"""+python() {+ printf '%s %s %s %s\n' "$PW_ENGINE" "$PW_PORT" "$PW_OUT" "$VITE_TEST_CACHE_DIR"+ touch "$PW_ENGINE.ready"+ for attempt in $(seq 1 100); do+ [ -e chromium.ready ] && [ -e firefox.ready ] && break+ sleep 0.02+ done+ [ -e chromium.ready ] && [ -e firefox.ready ] || return 9+ [ "$PW_ENGINE" != "$FAIL_ENGINE" ] || return 7+}+"""+ result = subprocess.run(+ [BASH, "-e", "-o", "pipefail", "-c", stub + script],+ cwd = tmp_path,+ env = {**os.environ, "RUNNER_TEMP": str(tmp_path), "FAIL_ENGINE": failing},+ text = True,+ capture_output = True,+ timeout = 15,+ )+ assert result.returncode == bool(failing), result.stdout + result.stderr+ assert "chromium 5420 logs/data_settings_report.json" in result.stdout+ assert "firefox 5421 logs/data_settings_firefox_report.json" in result.stdout+ assert f"{tmp_path}/vite-data-chromium" in result.stdout+ assert f"{tmp_path}/vite-data-firefox" in result.stdout+ assert (tmp_path / "chromium.ready").exists()+ assert (tmp_path / "firefox.ready").exists()diff --git a/tests/studio/test_ci_shell_suite_coverage.py b/tests/studio/test_ci_shell_suite_coverage.pyindex 1d76cea0567..040f5675290 100644--- a/tests/studio/test_ci_shell_suite_coverage.py+++ b/tests/studio/test_ci_shell_suite_coverage.py@@ -1,28 +1,12 @@# SPDX-License-Identifier: AGPL-3.0-only# Copyright 2026-present the Unsloth AI Inc. team. All rights reserved. See /studio/LICENSE.AGPL-3.0-"""Guards that the installer test suites actually run on a PR.--Two ways coverage went missing without anyone noticing:--1. Backend CI ran a hardcoded list of tests/sh/*.sh files. New tests were added- to the directory and never to the list, so by the time this was written the- list was seven files behind -- including test_strixhalo_wsl_reroute.sh, the- only shell coverage of the ROCm WSL reroute, which had never run on a PR.- tests/run_all.sh, the local entrypoint, had drifted the other way.--2. Backend CI's path filter did not include install.sh / install.ps1, while a- large share of the suites it runs (tests/sh/*, tests/studio/install/*) assert- against exactly those two files. An install-only change -- the shape most- AMD/ROCm routing fixes take, e.g. #7277 / #7293 / #7300 -- skipped the- workflow that tests it.--Both are now discovery-based. These tests fail if either reverts to a list, if a-shell test lands somewhere the discovery cannot see it, or if a skip is added-without a reason next to it.-"""+"""guard installer shell-suite discovery, path triggers, and parallel result reporting."""+import osimport re+import shutil+import subprocessfrom pathlib import Pathimport pytest@@ -37,7 +21,6 @@ _PARITY_CI = _WORKFLOWS / "cross-platform-parity-ci.yml"_RUN_ALL = REPO_ROOT / "tests" / "run_all.sh"_SH_DIR = REPO_ROOT / "tests" / "sh"-# Files deliberately not run by the auto-discovered Backend CI step._EXPECTED_CI_SKIPS = {"test_install_rollback_lifecycle.sh": "runs on both platforms in cross-platform-parity-ci.yml",}@@ -370,7 +353,7 @@ class TestWindowsPowerShellStepsAreGated:)def test_the_rule_finds_the_steps_it_is_about(self):- """Without this, a walk that matched nothing would leave the rule above vacuous."""+ """prevent a vacuous pass when workflow traversal finds no matching steps."""found = 0for workflow in sorted(_WORKFLOWS.glob("*.yml")):doc = yaml.safe_load(workflow.read_text(encoding = "utf-8"))@@ -382,3 +365,60 @@ class TestWindowsPowerShellStepsAreGated:f"only {found} Windows PowerShell steps found on multi-OS jobs; the walk above is "f"looking in the wrong place")+++ os.name != "posix" or not all(shutil.which(x) for x in ("bash", "xargs", "timeout")),+ reason = "the Linux shell-suite runner needs bash, xargs and timeout",+)+class TestParallelShellResults:+ def run_step(self, tmp_path, suites):+ directory = tmp_path / "tests" / "sh"+ directory.mkdir(parents = True)+ for name, body in suites.items():+ (directory / name).write_text(body)+ return subprocess.run(+ ["bash", "-c", _shell_step_script()],+ cwd = tmp_path,+ env = {**os.environ, "RUNNER_TEMP": str(tmp_path)},+ capture_output = True,+ text = True,+ timeout = 15,+ )++ def test_a_failure_does_not_hide_other_suite_results(self, tmp_path):+ result = self.run_step(+ tmp_path,+ {+ "test_a.sh": "echo first-failure; exit 7",+ "test_b.sh": "echo second-success",+ "test_c with spaces.sh": "echo third-success",+ "test_install_rollback_lifecycle.sh": "echo should-not-run; exit 99",+ },+ )+ assert result.returncode == 1+ assert "first-failure" in result.stdout+ assert "second-success" in result.stdout+ assert "third-success" in result.stdout+ assert "test_a.sh exited 7" in result.stdout+ assert "should-not-run" not in result.stdout+ assert "ran 3 shell installer test files" in result.stdout++ def test_empty_discovery_fails(self, tmp_path):+ result = self.run_step(tmp_path, {})+ assert result.returncode != 0+ assert "no shell tests discovered under tests/sh" in result.stdout++ def test_four_suites_can_reach_a_barrier_together(self, tmp_path):+ body = """touch "${0##*/}.ready"+for attempt in $(seq 1 100); do+ count=$(find . -maxdepth 1 -name '*.ready' | wc -l)+ [ "$count" -eq 4 ] && exit 0+ sleep 0.02+done+echo "the other suites never reached the barrier"+exit 1+"""+ result = self.run_step(tmp_path, {f"test_{i}.sh": body for i in range(4)})+ assert result.returncode == 0, result.stdout + result.stderr+ assert "ran 4 shell installer test files" in result.stdout