installed the latest version of Jenkins 2.271
https://www.jenkins.io/download/
then installed the Robot framework plugin: https://plugins.jenkins.io/robot/#releases
2.12
Then when adding a new step after build attempt it should show all the options of the plugin.
But it doesn't do that, what can be the cause, I am clueless now...
I don't know the reason but after trying to use the E-mail notification (an smpt error came up, but that is not the issue here)
suddenly there was another option: Publish Robot framework test results
and that fixed it:
concluding: can Java open source work with the plugin?: apparently yes. (good to know)
What caused the option 'Publish Robot Framework test results not showing? unclear!
Somehow triggering the E-mail Notification (remember? : which became available after the Matrix multi project plugin) solved the problem and the left pane options also showed in the menu at that point.
It's a poorly named plugin: should be Robot Framework Publisher. If you read the Configuration section of the plugin, you'll see:
Select: Build -> Add build step -> execute shell/Execute Windows batch command
Add the command to run the tests. You might have direct robot/jybot command here like robot --variable name:value --outputdir my_robot_results my_test_suite or in case you need to do something
more, you can call any script that you use for running the tests.
Relevant part from Robot Jenkins Plugin point of view is that this
script generates the Robot outputs.
Force your Robot script to return successfully from shell with exit 0 to empower the plugin in deciding if the build is success/failure
(by default Robot exits with error code when there's any failed
tests). You can do this for example by adding --nostatusrc to your
test run (see Robot Framework user guide for details).
Select: Post-build Actions -> Publish Robot Framework test results
Thus you will only see a robot entry in the Post-build step to gather the results.
Note: JENKINS-36954 and OP's comments suggests you must also add matrix-project, which as of v.2.1.2 remains declared as "Optional" but appears to be required.
Update (2012-12-17): It would appear JENKINS-36954 is the culprit. I added steps to reproduce on the ticket, proposed sol'n, which has been accepted and PR has been merged. Expect to see it resolved in v.2.1.3.
Related
This seems simple enough, but I can't find a solution for this online.
I am integrating SonarQube into our build definitions that get triggered on check in. I want the version SonarQube uses to be tied back to the project number defined by the business side of things.
Ideally, I would like to be able to prompt the user for input. When you go to check in and it kicks off the build, it would ask you for the project number to be used as the version for SonarQube. Is this something TFS 2015 supports?
User input for build definitions
As far as I know, build definitions that are not manually triggered do not prompt for user input. A prompt allowing users to set build variables is shown for manually triggered builds from the VSTS web page.
SonarQube project version
I would recommend against you using the build or assembly version in your build tasks. This is because the SonarQube concept of version is quite different from the build concept. SonarQube uses versions as a baselining mechanism / to determine the leak period. If you up the version number often, the leak period is going to be too short to be actionable.
I'd recommend keeping the SonarQube project version in sync with your release schedule instead.
The short answer to this question is no, there is no way to prompt for input on a non-manually triggered CI build.
Here's what we did to work around this:
I wrote a Powershell script to read a config file and set the values to environment variables exposed to later build steps. Those variables are then what are specified in the Sonar Begin Analysis build task. I packaged that script up as a custom build task that will read a "sonar.config" file. This means all we have to do is add a "sonar.config" file to each solution we want to run Sonar analysis for, defining the key, name and version for the project, and then this build task will populate all necessary environment variables as the first step in the build.
So not a perfect solution, but it gets the job done without us having to add a lot of extra code to our solutions.
I have a nice plugin called Zulip notification in Jenkins, this plugin posts the results to Zulip so people there can see whats happening. Our Zulip server is a bit unstable and goes offline every now and again, and then all the nightly builds fail.
Is there a way to configure a post build step as "best effort"? To try to run the step, but ignore failure. It's obviously nonessential in the "compile the code" view of the world.
I have looked at the "Flexible Build Step" plugin, and it seems to be able to run other plugins fine, but i dont see any "ignore error" kind of option..
Current thinking re a solution: Perhaps there is a way to get the flexible build step plugin to check if the url is online?
Ok my workaround is to use the "flexible build step" and run a batch file (thanks to this answer) to determine if url is up:
https://stackoverflow.com/a/16512781/3426514
I've got a job that runs for a long time (for example, it builds few solutions), Is there a way to know the current solution that is beind compiled on runtine?
I mean, the Log is very long, so sometimes is confusing to know what is the current compilation that is running.
I want to know what is the current solution that is being compiled now...
Any plugin or a way to do that?
It would be easier to diagnose problems if you split the job into multiple jobs (each one building a single solution). If you have dependencies between the different builds (i.e. one part of the build cannot happen until another part has completed), you can create a build pipeline, where once one job finishes, it triggers the next job in the pipeline. You can do this using the post-build action Build other projects in the job configuration.
There is also an excellent build pipeline plugin which helps you visualize your build pipeline.
If it is the case that you must have the whole solution built in a single job, then one approach would be to use the Jenkins log parser plugin to display a cut-down version of your build log, which just highlights the key events you are interested in to diagnose such problems.
More details of this plugin can be found at:
https://wiki.jenkins-ci.org/display/JENKINS/Log+Parser+Plugin
I've got two ideas for a possible solution but they needed to be implemented:
1. Adding a prefix for each row in the Log. The prefix could be a string.
for example, if there was a new Project Compilation started then the Log finds the line
----- Rebuild All started: Project: PROJ1 , Configuration: Release x64 ------
Then it adds all the rows after it the prefix "Building PROJ1"
until the log reads the next project:
----- Rebuild All started: Project: PROJ2 , Configuration: Release x64 ------
2. Adding a the current project name that's building to the flashing Job status blue ball.
I mean, finding the current building project from the Log, then adding it next to the current job status (the flickering ball).
Is it possible to set the build result for a build after that build is complete?
I could not find any plugins that do this already, and I was considering writing my own, but I wanted to see if this was even possible before going down that path.
(I have looked at existing code and how the "Fail The Build" plugin works as an example, but my understanding of the Jenkins code base is not advanced enough to understand what all the possibilities are.)
Use case: we have a build pipeline, and near the end of the pipeline there is a deploy-to-qa step that deploys the artifact to a QA environment. We have automated tests before this step to try to catch any problems with the artifact, but our test coverage is not very high in some areas so bugs could still slip through the cracks. I'd like to have the ability to mark a deploy-to-qa build as FAILED after the fact, to denote that that particular pipeline was invalid and is not a candidate for production release. (Basically the same as this Build Pipeline Plugin issue)
After some more investigation in the code, I believe that this is not possible.
From hudson.model.Run:
public void setResult(Result r) {
// state can change only when we are building
assert state==State.BUILDING;
// snip
...
}
So the build result cannot change except when in "building" state.
I could try to muck with the lastSuccessful and lastStable symlinks (as is done with the delete() function in hudson.model.AbstractBuild), but then those would be reset as soon as Jenkins reloaded the build results from jobs/JOBNAME/builds/.
I have an untested suggestion: Make a parametrized build, where the parameter determines if build will fail or not (for example simple bat / shell script testing the parameter from the environment variable it sets, and doing exit 0 or exit 1). This assumes that build pipelines manually triggered step will ask the parameters, and not use default values.
If it does not support interactive build parameters, then some other way is needed to tell this extra build step wether it should fail or not. Maybe editing upstream build description or display name to indicate failure, and then allowing build pipeline to continue to this extra build step, which probably has to use system groovy script to dig out upstream build description or display name.
I have seen several debates on this topic previously, and the outcome was always that it is theoretically possible to do so, but the codebase is not designed to allow this and it would have to be a very hacky workaround.
It's also been said that this is a bad practice in general, although I don't remember what the argument against it was.
I am facing the same requirement. I haven't found an appropriate plugin, changing the build status is not just a flag but has other impacts on links (eg latest successful build etc). So instead of changing the status of the build I looked for a possibility for qualifying the build. The Promoted Builds Plugin apply flags to build to define e.g. different quality stages. Build promotions can be performed manually or based on e.g. downstream project successful builds. Any successful build can be qualified, based on the promotion additional build and post build actions can be executed, e.g tagging or archiving.
Actually I was able to do it by changing the build.xml manually to <result>FAILURE</result>.
I've then played a little bit with mklink to create some symbolic links and also renamed the lastSuccessfulBuild to lastFailedBuild and it worked. If you are allowed to access the filesystem from within a Jenkins PlugIn, then it is possible to write one.
In case you are fine to delete the current build and start the same build using a version number and setting the next BUILD_NUMBER to the deleted one, then you could use this plugin to tell it to fail instead of succeed:
Fail The Build Plugin
I have one bash/shell script to check a set of constraints in my project. The output of this script is the number of errors/violations found in the source code (Non Java project).
I'm looking for a Jenkins plugin to check this script output and notify a fail depending on a threshold. It's the same functionality as Violations plugin + Checkstyle, PMD, etc, but the datasource should be a custom script.
I have been searching for a while, but anything fits this requirement.
Do you know if this plugin exists?
You may want to look at the Warnings plugin, it describes how to "Write a new parser that should be included in the warnings plug-in" and to "Write a new standalone parser that will be deployed in a new plug-in"
It also have a "Failure threshold to mark a build as unstable"