
Security News
The Changelog Podcast: Practical Steps to Stay Safe on npm
Learn the essential steps every developer should take to stay secure on npm and reduce exposure to supply chain attacks.
fastlane-plugin-forsis
Advanced tools
forsis is a fastlane plugin that will be helpful to those swift developers who use SonarQube to analyze their code. forsis uses JUnit test reports generated by fastlane to produce generic test execution reports supported by SonarQube.
If you have used SonarQube for analyzing Swift projects, you've probably noticed that other than the code coverage, you don't get any information related to the unit tests appearing on the project dashboard. This plugin, however, will help you get more visibility on the unit tests by generating a test report that can be analyzed by SonarQube. By sending such a test report to SonarQube, the total number of unit tests will be displayed on the project dashboard as shown in the following image.
In addidtion, you can see a breakdown of test results under project Measures > Coverage > Tests. Alternatively, you can select the test count on the dashbord (by clicking it) to see the test results as shown in the image below.
To get started with fastlane-plugin-forsis, add it to your project by running:
bundle exec fastlane add_plugin forsis
Start using the plugin by adding this example 'lane' to your Fastfile:
lane :sonarqube_test_report do
forsis(
junit_report_file: './fastlane/report.junit',
sonar_report_directory: 'path_to_a_directory_to_store_sonarqube_report'
)
end
junit_report_file is the path to the JUnit test report generated by fastlanesonar_report_directory is the directory to store the generated SonarQube report. This parameter is optional and the defaut value is the fastlane directory in the main repo (i.e., ./fastlane).Note: This plugin uses the fastlane JUnit test report named report.junit. This report is generated by running tests through fastlane using run_tests or scan actions. Therefore, in your Fastfile, the forsis lane must be run after the lane that runs the tests. Including the test lane, your Fastfile would look like the example below.
lane :run_unit_tests do
run_tests(
workspace: 'path_to_the_xcworkspace_directory',
scheme: 'path_to_the_project_test_scheme',
devices: ["iPhone 6s"],
# output_types: 'junit',
output_directory: './fastlane/test_output',
)
end
lane :sonarqube_test_report do
forsis(
junit_report_file: './fastlane/test_output/report.junit',
sonar_report_directory: './fastlane'
)
end
The run_tests action generates a test report in two different formats by default (html and junit). (Note: the scan method is an alias for the run_tests method.) If you would not like to get the html report, you can override this default behavior by setting the parameter output_types to only 'junit'. In the example :run_unit_tests lane above, uncomment the line for output_types to only get a JUnit test report. Test reports are then found in the fastlane directory or in the output_directory if it has been set. To learn more about how to run tests through fastlane, check out the [fastlane documentation] (https://docs.fastlane.tools/getting-started/ios/running-tests/).
This plugin creates an XML test report called Test_sonarqube_report.xml. To get benefit from this report, you need to feed it to SonarQube properly. To do so, you need to set the two following SonarQube analysis parameters:
sonar.tests is the path to the directory that contains testssonar.testExecutionReportPaths is the path to the SonarQube test report file generated by the plugin i.e., the value of the sonar_report_directory in the forsis action followed by the name of the XML file that contains the report. This would be fastlane/Test_sonarqube_report.xml, if sonar_report_directory was not set.If you need help setting up analysis parameters for SonarQube, refer to the SonarQube Analysis Parameters documentation.
If you have trouble using plugins, check out the Plugins Troubleshooting guide.
fastlane is the easiest way to automate beta deployments and releases for your iOS and Android apps. To learn more, check out fastlane.tools.
Bug reports and suggestions for improvements are always welcome. PRs are even better!!
If you run into any issues, before submitting a new GitHub issue, please make sure to
If the above doesn't help, please submit an issue on GitHub. When reporting a bug, please make sure to include a spec that highlights the bug.
This software is available as open source under the terms of the MIT License.
FAQs
Unknown package
We found that fastlane-plugin-forsis demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Security News
Learn the essential steps every developer should take to stay secure on npm and reduce exposure to supply chain attacks.

Security News
Experts push back on new claims about AI-driven ransomware, warning that hype and sponsored research are distorting how the threat is understood.

Security News
Ruby's creator Matz assumes control of RubyGems and Bundler repositories while former maintainers agree to step back and transfer all rights to end the dispute.