Conghao97's picture tcftrees's picture
ProgramGen release
d086025
Raw History Blame Contribute Delete
1.84 kB
FROM programgen-forward/aastopher_1776_sutools.a1cb9bd:inference
WORKDIR /workspace/repo
COPY python_install_contract.json /opt/programgen/python_install_contract.json
# at eval time: the model's reconstructed repo is copied into the workspace,
# then tests/test.sh applies tests/test_patch.diff and runs the suite.
# test command: bash -lc set -uo pipefail run=(python3 -m pytest -vv --continue-on-collection-errors -o addopts= tests/test_bench_handler.py tests/test_cli_handler.py tests/test_log_handler.py tests/test_meta_handler.py tests/test_sutools.py) if [ -n "${COVERAGE_FILE:-}" ]; then run=(python3 -m coverage run --source=. -m pytest -vv --continue-on-collection-errors -o addopts= tests/test_bench_handler.py tests/test_cli_handler.py tests/test_log_handler.py tests/test_meta_handler.py tests/test_sutools.py); fi collect=(python3 -m pytest -q -o addopts= tests/test_bench_handler.py tests/test_cli_handler.py tests/test_log_handler.py tests/test_meta_handler.py tests/test_sutools.py) collected_output=$("${collect[@]}" --collect-only) collect_rc=$? if [ "$collect_rc" -ne 0 ] && [ "$collect_rc" -ne 5 ]; then printf "%s\n" "$collected_output" >&2 printf "[programgen] test collection failed with exit code %s\n" "$collect_rc" >&2 exit "$collect_rc" fi mapfile -t collected < <(printf "%s\n" "$collected_output" | sed -n '/::/p' | sed 's/[[:space:]]*$//') if [ "${#collected[@]}" -gt 500 ]; then while IFS= read -r id; do run+=("--deselect=$id"); done < <(printf "%s\n" "${collected[@]}" | awk -F'::' -v limit=500 '{f=$1; n[f]++; idx[f,n[f]]=NR; all[NR]=$0; if(!(f in seen)){seen[f]=1; order[++m]=f}} END{d=1; c=0; while(c<limit){a=0; for(i=1;i<=m;i++){f=order[i]; if(d<=n[f]){keep[idx[f,d]]=1; c++; a=1; if(c>=limit) break}} if(!a) break; d++} for(r=1;r<=NR;r++) if(!(r in keep)) print all[r]}') fi "${run[@]}"; exit $?