File size: 1,411 Bytes
fe64236
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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
#!/bin/bash

echo "πŸ” Running local validation..."

FAILED=0

# ============================================================
# πŸ“‚ FILE CHECK
# ============================================================

REQUIRED_FILES=(
    "pydebug_optimizer/env.py"
    "pydebug_optimizer/models.py"
    "pydebug_optimizer/grader.py"
    "pydebug_optimizer/tasks.py"
    "inference.py"
    "openenv.yaml"
)

for file in "${REQUIRED_FILES[@]}"; do
    if [ ! -f "$file" ]; then
        echo "❌ Missing file: $file"
        FAILED=1
    fi
done

# ============================================================
# πŸ§ͺ RUN TESTS
# ============================================================

echo "πŸ§ͺ Running pytest..."
pytest tests/
if [ $? -ne 0 ]; then
    echo "❌ Tests failed"
    FAILED=1
fi

# ============================================================
# πŸš€ ENTRYPOINT CHECK
# ============================================================

echo "πŸš€ Checking inference entrypoint..."
python inference.py > /dev/null 2>&1
if [ $? -ne 0 ]; then
    echo "❌ inference.py failed"
    FAILED=1
fi

# ============================================================
# βœ… FINAL RESULT
# ============================================================

if [ $FAILED -eq 0 ]; then
    echo -e "\033[0;32mβœ… VALIDATION SUCCESSFUL\033[0m"
    exit 0
else
    echo -e "\033[0;31m❌ VALIDATION FAILED\033[0m"
    exit 1
fi