Xray-App / xray-junit-extensions

Enhanced JUnit 5 integration with Xray Test Management for Jira
Eclipse Public License 2.0
16 stars 8 forks source link

custom report filename and ability to append timestamps to it #13

Closed bitcoder closed 2 years ago

bitcoder commented 2 years ago

a PoC implementation for #11 and #14, providing configuration options for enabling custom report filename and also the ability to append a timestamp to the report filename. For that, one needs to define a property file src/test/resources/xray-junit-extensions.properties with these properties:

report_filename=custom-report-junit.xml
report_directory=reports
add_timestamp_to_report_filename=true
vduhautois commented 2 years ago

Have been trying locally, it's great.

Just a simple remark: for the report_filename property, there is no need to add the .xml extension at the end of the name. (maybe something to specify in the doc).

If we do and have something like:

add_timestamp_to_report_filename=true
report_filename=custom-report.xml

We end up with:

As well, a simple:

report_filename=custom-test-report

is enough to produce a report name custom-test-report.xml

bitcoder commented 2 years ago

Just a simple remark: for the report_filename property, there is no need to add the .xml extension at the end of the name. (maybe something to specify in the doc).

Agree. Will have a look at it

bitcoder commented 2 years ago

@vduhautois can you please check this branch on your end? it should address #11 and #14

vduhautois commented 2 years ago

@bitcoder Really sorry for the delay. I have tested a bit this morning. Does the src/test/resources/xray-junit-extensions.properties become mandatory ? Because if it's not created, there is no report created at all anymore! (well, this is what I've noticed)

But if the property file is created, the behaviour is good. We can specify the location of the report directory, with target/ in default value If i'm not wrong.

So there is just to deal with the property file: if you want it mandatory, it's good. If not, we should have previous behaviour worked (a unique report file in the report/ directory) I think

bitcoder commented 2 years ago

@vduhautois the src/test/resources/xray-junit-extensions.properties is optional. The default report directory is now "./target" no matter if the .properties file exists or not. Anyway, I've added some very minor ifs/checks on the code to only overwrite config variables if they're indeed specified on the .properties file

bitcoder commented 2 years ago

if you can give it a final check, would be great @vduhautois

vduhautois commented 2 years ago

My bad, I was so focused on the custom name report that I did not see the report with the default name, which was just under my nose! So everything looks good to me @bitcoder