-
Notifications
You must be signed in to change notification settings - Fork 27
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat(junit-merger): add flag to preserve Python test cases and "is_unity_case" attribute #324
feat(junit-merger): add flag to preserve Python test cases and "is_unity_case" attribute #324
Conversation
5bc9a36
to
e9d6504
Compare
Hi @hfudev . could you please help with the review of the current PR? The test cases failing in the CI appear unrelated to the changes in this PR. It seems they are also failing on the main branch. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@alekseiapa Thanks for the PR! Left a few comments.
e9d6504
to
c400240
Compare
Hi @hfudev . Could you please have a brief look one more time ? Thanks! |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM. only a few nitpicks about coding styles
besides, since we're generating the release notes from the commit history, better to split up the commit to two:
|
655e07f
to
d9b482b
Compare
Hi @hfudev . One more time please ? :) |
d9b482b
to
b415e1a
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
sorry to be picky. one more round :D
b415e1a
to
e3856b5
Compare
@hfudev one more attempt :) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Many thanks. I'll merge this PR and fix these two nitpicks with other small fixes later in my PR
@@ -111,6 +111,16 @@ def pytest_addoption(parser): | |||
help='y/yes/true for True and n/no/false for False. ' | |||
'Set to True to prettify XML junit report. (Default: False)', | |||
) | |||
parser.addoption( | |||
'--unity-test-report-mode', | |||
choices=[UnityTestReportMode.REPLACE.value, UnityTestReportMode.MERGE.value], |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
choices=[UnityTestReportMode.REPLACE.value, UnityTestReportMode.MERGE.value], | |
choices=[v.value for v in UnityTestReportMode], |
@@ -1183,7 +1193,9 @@ def unity_tester(dut: t.Union['IdfDut', t.Tuple['IdfDut']]) -> t.Optional['CaseT | |||
|
|||
|
|||
def pytest_configure(config: Config) -> None: | |||
config.stash[_junit_merger_key] = JunitMerger(config.option.xmlpath) | |||
config.stash[_junit_merger_key] = JunitMerger( | |||
config.option.xmlpath, config.getoption('unity_test_report_mode', default='replace') |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
missed one
Thank you for the review ! |
Description
New Features
Introduced the
--unity-test-report-mode
FlagAdded the
is_unity_case
Attribute to Test Casesis_unity_case="1"
: Indicates a Python test case.is_unity_case="0"
: Indicates a non-Python test case (e.g., C test case).Bug-fixes
line
andfile
Attributes in XML Reports[dut-X]
prefixes fromline
andfile
attributes in the XML report for clarity.Example Usage
Default Behavior (Without Flag)
--unity-test-report-mode
:Related
No related issues
Testing
Environment
Default Behavior (Without
--unity-test-report-mode
):is_unity_case="0"
for all non-Python test cases.With
--unity-test-report-mode
Flag:is_unity_case="1"
.is_unity_case="0"
.XML Validation:
file
andline
attributes (removed[dut-X]
).is_unity_case
attribute.Checklist
Before submitting a Pull Request, please ensure the following: