Add tests for uploading documents to greenboard#418
Conversation
There was a problem hiding this comment.
Pull request overview
This PR adds regression tests for the greenboard upload flow and introduces an IntegrationTestRun Pydantic model to formalize the document shape uploaded by GreenboardUploader. The upgrade-batch path is refactored to call a new _upsert() helper directly, while normal uploads now go through a typed model serialized with aliases. The tests cover both the uploader and the autouse pytest fixture, exercising config gating, marker handling, exception handling, and plugin lifecycle.
Changes:
- Introduce
IntegrationTestRunPydantic model and route normal uploads through it via_upload_document→_upsert. - Split
_upload_document(typed) from_upsert(dict-based), withupload_upgrade_batchnow calling_upsertdirectly. - Add comprehensive tests in
client/tests/test_greenboarduploader.pyfor the uploader and the greenboard fixture.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
| client/src/cbltest/greenboarduploader.py | Adds IntegrationTestRun model; splits upload path into typed _upload_document and dict-based _upsert. |
| client/tests/test_greenboarduploader.py | New test module covering uploader counting, version parsing, fixture gating, marker handling, and plugin lifecycle. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
35f5736 to
4a42666
Compare
- Create a pydantic model to handle the data storage - Allows for writing regression tests for upload simplification
4a42666 to
943e282
Compare
| from cbltest.logging import cbl_info, cbl_warning | ||
|
|
||
|
|
||
| class IntegrationTestRun(BaseModel): |
There was a problem hiding this comment.
Not exactly the name I'd choose. We don't refer to these as integration tests anywhere. If anything they are E2ETestRuns or TestRunResult, or something.
There was a problem hiding this comment.
Yeah, I wanted to pick a name that didn't start with Test because that gets picked up as a test class by discovery.
This is a no-op modification to add regression tests for greenboard uploading so that modifications like #414 can be more clear about what code they are or are not changing.