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

Handle --log-junit option #207

Open
Jean85 opened this issue Jun 8, 2023 · 5 comments
Open

Handle --log-junit option #207

Jean85 opened this issue Jun 8, 2023 · 5 comments
Milestone

Comments

@Jean85
Copy link
Member

Jean85 commented Jun 8, 2023

The --log-junit would be pretty useful to report tests to various systems, including the GitLab CI Unit Test Report: https://docs.gitlab.com/ee/ci/testing/unit_test_reports.html

This option is not feasible as a pass-through one, because it would produce multiple files, and also because there's no way to produce different files with different names for each executed test class.

This feature would mirror the coverage one, with the hijacking of the native PHPUnit option, and the merging of the resulting files. The merge would have to be written as a feature, but would be pretty straightforward, see https://github.com/drazisil/junit-merge/blob/master/lib/index.js

@Jean85 Jean85 added this to the 2.3 milestone Jun 8, 2023
@Jean85
Copy link
Member Author

Jean85 commented Jun 8, 2023

It seems that JUnit logs can be uploaded with glob patterns to GitLab! 🎉
https://docs.gitlab.com/ee/ci/yaml/artifacts_reports.html#artifactsreportsjunit

This would simplify a lot the feature, because I could accept a directory name as the value of the option, and generate the filename automatically, without having to merge the result.

@GiovanniCardamone
Copy link

following

keljtanoski added a commit to keljtanoski/paraunit that referenced this issue Jun 9, 2023
@keljtanoski
Copy link
Contributor

keljtanoski commented Jun 9, 2023

👋 Hi @Jean85 I added a MR with my implementation of this for the version 1.x.
I needed this feature so I have made the rewrite of paraunit - not released yet though as I notified you via email.
I am adding this MR as an example how I think it can be solved.
I did not had a chance to go through the version 2.x but I will in my free time 👍
Kudos for paraunit 🎉

This option is not feasible as a pass-through one, because it would produce multiple files, and also because there's no way to produce different files with different names for each executed test class.

My MR does this exactly creates generated filenames based on the file provided as a parameter. 😄

@Jean85
Copy link
Member Author

Jean85 commented Jun 12, 2023

Seemed interesting, thank you. I'm not sure I'll be implementing the merge of the XML files though, at least at first. That's because for my use case (GitLab) multiple files are fine too. For which use case do you need one single file?

@keljtanoski
Copy link
Contributor

Seemed interesting, thank you. I'm not sure I'll be implementing the merge of the XML files though, at least at first. That's because for my use case (GitLab) multiple files are fine too. For which use case do you need one single file?

Not a specific use case, I just did not knew that Gitlab had the artifacts_reports option 😄 but anyway problem solved.

@Jean85 Jean85 modified the milestones: 2.3, 2.4 Feb 2, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants