forked from mtusi2026/mtusi2026lab5
Complete Lab 5 grade 4 async attachment pipeline
This commit is contained in:
@@ -0,0 +1,8 @@
|
||||
{
|
||||
"result": "PASS",
|
||||
"observed_at_utc": "2026-11-16T13:10:29.667433+00:00",
|
||||
"attachment_id": "480e6b78-e420-45df-bc0d-92561e7bb8ec",
|
||||
"status_after_broker_restart": "ready",
|
||||
"stream_entry_survived_volume_restart": true,
|
||||
"worker_completed_same_attachment": true
|
||||
}
|
||||
@@ -0,0 +1 @@
|
||||
PASS: offline skeleton structure, local refs and Python syntax; application NOT tested.
|
||||
@@ -0,0 +1,46 @@
|
||||
{
|
||||
"result": "PASS",
|
||||
"accepted_status": "queued",
|
||||
"final_status": "ready",
|
||||
"source_bytes": 5490,
|
||||
"source_sha256": "1f0c92118f143ec4db15cb109de28621b293f0679db25a2bbd74b419e14c7fe8",
|
||||
"original_unchanged": true,
|
||||
"variants": {
|
||||
"crop": {
|
||||
"content_type": "image/jpeg",
|
||||
"dimensions": [
|
||||
128,
|
||||
128
|
||||
],
|
||||
"size_bytes": 382,
|
||||
"sha256": "686744b92be403b0b4a52bfcc658b17b51352efdbaab4b4da402aa7074407edd",
|
||||
"exif_removed": true
|
||||
},
|
||||
"optimized": {
|
||||
"content_type": "image/webp",
|
||||
"dimensions": [
|
||||
640,
|
||||
480
|
||||
],
|
||||
"size_bytes": 628,
|
||||
"sha256": "db779e3fd7c5fd4734734916e9cf3f8eaedc9d1ff7f3ea7d477e92299be4823a",
|
||||
"exif_removed": true
|
||||
},
|
||||
"thumbnail": {
|
||||
"content_type": "image/jpeg",
|
||||
"dimensions": [
|
||||
256,
|
||||
192
|
||||
],
|
||||
"size_bytes": 574,
|
||||
"sha256": "aa1e313cc044fb934663ef96a7d13d4f321a3b638f74e8a3e528180dba78a8b4",
|
||||
"exif_removed": true
|
||||
}
|
||||
},
|
||||
"rejected_inputs": {
|
||||
"corrupt_image": 415,
|
||||
"mime_mismatch": 415,
|
||||
"pixel_limit": 413,
|
||||
"byte_limit": 413
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,18 @@
|
||||
{
|
||||
"result": "PASS",
|
||||
"observed_at_utc": "2026-11-16T13:14:48.928114+00:00",
|
||||
"scenario": [
|
||||
"stopped dispatcher and worker",
|
||||
"received 202 and persisted queued attachment plus job/outbox transaction",
|
||||
"created a message referring to the queued attachment; content returned 409",
|
||||
"restarted API and confirmed the same queued record remained",
|
||||
"crashed one-shot dispatcher with exit 75 before Redis XADD",
|
||||
"restarted dispatcher and worker; the same attachment became ready"
|
||||
],
|
||||
"attachment_id": "31894cf1-3cf0-497a-b842-6b3ff3a56da9",
|
||||
"message_id": "de8ef62b-8d2b-41b2-b69d-ca64552f0ed4",
|
||||
"status_after_api_restart": "queued",
|
||||
"status_after_recovery": "ready",
|
||||
"thumbnail_content_type": "image/jpeg",
|
||||
"dispatcher_failpoint_exit": 75
|
||||
}
|
||||
@@ -0,0 +1,11 @@
|
||||
{
|
||||
"result": "PASS",
|
||||
"observed_at_utc": "2026-11-16T13:20:11.879453+00:00",
|
||||
"attachment_id": "297a8f47-cdcc-498b-9a07-e152216fde8e",
|
||||
"status_before_replay": "failed",
|
||||
"safe_error_code": "test_permanent_failure",
|
||||
"status_after_replay": "ready",
|
||||
"explicit_replay_command": "python -m src.app.replay_job <attachment_id>",
|
||||
"replay_audit_written": true,
|
||||
"source_retained_until_ready": true
|
||||
}
|
||||
@@ -0,0 +1,44 @@
|
||||
Lab 5 offline verification (2026-11-16T09:37:48Z)
|
||||
|
||||
python --version
|
||||
Python 3.12.0
|
||||
|
||||
docker compose version
|
||||
Docker Compose version v5.7.0
|
||||
|
||||
python scripts/check_contract.py
|
||||
PASS: offline skeleton structure, local refs and Python syntax; application NOT tested.
|
||||
|
||||
python scripts/validate_openapi.py
|
||||
PASS: full OpenAPI 3.1 and JSON Schema validation; application NOT tested.
|
||||
|
||||
python -m compileall -q src scripts tests student-tests
|
||||
PASS: exit code 0
|
||||
|
||||
docker compose --env-file .env config --quiet
|
||||
PASS: exit code 0
|
||||
|
||||
python student-tests/pipeline_unit.py
|
||||
PASS: thumbnail JPEG 256x192, crop JPEG 128x128, optimized WebP 640x480; EXIF removed; checksums valid.
|
||||
|
||||
Docker Engine access
|
||||
NOT RUN: Docker Desktop Linux Engine pipe returned permission denied. Containerized application and HTTP tests were not executed.
|
||||
|
||||
Follow-up: local PowerShell runtime verification (2026-11-16)
|
||||
python tests/smoke.py --base-url http://localhost:8084
|
||||
PASS: lab5 public API scenario; infrastructure and grading evidence remain separate.
|
||||
|
||||
python student-tests/grade4_pipeline.py --base-url http://localhost:8084
|
||||
PASS: see evidence/grade4-pipeline.json
|
||||
|
||||
python student-tests/broker_persistence.py --base-url http://localhost:8084
|
||||
PASS: see evidence/broker-persistence.json
|
||||
|
||||
python student-tests/outbox_recovery.py --base-url http://localhost:8084
|
||||
PASS: see evidence/outbox-recovery.json
|
||||
|
||||
python student-tests/worker_redelivery.py --base-url http://localhost:8084
|
||||
PASS: see evidence/worker-redelivery.json
|
||||
|
||||
python student-tests/replay_failed_job.py --base-url http://localhost:8084
|
||||
PASS: see evidence/replay-failed-job.json
|
||||
@@ -0,0 +1,3 @@
|
||||
Command: python tests/smoke.py --base-url http://localhost:8084
|
||||
Observed PowerShell output:
|
||||
PASS: lab5 public API scenario; infrastructure and grading evidence remain separate.
|
||||
@@ -0,0 +1,11 @@
|
||||
{
|
||||
"result": "PASS",
|
||||
"observed_at_utc": "2026-11-16T13:17:52.252178+00:00",
|
||||
"attachment_id": "3df146f7-9d87-431e-897d-b62be275e62b",
|
||||
"status_after_side_effect_commit": "ready",
|
||||
"status_after_redelivery": "ready",
|
||||
"variants_unchanged_after_redelivery": true,
|
||||
"worker_crash_exit": 75,
|
||||
"redelivery_worker_exit": 0,
|
||||
"ack_happened_after_committed_effect": true
|
||||
}
|
||||
Reference in New Issue
Block a user