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

opt: junit support split out; optimize display format #734

Merged
merged 1 commit into from
Jan 16, 2024

Conversation

yeshan333
Copy link
Contributor

Features:

  • Support outputting Junit XML reports in suite dimension. When the scale of test cases is large, combining with some CI systems (eg: Jenkins CI JUnit Realtime Test Reporter) can enable real-time viewing of test reports.

Optimizations:

After optimizations:

Reproduction demo: https://github.com/yeshan333/busted_junit_demo

@alerque
Copy link
Member

alerque commented Jan 15, 2024

Are there any junit consumers that would not benefit from this? As in, is there an argument for this being the default?

@yeshan333
Copy link
Contributor Author

Are there any junit consumers that would not benefit from this? As in, is there an argument for this being the default?
@alerque

This is very useful for users who use web UI to view test reports in CI System(eg:Jenkins. Junit is one of the most widely used testing frameworks in the Java ecosystem, while Jenkins is the most widely used automation system in the Java ecosystem.), But this will not have any impact on users who enjoy using terminals to view results.

Java's classes use (.) De-district the hierarchical structure of the project.

The original implementation resulted in an ugly use case hierarchy for CI splitting.

the element.trace.short_src are usually forms such as case_spec.lua. This means that lua has been recognized as a class in the Java ecosystem.

classname = element.trace.short_src .. ':' .. element.trace.currentline,

For outputting test cases in the suiteEnd stage, when the scale of test cases is very large, it is convenient to view some results in real time (perhaps you may ask: is it not good to directly specify the execution of a certain test case, but for projects where some test cases will affect each other, this helps to identify problem cases or test small earlier)
For outputting test cases in the xx stage, when the scale of test cases is very large, it is considered to view some results in real time (per hats you may ask, it is not good to directly specify the execution of a certain test case, but for projects where some test cases will affect each other, this helps to identify problem cases or find test smells problems earlier)

@alerque
Copy link
Member

alerque commented Jan 16, 2024

Yes I get how this improves output for web UIs setup for Java, my question was about whether the output would be worse anywhere else if we made it the default. Is junit ever useful on a terminal for example? Or would folks normally be using other outputters there anyway?

@yeshan333
Copy link
Contributor Author

yeshan333 commented Jan 16, 2024

Yes I get how this improves output for web UIs setup for Java, my question was about whether the output would be worse anywhere else if we made it the default. Is junit ever useful on a terminal for example? Or would folks normally be using other outputters there anyway? @alerque

The impact is minimal. The junit terminal output works well. I have some tests on Github Actions and Gitlab CI, you can take a look:

@alerque alerque merged commit 269a348 into lunarmodules:master Jan 16, 2024
26 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants