Skip to content
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

Add TestRunResultProcessor for JUnit-style XML output #17

Merged
merged 3 commits into from
Apr 19, 2024

Conversation

guusdk
Copy link
Contributor

@guusdk guusdk commented Apr 16, 2024

Smack will be configurable with optional TestRunResultProcessor instances, which will operate on the outcome of the executed tests. This commit adds a processor that generates an XML file that mimics the JUnit-style reporting.

When Smack is configured to use the new processor introduced by this commit (org.igniterealtime.smack.inttest.util.JUnitXmlTestRunResultProcessor) then a file naed test-results.xml will be created in the directory identified by the system property logDir.

@guusdk guusdk marked this pull request as ready for review April 18, 2024 17:33
@guusdk guusdk force-pushed the junit-xml-output branch 5 times, most recently from 3d7d3a1 to 6c91abb Compare April 19, 2024 13:12
Smack will be configurable with optional TestRunResultProcessor instances, which will operate on the outcome of the executed tests. This commit adds a processor that generates an XML file that mimics the JUnit-style reporting.

When Smack is configured to use the new processor introduced by this commit (`org.igniterealtime.smack.inttest.util.JUnitXmlTestRunResultProcessor`) then a file named `test-results.xml` will be created in the directory identified by the system property `logDir`.
@guusdk
Copy link
Contributor Author

guusdk commented Apr 19, 2024

For brownie points, I added a step in the workflow of this repo that processes the JUnit-style XML output, and generates UI elements from that (there's an additional 'check' in this PR, and the summary of the build shows a table, as shown below).

I'd love to be able to group the test outcome per XEP, but I'm not sure if that's possible with this particular tool. I've asked the author in mikepenz/action-junit-report#1080

image

@guusdk guusdk requested a review from Fishbowler April 19, 2024 13:50
uses: mikepenz/action-junit-report@v4
if: always() # always run even if the previous step fails
with:
report_paths: '**/test-results.xml'
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
report_paths: '**/test-results.xml'
report_paths: '**/test-results.xml'
suiteRegex: '*'

My guess at a workaround for mikepenz/action-junit-report#1080

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Unexpected input(s) 'suiteRegex', valid inputs are ['token', 'github_token', 'report_paths', 'test_files_prefix', 'exclude_sources', 'suite_regex', 'annotate_only', 'check_annotations', 'update_check', 'check_name', 'commit', 'fail_on_failure', 'require_tests', 'require_passed_tests', 'include_passed', 'check_title_template', 'summary', 'check_retries', 'transformers', 'job_summary', 'detailed_summary', 'annotate_notice', 'follow_symlink', 'job_name', 'annotations_limit', 'truncate_stack_traces']

Trying again with suite_regex...

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Sadly, that didn't make a difference:
image

@Fishbowler
Copy link
Contributor

The regex change to the job has changed the reporting from

MoodIntegrationTest.testNotificationAfterFilterChange (Normal)

to

MoodIntegrationTest.XEP-0107: User Mood/MoodIntegrationTest.testNotificationAfterFilterChange (Normal)

Which is more information, but unsure if it's actually nicer.

@Fishbowler Fishbowler merged commit 1956aa6 into main Apr 19, 2024
4 checks passed
@Fishbowler
Copy link
Contributor

Merged. We'll change the reporting separately, if we're able.

@Fishbowler Fishbowler deleted the junit-xml-output branch April 19, 2024 17:13
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.

2 participants