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