9e8f1bbeed
Dashboard / frontend (push) Failing after 0s
Dashboard / api (push) Failing after 0s
Lint PowerShell / powershell-lint (ubuntu-latest) (push) Failing after 1s
Python Lint / Lint Python with Ruff (push) Failing after 1s
ShellCheck / Lint shell scripts (push) Failing after 1s
Matrix Smoke / linux-smoke (push) Failing after 1s
Matrix Smoke / distro: cachyos (push) Failing after 15s
Matrix Smoke / distro: linux-mint-21.3 (push) Failing after 15s
Matrix Smoke / distro: debian-12 (push) Failing after 5m21s
Matrix Smoke / distro: fedora-41 (push) Failing after 4m56s
Matrix Smoke / distro: ubuntu-24.04 (push) Failing after 2m13s
Matrix Smoke / distro: rocky-9 (push) Failing after 10m39s
Matrix Smoke / distro: manjaro (push) Failing after 12m11s
Matrix Smoke / distro: opensuse-tw (push) Failing after 11m53s
Matrix Smoke / distro: archlinux (push) Failing after 20m3s
Matrix Smoke / distro: ubuntu-22.04 (push) Failing after 13m49s
Validate .env Schema / tier-1-env-validation (push) Successful in 52s
Validate .env Schema / tier-2-env-validation (push) Successful in 44s
Validate .env Schema / tier-3-env-validation (push) Successful in 52s
Validate .env Schema / tier-4-env-validation (push) Successful in 51s
Validate Extensions Catalog / Check catalog is up-to-date (push) Failing after 9m47s
Secret Scan / Scan for secrets (push) Failing after 21m4s
Validate Docker Compose / Validate Docker Compose files (push) Has been cancelled
Python Type Check / Type check with mypy (push) Has been cancelled
Validate .env Schema / tier-0-env-validation (push) Has been cancelled
Test Linux / integration-smoke (push) Has been cancelled
Lint PowerShell / powershell-lint (windows-latest) (push) Has been cancelled
Matrix Smoke / macos-smoke (push) Has been cancelled
115 lines
3.3 KiB
Bash
115 lines
3.3 KiB
Bash
#!/usr/bin/env bats
|
|
# ============================================================================
|
|
# BATS tests for installers/lib/bootstrap-model.sh
|
|
# ============================================================================
|
|
# Tests: bootstrap_needed()
|
|
|
|
load '../bats/bats-support/load'
|
|
load '../bats/bats-assert/load'
|
|
|
|
setup() {
|
|
# Stub tier_rank() — returns numeric rank for a given tier
|
|
tier_rank() {
|
|
case "$1" in
|
|
0) echo "0" ;;
|
|
1) echo "1" ;;
|
|
2) echo "2" ;;
|
|
3) echo "3" ;;
|
|
4) echo "4" ;;
|
|
NV_ULTRA) echo "5" ;;
|
|
SH_LARGE) echo "5" ;;
|
|
SH_COMPACT) echo "3" ;;
|
|
CLOUD) echo "1" ;;
|
|
*) echo "1" ;;
|
|
esac
|
|
}
|
|
export -f tier_rank
|
|
|
|
# Set defaults for all expected variables
|
|
export TIER=3
|
|
export GGUF_FILE="Qwen3-30B-A3B-Q4_K_M.gguf"
|
|
export INSTALL_DIR="$BATS_TEST_TMPDIR/ods"
|
|
export NO_BOOTSTRAP="false"
|
|
export OFFLINE_MODE="false"
|
|
export ODS_MODE="local"
|
|
|
|
# Create install dir (but NOT the model file)
|
|
mkdir -p "$INSTALL_DIR/data/models"
|
|
|
|
# Source the library under test
|
|
source "$BATS_TEST_DIRNAME/../../installers/lib/bootstrap-model.sh"
|
|
}
|
|
|
|
# ── bootstrap_needed: returns true (0) when needed ─────────────────────────
|
|
|
|
@test "bootstrap_needed: returns 0 when all conditions met" {
|
|
run bootstrap_needed
|
|
assert_success
|
|
}
|
|
|
|
@test "bootstrap_needed: returns 0 for high tier without model on disk" {
|
|
TIER=4
|
|
GGUF_FILE="Qwen3-30B-A3B-Q4_K_M.gguf"
|
|
run bootstrap_needed
|
|
assert_success
|
|
}
|
|
|
|
@test "bootstrap_needed: returns 0 for NV_ULTRA tier" {
|
|
TIER=NV_ULTRA
|
|
run bootstrap_needed
|
|
assert_success
|
|
}
|
|
|
|
# ── bootstrap_needed: returns false (1) when not needed ────────────────────
|
|
|
|
@test "bootstrap_needed: tier_rank=0 means not needed" {
|
|
TIER=0
|
|
run bootstrap_needed
|
|
assert_failure
|
|
}
|
|
|
|
@test "bootstrap_needed: full model already on disk means not needed" {
|
|
# Create the model file
|
|
touch "$INSTALL_DIR/data/models/$GGUF_FILE"
|
|
run bootstrap_needed
|
|
assert_failure
|
|
}
|
|
|
|
@test "bootstrap_needed: NO_BOOTSTRAP=true means not needed" {
|
|
NO_BOOTSTRAP="true"
|
|
run bootstrap_needed
|
|
assert_failure
|
|
}
|
|
|
|
@test "bootstrap_needed: OFFLINE_MODE=true means not needed" {
|
|
OFFLINE_MODE="true"
|
|
run bootstrap_needed
|
|
assert_failure
|
|
}
|
|
|
|
@test "bootstrap_needed: ODS_MODE=cloud means not needed" {
|
|
ODS_MODE="cloud"
|
|
run bootstrap_needed
|
|
assert_failure
|
|
}
|
|
|
|
# ── bootstrap constants ────────────────────────────────────────────────────
|
|
|
|
@test "BOOTSTRAP_GGUF_FILE: is set and non-empty" {
|
|
[[ -n "$BOOTSTRAP_GGUF_FILE" ]]
|
|
}
|
|
|
|
@test "BOOTSTRAP_GGUF_URL: is set and points to huggingface" {
|
|
[[ -n "$BOOTSTRAP_GGUF_URL" ]]
|
|
[[ "$BOOTSTRAP_GGUF_URL" == *"huggingface.co"* ]]
|
|
}
|
|
|
|
@test "BOOTSTRAP_LLM_MODEL: is set and non-empty" {
|
|
[[ -n "$BOOTSTRAP_LLM_MODEL" ]]
|
|
}
|
|
|
|
@test "BOOTSTRAP_MAX_CONTEXT: meets Hermes 64K floor" {
|
|
[[ "$BOOTSTRAP_MAX_CONTEXT" =~ ^[0-9]+$ ]]
|
|
[[ "$BOOTSTRAP_MAX_CONTEXT" -ge 64000 ]]
|
|
}
|