File size: 2,777 Bytes
202d151
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
@echo off
setlocal
title Montaigne - Local Tests

set "APP=%~dp0"
set "PASS=0"
set "FAIL=0"
set "SKIP=0"

echo.
echo ═══════════════════════════════════════════════════════════
echo  Montaigne - Running local tests
echo ═══════════════════════════════════════════════════════════
echo.

REM ── Activate venv if available ─────────────────────────────
if exist "%APP%venv\Scripts\activate.bat" (
    call "%APP%venv\Scripts\activate.bat"
)

REM ── Test 1: DB smoke test (uses local SQLite, no DB needed) ─
echo [1/3] Database + Auth smoke test...
echo.
python "%APP%test_db.py"
if errorlevel 1 (
    echo [FAIL] DB smoke test
    set /a FAIL+=1
) else (
    set /a PASS+=1
)
echo.
echo ───────────────────────────────────────────────────────────
echo.

REM ── Test 2: API connectivity (needs ATLASCLOUD_API_KEY) ────
echo [2/3] LLM API connectivity test...
echo.
python "%APP%check_api.py"
if errorlevel 1 (
    echo [FAIL] API test
    set /a FAIL+=1
) else (
    set /a PASS+=1
)
echo.
echo ───────────────────────────────────────────────────────────
echo.

REM ── Test 3: Server health check (needs DB + API keys) ─────
echo [3/3] Server health check...
echo.
python "%APP%check_server.py"
if errorlevel 1 (
    echo [FAIL] Server health check
    set /a FAIL+=1
) else (
    set /a PASS+=1
)
echo.
echo ───────────────────────────────────────────────────────────
echo.

REM ── Summary ───────────────────────────────────────────────
set /a TOTAL=%PASS%+%FAIL%
echo ═══════════════════════════════════════════════════════════
echo  Results:  %PASS%/%TOTAL% passed
if %FAIL% GTR 0 (
    echo            %FAIL% FAILED
) else (
    echo            All tests passed!
)
echo ═══════════════════════════════════════════════════════════
echo.
pause
exit /b %FAIL%