fastlane-plugin-test_center to the latest versionHow to generate report.html, report.xml, report.junit and report.xcresult files at once?
I am trying to execute ios UI tests with 2 simulators. And I want to generate report.html, report.junit, report.xml and report.xcresult files in Xcode 11. When I use only output file option like below:
result = multi_scan(
workspace: 'udemy.xcworkspace',
try_count: 3,
fail_build: false,
scheme: 'AcceptanceTests',
device: 'iPhone 8 Plus',
force_quit_simulator: true,
reset_simulator: true,
fail_build: false,
testrun_completed_block: test_run_block,
parallel_testrun_count: 2,
output_types: 'junit',
output_files: 'report.xml'
)
report.xml file is successfully generated. However I want to produce other artifact files that are : report.junit, report.xml, report.html and report.xcresult files.
I already tried to give these arguments like below:
result = multi_scan(
workspace: 'udemy.xcworkspace',
try_count: 3,
fail_build: false,
scheme: 'AcceptanceTests',
device: 'iPhone 8 Plus',
force_quit_simulator: true,
reset_simulator: true,
fail_build: false,
testrun_completed_block: test_run_block,
parallel_testrun_count: 2,
output_types: 'junit, html',
output_files: 'report.xml, report.html'
)
However with this simple configuration I received error like this and I did not know how to generate all the files at once by running tests parallel.
The error was:
ERROR [2019-12-17 08:32:24.99]: [0;31;49mno implicit conversion from nil to integer[0m

So my question is : How can I generate all of the files (junit,html,xml and xcresult) as artifacts while running tests in parallel with 2 simulators? Thanks in advance! @lyndsey-ferguson
NOTE: Xcode version : 11.2.1, test_center version: 3.8.15 , jenkins version: 2.176.3
Hello @selin194, you cannot provide xcresult files in the output_types yet. That is part of #164 that is in slow progress.
You can provide result_bundle: true as described in the underlying action's options (scan) and it will generate xcresult files, but only for the last test run.
However, those xcresults will not be collated. If this answers your question, I'll close this Issue and suggest you keep an eye on the other one. The PR is #167
Oh, and the xml file type is the same as junit. You're just asking for the file name to be named report.xml.
I see, thank you for responding so quickly. However I can not give html and junit output types at the same time. By giving:
output_types: 'junit, html', output_files: 'report.xml, report.html' which gives me error when I run the jobs.
Ah, try without the space. That shouldn't cause an issue, but that is what jumps out at me.
output_types: 'junit,html', output_files: 'report.xml,report.html'. If that fixes it, we can create a bug Issue for this as the spaces should not be a problem.
But you can see from here that without spaces in my unit tests works.
Hey again, I tried without spaces and I can successfully take both xml and html reports.
Thanks @selin194, I've updated this Issue to describe the problem. For now, please remove the extra space.
Thank you @lyndsey-ferguson 馃帀
@selin194, I believe that I have fixed the issue. Can you add the spaces back to your :output_types parameter, modify your Pluginfile per my instructions below, run bundle install, and then run your fastlane again (with the --verbose flag)?
Pluginfile:
gem 'fastlane-plugin-test_center', :git => "https://github.com/lyndsey-ferguson/fastlane-plugin-test_center.git", :branch => "issue-182-fix-output-types-with-spaces"
If there are still problems, please let me know and attach the console output as a text file to this issue (makes it easier for me to review). If it works, please let me know.
Hey @lyndsey-ferguson, I followed the steps that you wrote and it worked with spaces!
When I give output types and files as below with specified branch gem 'fastlane-plugin-test_center', :git => "https://github.com/lyndsey-ferguson/fastlane-plugin-test_center.git", :branch => "issue-182-fix-output-types-with-spaces"
output_types: 'junit, html',
output_files: 'report.xml, report.html'
Output files are successfully generated. Thanks for this fix 馃帀
You're welcome, thank you for confirming the fix.
Fixed in v3.8.16
Most helpful comment
Hey again, I tried
without spacesand I can successfully take bothxmlandhtmlreports.