Spaces:
Runtime error
Runtime error
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 |