Skip to content

Add tests for uploading documents to greenboard#418

Merged
torcolvin merged 2 commits into
mainfrom
greenboard-uploader-tests
Jun 1, 2026
Merged

Add tests for uploading documents to greenboard#418
torcolvin merged 2 commits into
mainfrom
greenboard-uploader-tests

Conversation

@torcolvin

Copy link
Copy Markdown
Collaborator
  • Create a pydantic model to handle the data storage so future modifications are more clear.
  • Allows for writing regression tests for upload simplification

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.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 IntegrationTestRun Pydantic model and route normal uploads through it via _upload_document_upsert.
  • Split _upload_document (typed) from _upsert (dict-based), with upload_upgrade_batch now calling _upsert directly.
  • Add comprehensive tests in client/tests/test_greenboarduploader.py for 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.

@torcolvin torcolvin force-pushed the greenboard-uploader-tests branch from 35f5736 to 4a42666 Compare May 27, 2026 01:50
- Create a pydantic model to handle the data storage
- Allows for writing regression tests for upload simplification
from cbltest.logging import cbl_info, cbl_warning


class IntegrationTestRun(BaseModel):

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah, I wanted to pick a name that didn't start with Test because that gets picked up as a test class by discovery.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 2 out of 2 changed files in this pull request and generated no new comments.

@torcolvin torcolvin mentioned this pull request Jun 1, 2026
@torcolvin torcolvin merged commit c42562a into main Jun 1, 2026
6 checks passed
@torcolvin torcolvin deleted the greenboard-uploader-tests branch June 1, 2026 21:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants