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 support for output_name parameter #1942

Closed
fastlane-bot-helper opened this issue Oct 31, 2015 · 17 comments
Closed

Add support for output_name parameter #1942

fastlane-bot-helper opened this issue Oct 31, 2015 · 17 comments

Comments

@fastlane-bot-helper
Copy link
Contributor

Original issue by @sguillope - Imported from fastlane/scan#27

It would be nice if it was possible to specify the name of the output file (similar to gym's output_name parameter).
We are running our tests on Bamboo but the Junit Parser plugin only seems to parse files with an .xml extension. We currently have to manually rename the output file report.junit to have the .xml extension.

@fastlane-bot-helper
Copy link
Contributor Author

@KrauseFx commented

@sguillope It's probably best to add a mv command after running scan, as even if you'd specify an output name, it might not include the extension.

@fastlane-bot-helper
Copy link
Contributor Author

@xfreebird commented

@KrauseFx is there a reason why you used the .junit file extension ? since most the tools I know creates the JUnit report with the .xml extension.

@fastlane-bot-helper
Copy link
Contributor Author

@KrauseFx commented

@xfreebird I think it was default of xcpretty

@fastlane-bot-helper
Copy link
Contributor Author

@xfreebird commented

from xcpretty I see that the default report name is build/reports/junit.xml

The file name is coming from scan/report_collector.rb in generate_commands:

        file_name = "report.#{type}"
        output_path = output_file_name || File.join(File.expand_path(Scan.config[:output_directory]), file_name)

I think it would be better to use a different name for report.junit, something like junit/TEST-report.xml. This is a wide used name format for junit tests reports.

@fastlane-bot-helper
Copy link
Contributor Author

@KrauseFx commented

Sounds good to me 👍

@fastlane-bot-helper
Copy link
Contributor Author

@Tokuriku commented

Any advances made on this issue?

@fastlane-bot-helper
Copy link
Contributor Author

@jacobvanorder commented

👍

@fastlane-bot-helper
Copy link
Contributor Author

@jeeftor commented

I fully agree with this! .xml would make things more compatible with bamboo

@nfalco79
Copy link

Mee too.
Jenkins SonarQube and other tools that parse junit report wants xml.
Using xml file for junit avoid a lot of setup.

@ghost
Copy link

ghost commented Apr 10, 2016

+1 for this feature

@mikecole20
Copy link

I would also like to see this. CircleCI expects an xml file as well. I was able to work around it by writing a custom lane which looks for a defined output_directory

  desc "Runs all tests with the Staging build"
  lane :test do |options|
    scheme = "Staging"
    output_types = "junit"
    output_directory = options[:output_directory]
    if (output_directory == nil)
      scan(scheme: scheme, output_types: output_types)
    else
      scan(scheme: scheme, output_types: output_types, output_directory: output_directory)
    end
  end

and a custom test call in circle.yml

test:
  override:
    - fastlane test output_directory:"$CIRCLE_TEST_REPORTS/xcode/"
    - mv $CIRCLE_TEST_REPORTS/xcode/report.junit $CIRCLE_TEST_REPORTS/xcode/results.xml

@TKBurner
Copy link

@fabioknoedt Thanks for the plus 1. We are going to consider this over here. Have a great day!

PycKamil added a commit to PycKamil/fastlane that referenced this issue Jul 18, 2016
Changed JUnit report output file type to xml. This solves fastlane#1942
@PycKamil
Copy link
Contributor

PycKamil commented Aug 1, 2016

I have added new flag for specifying full custom report name (custom_report_file_name). scan version 0.10.0 includes this change and this should solve this issue 👍

@jacobvanorder
Copy link
Contributor

Thank you @PycKamil!

@KrauseFx
Copy link
Member

KrauseFx commented Aug 2, 2016

Thanks for updating the issue and contributing to fastlane @PycKamil 🚀

@KrauseFx KrauseFx closed this as completed Aug 2, 2016
@kirillzh
Copy link

kirillzh commented Oct 5, 2016

--custom_report_file_name STRING Sets custom full report file name
Is this report filename for HTML or XML report? Also, why is it still report.junit and not report.xml? 😕

@TKBurner
Copy link

TKBurner commented Oct 6, 2016

@kirillzh I believe it impacts both.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

8 participants