Skip to content

Junit functional upload#419

Merged
vipbhardwaj merged 11 commits into
mainfrom
junit-functional-upload
Jun 8, 2026
Merged

Junit functional upload#419
vipbhardwaj merged 11 commits into
mainfrom
junit-functional-upload

Conversation

@vipbhardwaj

@vipbhardwaj vipbhardwaj commented Jun 1, 2026

Copy link
Copy Markdown
Contributor

torcolvin and others added 3 commits May 26, 2026 21:51
- Create a pydantic model to handle the data storage
- Allows for writing regression tests for upload simplification

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 enhances Greenboard result uploads by deriving pass/fail counts from pytest’s JUnit XML output (when available), falling back to the existing in-process hook counters otherwise. It also refactors the uploaded payload into a typed RunResult model and adds unit tests around the uploader and fixture behavior.

Changes:

  • Add JUnit XML parsing (junitparser) and use it in the greenboard session fixture to determine pass/fail counts.
  • Refactor Greenboard upload payload construction to use a RunResult Pydantic model and centralize timestamp/upsert logic.
  • Add comprehensive unit tests for GreenboardUploader and the greenboard fixture.

Reviewed changes

Copilot reviewed 4 out of 5 changed files in this pull request and generated 2 comments.

Show a summary per file
File Description
uv.lock Locks the new junitparser dependency in the workspace.
client/pyproject.toml Adds junitparser dependency and configures pytest to emit a JUnit XML by default.
client/src/cbltest/plugins/greenboard_fixture.py Reads JUnit XML (when present) to prefer XML-derived counts for Greenboard uploads.
client/src/cbltest/greenboarduploader.py Implements JUnit XML counting helper and refactors upload document construction to RunResult.
client/tests/test_greenboarduploader.py Adds unit tests validating uploader payloads and fixture upload behavior.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread client/src/cbltest/plugins/greenboard_fixture.py
Comment thread client/tests/test_greenboarduploader.py
@torcolvin

Copy link
Copy Markdown
Collaborator

Some of these fixtures are very similar to #418, I'll see about @borrrden merging that PR so we can reuse them. It would be fine to move these to conftest.py for reuse in unit tests.

Do you have an example jenkins job that picks these up? You can fork this branch to just run in jenkins.

  1. Modify a single Jenkinsfile so that we see the uploads in jenkins. (We might need to add a plugin to jenkins)
  2. Change the test execution so that it runs only two tests (for speed of visualization), one failing test and one passing tests.
  3. Link to the results

We want to make sure that we can see the results separately, which might need to set junit_suite_name, but until we see this in Jenkins, I'm not sure.

Comment thread client/src/cbltest/plugins/greenboard_fixture.py Outdated
Comment thread client/src/cbltest/plugins/greenboard_fixture.py Outdated
Comment thread client/src/cbltest/greenboarduploader.py Outdated
Comment thread client/src/cbltest/greenboarduploader.py Outdated
Comment thread client/src/cbltest/greenboarduploader.py Outdated
Comment thread client/src/cbltest/greenboarduploader.py Outdated
Comment thread client/src/cbltest/greenboarduploader.py Outdated
@vipbhardwaj vipbhardwaj requested a review from borrrden June 1, 2026 14:36

@torcolvin torcolvin left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

This can be in a separate PR, but I want a PR that adds to toplevel pytest.ini tools.pytest.ini_options

junit_xml = "junit_report.xml"
junit_output = "all"
junit_log_passing_tests = false # don't store output for passing tests

For the tests which self aggregate junit files, you can do pytest -o junit_xml=custom_name.xml

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 4 out of 5 changed files in this pull request and generated 2 comments.

Comment thread client/src/cbltest/greenboarduploader.py Outdated
Comment thread client/src/cbltest/greenboarduploader.py Outdated
@vipbhardwaj vipbhardwaj changed the base branch from main to greenboard-uploader-tests June 1, 2026 16:35
@vipbhardwaj vipbhardwaj requested a review from Copilot June 1, 2026 16:35

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 4 out of 5 changed files in this pull request and generated 5 comments.

Comment thread client/src/cbltest/greenboarduploader.py Outdated
Comment thread client/src/cbltest/greenboarduploader.py Outdated
Comment thread client/src/cbltest/greenboarduploader.py Outdated
Comment thread client/src/cbltest/greenboarduploader.py Outdated
Comment thread client/src/cbltest/greenboarduploader.py
Base automatically changed from greenboard-uploader-tests to main June 1, 2026 21:56

@borrrden borrrden left a comment

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.

I think this is ok as long as the stray file for checking commit message is removed

Comment thread scripts/hooks/check-commit-msg.sh Outdated
@vipbhardwaj

Copy link
Copy Markdown
Contributor Author

Since this can be in a separate PR, and Tor is in a recovery for a while, I will merge this PR for now, based on resolving all of his comments and Jim's PR approval as well.

I will work on that separate PR related suggestion and will implement it as a part of Upgrade Test related Junit implementation, SINCE THIS PR ONLY CONCERNS WITH FUNCTIONAL TESTS, hence no AGGREGATION of pytest files.

@vipbhardwaj vipbhardwaj merged commit 5e3d4c4 into main Jun 8, 2026
5 checks passed
@vipbhardwaj vipbhardwaj deleted the junit-functional-upload branch June 8, 2026 14:16
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.

4 participants