Conghao97's picture tcftrees's picture
ProgramGen release
d086025
Raw History Blame Contribute Delete
4.05 kB
FROM programgen-forward/acefire6_1776_phx_events.8f63e89: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=-p no:hypothesispytest' tests/test_client/test_context_manager.py tests/test_client/test_event_processor.py tests/test_client/test_init.py tests/test_client/test_parse_message.py tests/test_client/test_process_topic_registration_responses.py tests/test_client/test_process_websocket_messages.py tests/test_client/test_register_event_handler.py tests/test_client/test_register_topic_subscription.py tests/test_client/test_send_message.py tests/test_client/test_shutdown.py tests/test_client/test_start_processing.py tests/test_client/test_subscribe_to_registered_topics.py tests/test_json_handler/test_decimal_serialiser.py tests/test_json_handler/test_deep_float_replace.py tests/test_json_handler/test_dumps.py tests/test_json_handler/test_loads.py tests/test_phx_messages/test_phx_event_message.py tests/test_phx_messages/test_phx_message.py tests/test_utils.py) if [ -n "${COVERAGE_FILE:-}" ]; then run=(python3 -m coverage run --source=. -m pytest -vv --continue-on-collection-errors -o 'addopts=-p no:hypothesispytest' tests/test_client/test_context_manager.py tests/test_client/test_event_processor.py tests/test_client/test_init.py tests/test_client/test_parse_message.py tests/test_client/test_process_topic_registration_responses.py tests/test_client/test_process_websocket_messages.py tests/test_client/test_register_event_handler.py tests/test_client/test_register_topic_subscription.py tests/test_client/test_send_message.py tests/test_client/test_shutdown.py tests/test_client/test_start_processing.py tests/test_client/test_subscribe_to_registered_topics.py tests/test_json_handler/test_decimal_serialiser.py tests/test_json_handler/test_deep_float_replace.py tests/test_json_handler/test_dumps.py tests/test_json_handler/test_loads.py tests/test_phx_messages/test_phx_event_message.py tests/test_phx_messages/test_phx_message.py tests/test_utils.py); fi collect=(python3 -m pytest -q -o 'addopts=-p no:hypothesispytest' tests/test_client/test_context_manager.py tests/test_client/test_event_processor.py tests/test_client/test_init.py tests/test_client/test_parse_message.py tests/test_client/test_process_topic_registration_responses.py tests/test_client/test_process_websocket_messages.py tests/test_client/test_register_event_handler.py tests/test_client/test_register_topic_subscription.py tests/test_client/test_send_message.py tests/test_client/test_shutdown.py tests/test_client/test_start_processing.py tests/test_client/test_subscribe_to_registered_topics.py tests/test_json_handler/test_decimal_serialiser.py tests/test_json_handler/test_deep_float_replace.py tests/test_json_handler/test_dumps.py tests/test_json_handler/test_loads.py tests/test_phx_messages/test_phx_event_message.py tests/test_phx_messages/test_phx_message.py tests/test_utils.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 $?