cog
39343a13 - test: add 12 integration tests covering identified coverage gaps (#2845)

Commit
17 days ago
test: add 12 integration tests covering identified coverage gaps (#2845) * test: enhance harness to expose error bodies in curl and webhook assertions - ! curl now writes response body to stderr for error body assertions - webhookResult captures ErrorMessage string for failed prediction webhook tests * test: add integration tests for error responses, nested types, iterator errors, sys.exit - prediction_error_response: verify JSON shape for ValueError/RuntimeError/Exception - nested_output_types: BaseModel-in-BaseModel, List[BaseModel], Optional nested fields - iterator_error_midstream: generator yields then raises, webhook captures failure - predict_sys_exit: sys.exit() fails prediction but worker survives for next request * test: add integration tests for concurrency limit, state leak, webhook failure, SIGTERM - TestConcurrentAboveLimit: 409 when exceeding max_concurrency - TestSIGTERMDuringSetup: clean shutdown when SIGTERM arrives during setup - sequential_state_leak: documents module-level state persistence across calls - webhook_delivery_failure: server stays healthy when webhook URL is unreachable - webhook_prediction_error: failed prediction webhook payload has error fields * test: add integration tests for complex schema, large file upload, async generator - build_openapi_schema_complex: constraints, choices, Secret, Optional, BaseModel output - coglet_large_file_upload_serial: 50 MiB binary file through upload URL pipeline - async_generator_precollect: verify async generator output is pre-collected * fix: resolve CI failures in nested_output_types and iterator_error_midstream nested_output_types: rewrite test to use supported types only. Cog's type system does not support nested BaseModel fields (FieldType.from_type raises ValueError for custom types without a Coder). Test now covers multiple primitive types, Optional, and List[str] in a flat BaseModel. iterator_error_midstream: fix webhook harness Output field type. The webhook payload's output field is a JSON array for iterator predictions (not a string), causing json.Decode to fail with UnmarshalTypeError. The harness returned 400, coglet gave up (400 is not retryable), and the test hung forever. Changed Output from string to json.RawMessage to handle both string and array outputs.
Author
Parents
Loading