Files
light-heart-labs--dreamserver/ods/tests/test-windows-report-command.sh
T
wehub-resource-sync 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
chore: import upstream snapshot with attribution
2026-07-13 12:31:33 +08:00

51 lines
2.4 KiB
Bash

#!/bin/bash
# ============================================================================
# ODS Windows report command tests
# ============================================================================
# Static checks for the Windows ods.ps1 "report" command wiring.
# ============================================================================
set -euo pipefail
SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
ROOT_DIR="$(cd "$SCRIPT_DIR/.." && pwd)"
ODS_PS1="$ROOT_DIR/installers/windows/ods.ps1"
REPORT_LIB="$ROOT_DIR/installers/windows/lib/install-report.ps1"
LLM_HELPER_LIB="$ROOT_DIR/installers/windows/lib/llm-endpoint.ps1"
GREEN='\033[0;32m'
RED='\033[0;31m'
NC='\033[0m'
PASS=0
FAIL=0
pass() { echo -e " ${GREEN}PASS${NC} $1"; PASS=$((PASS + 1)); }
fail() { echo -e " ${RED}FAIL${NC} $1"; FAIL=$((FAIL + 1)); }
echo ""
echo "=== Windows report command tests ==="
echo ""
[[ -f "$ODS_PS1" ]] && pass "ods.ps1 exists" || fail "ods.ps1 missing"
[[ -f "$REPORT_LIB" ]] && pass "install-report.ps1 exists" || fail "install-report.ps1 missing"
[[ -f "$LLM_HELPER_LIB" ]] && pass "llm-endpoint.ps1 exists" || fail "llm-endpoint.ps1 missing"
grep -q "install-report.ps1" "$ODS_PS1" && pass "ods.ps1 sources report library" || fail "ods.ps1 missing report library source"
grep -q "llm-endpoint.ps1" "$ODS_PS1" && pass "ods.ps1 sources llm endpoint helper" || fail "ods.ps1 missing llm endpoint helper source"
grep -q "function Invoke-Report" "$ODS_PS1" && pass "Invoke-Report function exists" || fail "Invoke-Report function missing"
grep -q '"report" { Invoke-Report }' "$ODS_PS1" && pass "report command dispatch exists" || fail "report command dispatch missing"
grep -q "Generate Windows diagnostics bundle" "$ODS_PS1" && pass "help text includes report command" || fail "help text missing report command"
grep -q "function Write-ODSInstallReport" "$REPORT_LIB" && pass "report writer function exists" || fail "report writer function missing"
grep -q "windows-report" "$REPORT_LIB" && pass "report output path is defined" || fail "report output path missing"
grep -q "Get-WindowsLocalLlmEndpoint" "$REPORT_LIB" && pass "report uses shared llm endpoint helper" || fail "report missing shared llm endpoint helper"
if grep -q 'http://localhost:8080/health' "$REPORT_LIB"; then
fail "report lib still hardcodes localhost:8080/health"
else
pass "report lib does not hardcode localhost:8080/health"
fi
echo ""
echo "Result: $PASS passed, $FAIL failed"
[[ $FAIL -eq 0 ]]