Could not create iOS build summary report (Errors and warnings) in Jenkins with or without Fastlane - ios

I am using Jenkins and Fastlane for CICD pipeline for my iOS Project. Before we were using Xcode server that provides a direct API using which i exported the build summary(Compilation Errors, Warnings from Xcode).
But now with Jenkins or fastlane i am not able to do it since i couldn't find any API that generates this report.
For Code Analysis i am using swiftlint. It is generating code analysis report only and it is not showing the default warnings like deprecations etc. in Jenkins. So i understood i cannot use the code analysis tool for this purpose.
Is there any way with which i could generate the Warnings and Errors report in Jenkins? For all the actions like incrementing build number, executing test cases, code signing, generating binary etc. i have written separate lanes in my fastfile.

There is an option to generate warnings report in Jenkins. We need to
Install Warnings plugin in jenkins,
Add a post build step to scan compiler warnings,
Select Clang LLVM as parser.
A trend graph for warnings will be shown and a remote API is available to use the report elsewhere.
But couldn't find anything on the errors though.

Related

Code review plugin running tests at source code level

I am building a Devops pipeline , where in I am trying to include an extra code review plugin which supports C, C++ and C#. In my pipeline, I already have Sonarqube 6.5 running and it also has the FXCop plugin activated.
So, Sonarqube runs tests at source code level and FXCop runs tests at binary level. Now, I am trying to find out another code review plugin which could be plugged to Sonarqube (Plugin has to run tests at source code level, not binary level).
I thought of choosing StyleCop but it has to be downloaded in my laptop. So, I had to neglect that.
Tried using Source Meter, which is another plugin that runs review tests at source code level but it is not compatible with 6.5 version of Sonarqube (only supported till Sonarqube 4.5 version).
And now, I am running out of plugins which could do the job. Could anyone suggest a plugin that could both be plugged with Sonarqube 6.5 and run source code level review tests?
NOTE: (Should support C, C++ and C#)
You could try SonarQube plug-in for PVS-Studio static source code analyzer for C/C++/C#.

Msbuild Sonarqube Runner with multiple build configurations

We are using TFS to build our projects and for analysis using Sonarqube Msbuild Runner however some of our project are bound to be builded in multiple configurations (Debug|Release) and apparently sonarqube msbuild runner doesn't support multiple configuration.
In the error message (below) suggested analyzing each configuration separately but we don't know how, due the fact that we are just calling runner with begin and end in our TFS xaml build process and everything happens automatically.
Is there a way to analyze both configuration separately or analyzing just one of them?
This is the error message that we are catching in our TFS build report:
No analysable projects were found but some duplicate project IDs were
found. Possible cause: you are building multiple configurations (e.g.
DEBUG|x86 and RELEASE|x64) at the same time, which is not supported by
the SonarQube integration. Please build and analyse each configuration
individually.
Thank you in advance.
You can try to add two pairs of Sonarqube in your build definition and specify the platform and configuration for your project.
Or declare the build variables BuildPlatform and BuildConfiguration on the Variables tab and and reference it here as $(BuildConfiguration). This way you can modify the platform when you queue the build.

How can I integrate output from a Cake build into a TFS 2013 build?

We're using cake for defining our .NET builds, primarily so we can run the same build on developer stations as on the build server. TFS 2013 is our actual CI platform; the build workflow is effectively just a RunScript activity which invokes powershell and runs cake via its build.ps1 script.
The basic build is working well enough, and I'm on to having it generate reports (unit test results, coverage reports, etc). I'd like to have these reports appear in the build's Summary screen, but at the moment the only feedback the build gives me is the console output from cake under the build logs. The report files are being generated and dropped into the build's ./tst/ folder, but the contents of that folder aren't appearing anywhere in the build information.
How can I get test reports to be added to the build summary and/or information pages?
With the default build process template, when you build a test project, you will be able to get test result and code coverage (if you enable it) by default. So if you use VS Test Runner to run the tests, you can refer to the default process template.
If you need other tool to run the teats, you can add the InvokeProcess activity (execute the command line) to invoke the tool to test your project in build process template.
In addition, you can use the WriteCustomSummaryInformation activity in your workflow. The result is that you can display results, hyperlinks, and more on the build summary page.

Alternatives for QC

In my project we are using QC to execute our test cases(QTP), moving forward we would be eliminating QC (for cost reasons).
As far as I explored MSBuild & Jenkins, they would be suitable.
But MSBuild will trigger the execution when a new build pushed to the repository. Also it will automatically test on the latest build.
Is there any other CI tool available to execute test cases through QTP?
I will be executing automation once in a release. Also we install our application by manual since it requires lots of configuration.
Take a look at HP Application Automation Tools.
This plugin basically replaces the need for QC, and is developed by HP.
Create a Jenkins job using this plugin on the same Jenkins installation used to build your code, then you can configure your job to run your tests as soon the code is available (e.g. on a nightly basis).
See here for a helpful guide on how to implement a simple Jenkins job using this plugin.
They also host the code on Github, which is very useful if you need to change the behavior of the plugin to suit your needs.

Does Jenkins support Xcode integration

Has anyone used Jenkins in Xcode for code management and automated deployment ? If yes, how can it be integrated ? How does automated deployment work with Jenkins ? Went through the documentation but didn't get much idea.
I went through the Jenkins plugins for iOS but not clear if we can publish the build to AppStore using any plugin.
We are using a Jenkins Server for Continuos Integration, by fetching the source from an SVN Server when the Jenkins is triggered by Commits to this repositories.
But, to be serious, i wouldn't recommend the jenkins... i'd rather use xcode server/bots to get rid of all the hassle with the jenkins...
fastlane is a tool for iOS and Android developers to automate tedious tasks like generating screenshots, dealing with provisioning profiles and releasing your application.
https://github.com/fastlane/fastlane
xctool is a replacement for Apple's xcodebuild that makes it easier to test iOS and Mac products. It's especially helpful for continuous integration.
https://github.com/facebook/xctool
The term "Jenkins in Xcode for code management" seems not fully correct. Because Jenkins server is for CI, in which we config it (create a job) that will fetch the source code from your repository (SVN, GIT), then compile it and run, probably execute your unit tests, UI automation tests or code coverage tool.
Based on your schedule, Jenkins server will automatically start its job or is triggered whenever there is a change in your repo (anybody commits the code for example).
The tool you mentioned which in Xcode is probably XCode Bots, the built-in CI tool.
In order to set up, firstly, you have to install and config XCode server. After that, connecting your server with your repositories. Secondly, creates a bot with your customize configuration and run it.
In my opinion in term of Jenkins and Xcode comparison, I would say that it depends on what tools or add-in functions that you want to set up for your CI server. Jenkins has many plugins might helpful like check style, measure code coverage while Xcode bot still having some limitation.
This document https://developer.apple.com/library/ios/documentation/IDEs/Conceptual/xcode_guide-continuous_integration/ for your further reference.
I hope this would be helpful to you.
There is a gem called xcpretty, you can use it to output JUnit format test result, then use Jenkins JUnit Plugin to show the result.
Install xcpretty
gem install xcpretty
Use xcpretty to create junit format xml file
xcodebuild test ... | xcpretty --report junit --output [path_to_save]/unit_test_result.xml
Then this unit_test_result.xml can be used to report by Jenkins JUnit Plugin

Resources