Download task_033/tests/test.sh from Lego-X/UXInteract: direct link, hf CLI and curl.
- Browser
- Download file 2.94 kB
-
https://huggingface.co/datasets/Lego-X/UXInteract/resolve/main/task_033/tests/test.sh
- Command line
-
hf download hf://datasets/Lego-X/UXInteract/task_033/tests/test.sh
-
curl -L -o test.sh https://huggingface.co/datasets/Lego-X/UXInteract/resolve/main/task_033/tests/test.sh
2.94 kB
| set -euo pipefail | |
| set +e | |
| TASK_ID='49' | |
| TEST_DIR="$(cd "$(dirname "$0")" && pwd)" | |
| source "$TEST_DIR/_shared/static_enhancer.sh" | |
| OFFLINE_PYTHONPATH="$TEST_DIR/_offline${PYTHONPATH:+:$PYTHONPATH}" | |
| RUN_ENV=(env PYTHONHASHSEED=0 PYTHONPATH="$OFFLINE_PYTHONPATH" HF_DATASETS_OFFLINE=1 TRANSFORMERS_OFFLINE=1 WANDB_MODE=offline NO_PROXY='' HTTP_PROXY='http://127.0.0.1:9' HTTPS_PROXY='http://127.0.0.1:9' ALL_PROXY='http://127.0.0.1:9') | |
| LOG_DIR="/logs/verifier" | |
| if ! mkdir -p "$LOG_DIR" 2>/dev/null; then LOG_DIR="logs/verifier"; mkdir -p "$LOG_DIR"; fi | |
| REWARD_FILE="$LOG_DIR/reward.txt" | |
| echo 0 > "$REWARD_FILE" | |
| if [ ! -f solve.py ]; then | |
| echo "solve.py entrypoint missing" | |
| exit 0 | |
| fi | |
| PASS=1 | |
| CHECKS=0 | |
| FAILS=0 | |
| note() { echo "[Task $TASK_ID] $*"; } | |
| fail() { note "FAIL: $*"; PASS=0; FAILS=$((FAILS+1)); } | |
| check() { CHECKS=$((CHECKS+1)); "$@"; local code=$?; if [ $code -ne 0 ]; then fail "$*"; fi; } | |
| have_any() { local pattern="$1"; compgen -G "$pattern" >/dev/null 2>&1; } | |
| grep_any() { local pattern="$1"; shift; grep -REiq -- "$pattern" "$@" 2>/dev/null; } | |
| source_files() { find . -type f \( -name '*.html' -o -name '*.js' -o -name '*.jsx' -o -name '*.ts' -o -name '*.tsx' -o -name '*.css' -o -name '*.py' -o -name '*.go' -o -name '*.swift' -o -name '*.svg' \) ! -path './tests/*' ! -path './logs/*'; } | |
| note "enhanced deterministic verifier start" | |
| static_enhance_check "${TASK_ID}" "$(pwd)" | |
| mapfile -t py_files < <(find . -type f -name '*.py' ! -path './tests/*') | |
| if [ ${#py_files[@]} -eq 0 ]; then fail "no Python source found"; fi | |
| if command -v python3 >/dev/null 2>&1; then | |
| for f in "${py_files[@]}"; do timeout 30s "${RUN_ENV[@]}" python3 -m py_compile "$f" >/tmp/harbor_py_compile.log 2>&1 || fail "python compile failed: $f"; done | |
| fi | |
| if command -v python3 >/dev/null 2>&1 && [ -f solve.py ]; then | |
| timeout 60s "${RUN_ENV[@]}" python3 solve.py >/tmp/harbor_data_run.log 2>&1 || fail "data script did not run successfully" | |
| else | |
| fail "solve.py entrypoint missing" | |
| fi | |
| check test -s 'mnist_samples.png' | |
| check test -s 'report.html' | |
| if command -v python3 >/dev/null 2>&1; then | |
| check timeout 180s "${RUN_ENV[@]}" python3 "$TEST_DIR/validate_outputs.py" | |
| check timeout 180s "${RUN_ENV[@]}" python3 "$TEST_DIR/validate_enhanced.py" | |
| check timeout 180s "${RUN_ENV[@]}" python3 "$TEST_DIR/validate_contract.py" | |
| else | |
| fail "python3 unavailable for output validation" | |
| fi | |
| # BEGIN AAAV_DYNAMIC_TEST | |
| if [ -f "$TEST_DIR/validate_aaav_dynamic.js" ]; then | |
| if command -v node >/dev/null 2>&1; then | |
| GLOBAL_NODE_PATH="${NODE_PATH:-$(npm root -g 2>/dev/null)}" | |
| check timeout 90s "${RUN_ENV[@]}" env NODE_PATH="$GLOBAL_NODE_PATH" node "$TEST_DIR/validate_aaav_dynamic.js" | |
| else | |
| fail "node is required for browser validation" | |
| fi | |
| fi | |
| # END AAAV_DYNAMIC_TEST | |
| note "checks=$CHECKS fails=$FAILS" | |
| if [ "$PASS" -eq 1 ]; then | |
| echo 1 > "$REWARD_FILE" | |
| note "PASS" | |
| exit 0 | |
| fi | |
| echo 0 > "$REWARD_FILE" | |
| note "FAIL" | |
| exit 0 | |