feat(doc-maker): upgrade SDK to 2.0.0, add pytest unit tests#281
feat(doc-maker): upgrade SDK to 2.0.0, add pytest unit tests#281
Conversation
- Pin autohive-integrations-sdk to ~=2.0.0 in requirements.txt - Wrap all action returns in ActionResult(data=..., cost_usd=0.0) - Return ActionError(message=...) for all error paths (missing docs, invalid input) - Extract _save_document_to_dict() internal helper; refactor save_and_return_document to return ActionResult - Add try/except ValueError around load_document_from_files() in all action handlers - Remove 'error' fields from all output schemas in config.json - Bump config.json version to 2.0.0 - Add doc-maker/tests/conftest.py with sys.path insert - Add doc-maker/tests/test_doc_maker_unit.py with 51 pytest unit tests covering all 8 actions plus pure helper functions
🔍 Integration Validation ResultsCommit: Changed directories:
✅ Structure Check output
|
TheRealAgentK
left a comment
There was a problem hiding this comment.
SDK 2.0.0 migration looks clean and the 51 unit tests cover the 8 actions plus the helper functions well. Local CI verified: validate_integration ✅, check_code ✅, ruff ✅, pytest ✅.
Blocking on one thing: no tests/test_doc_maker_integration.py. doc-maker has no auth (pure compute) so e2e coverage is the easiest of the entire batch — no env vars at all, just real document generation through the actions. Please add at least a happy-path test that creates a document, adds content, and verifies the binary output. See the writing-integration-tests skill for structure.
Also: branch name worktree-agent-* doesn't follow <type>/<issue#>/<desc> per AGENTS.md, and no linked issue.
The review comments have largely been addressed - going forward I'll be more critical about branch names. However, we need to get this update out ASAP so I won't block on that for now. The tests have been updated and pass CI. Dismissing this review
Summary
autohive-integrations-sdkfrom~=1.0.2to~=2.0.0indoc-maker/requirements.txtActionResult(data=..., cost_usd=0.0)— no more bare dict returnsActionError(message=...)— missing document IDs, invalid inputs, image-not-found_save_document_to_dict()internal helper to avoid callingexecute()fromsave_and_return_document"error"fields from all output schemas inconfig.jsonconfig.jsonversion to2.0.0doc-maker/tests/conftest.pywith standardsys.pathinsertdoc-maker/tests/test_doc_maker_unit.pywith 51 pytest unit tests covering all 8 actions plus 4 pure helper function test classesTest plan
python -m pytest doc-maker/ -v— 51 passedvalidate_integration.py doc-maker— all checks passedcheck_code.py doc-maker— CODE CHECK PASSEDruff check --fixandruff format— no issues