Cant configure robot plugin for Jenkins - jenkins

I am using Jenkins (2.289.2) on Linux (OpenSuse).
While i can write pipelines and start robotframework scripts for testing, i am not able to integrate the robot plugin to get logs in Jenkins-style. The robot-logs (log.html, report.html and output.xml) are created, the testrun is executed, success or error for the test-cases are documented.
But here is no sign or whatever that signal that robot-plugin is installed nor a result page from the robot-plugin.

Related

Failed to setup GlobalToolConfiguration In Jenkins - Http Status 403-Forbidden

My Jenkins is running in an azure app service as a java web application. as soon the app service started jenkins started & running successfully.
Im accessing Jenkins UI using the url https://app-service-url/jenkins
I logged into jenkins with initial admin password The next step is to choose install suggested plugin & select plugins to install
upon clicking any of this options im getting "Error ocurred during installation".
However After few retries plugins are installed but for all further operation I do it is giving Http 403- Forbidden.
I tried to add Jdk in Global Tool Configuration before adding values it is throwing error and even I save it ends with 403-forbidden result.
I could not able to do anything in jenkins I failed to install new plugins,setup basic configuration,run commands in jenkins script console etc.
In all the cases periodically receiving Http 403-Forbidden.
In jenkins system log I found the messages.
Solutions Tried:
Tried to enable "Enable proxy compatibility" in GlobalSecurity - but 403-Forbidden
Added hudson.security.csrf.GlobalCrumbIssuerConfiguration.DISABLE_CSRF_PROTECTION = true in my app service Configuration(Similar to setting the Env Variable)
Created init.groovy script in JENKINS_HOME and added below commands
def instance = Jenkins.instance
instance.setCrumbIssuer(null)
Tried to install strict-crumb-issuer jenkins plugin but failed to install
Note: I tried latest jenkins version 2.375 as well as the downgraded version(2.361.2,2.332 etc).
looking for a solution to fix this no valid crumb Http 403- forbidden.

Establish relationship between two Jenkins Jobs available on different Jenkins server

I am building Jenkins for Test / QA automation scripts, lets name it TEST_JOB. For application, I have application source code Jenkins build, name it DEV_JOB.
My scenario is when DEV_JOB completes execution (successfully), execute TEST_JOB immediately. I am aware about setting up project upstream / downstream [ Build after other projects are built ] to accomplish this task. But here, Problem is DEV_JOB is on different server than TEST_JOB. Due to which, TEST_JOB fails to recognize DEV_JOB.
Now, how would I achieve this scenario?
You can use Jenkins API for remote trigger of Job.
Say you have job on DEV_JOB on JENKINS_1, add a penultimate step(or upstream/downstream project having only this step) which invokes TEST_JOB using remote API call of JENKINS_2 server.
Example command would be
$(curl --user "username:password" "http://JENKINS_2/job/TEST_JOB/buildWithParameters?SOMEPARAMETER=$SOMEPARAMETER")
username:password is a valid user on JENKINS_2.
Avoid using your own account here but rather a 'build trigger' account that only has permissions to start those jobs.

How to use Job Import Plugin in Jenkins?

I am using one Jenkins setup/instance to run the smoke tests (i.e using this Jenkins for QA only). Now I have to use another Jenkins job url in my first instance. The purpose is after successful code staging (on Dev Jenkins) it should automatically trigger the smoke tests (on QA Jenkins).
I know that Job import plugin can be used to achieve this but I am not sure as in where exactly to configure it. Googled it as well but unable to find anything.
Any help on this would be really appreciated.
Thanks in advance !
Just import the Job Import plugin, restart Jenkins and then access the plugin on your browser using the URL:
< Jenkins URL >/job-import
For Ex: http://localhost:8080/jenkins/job-import
If you get an error page here, cross-check whether plugin installation was successful or not. This won't work until all the dependent plugins are get installed successfully.
If you have a HTTP access to the DEV machine, maybe you can use the URL trigger plugin:
https://wiki.jenkins-ci.org/display/JENKINS/URLTrigger+Plugin
And trigger the last successful build number URL:
http://YOUR_JENKINS_SERVER/job/YOUR_JOB/lastSuccessfulBuild/buildNumber
If you don't have any access between your QA and DEV machines, it will be hard to trigger a job ;)
Download Jenkins JAR file
Go to location where JAR is located and enter following command
java -jar jenkins-cli.jar -s http://localhost:8080/jenkins/ -auth admin:password create-job UploadToReleases < C:\Users\admin\UploadtoReleases.xml
create-job is command to import a job.
create-job always required name of jenkins job followed by < filename

Access Jenkins build log within build script

How would you go about accessing contents of the build (console) log from within a running build script?
I have a deploy script that runs, logs into a series of servers and runs scripts on those servers. I need to obtain certain output from some of those remote scripts and use them later in the build process and also in the completion email.
You can do something like this in the Post Build section, but I don't think you can do it earlier in the job. With the groovy post build plugin you can get information from the console log:
if(manager.logContains("text to find")) {
do something
}

postbuild UIAutomation script not running in jenkins

I am trying to do End-to-End automation for an iOS project. My aim is to automate the continuous integration process with attaching UIAutomation scripts as post build action.
So from the time when a user do check his code in SVN and till we get test result of automation, everything will be automated.
Jenkins is installed on my local machine and running on localhost.
Now I have automated build process through jenkins and at other end I have my shell script ready which will run UIAutomation java scripts on build output.
When I use my shell script as post build action then I get error in running instrument command(written inside shell script) but if I run this script manually through terminal then it works fine.
instruments[64703:60f] -[NSAlert alertWithError:] called with nil NSError. A generic error message will be displayed, but the user deserves better.
_RegisterApplication(), FAILED TO establish the default connection to the WindowServer, _CGSDefaultConnection() is NULL. Mon Feb 6 13:15:20 inpunml310743 instruments[64703] <Error>: kCGErrorFailure: Set a breakpoint # CGErrorBreakpoint() to catch errors as they are logged. 2012-02-06 13:15:20.179 instruments[64703:60f] Recording cancelled : At least one target failed to launch; aborting run Instruments Trace Error : Failed to start trace. Build step 'Execute shell' marked build as failure Finished: FAILURE
then i tried this command with sudo then I got following error
sudo: no tty present and no askpass program specified
Please let me know how can I run these commands successful, only this step is left in my task.
Jenkins by default installs as a LaunchDaemon, which means it has insufficient permissions to launch WindowsServer.
You’ll need to configure it as a LaunchAgent:
sudo launchctl unload /Library/LaunchDaemons/org.jenkins-ci.plist
sudo mv /Library/LaunchDaemons/org.jenkins-ci.plist /Library/LaunchAgents/org.jenkins-ci.plist
Then login as Jenkins and keep a session open.
If you don't know the Jenkins password you can change it with:
sudo passwd jenkins
Jenkins is running as a daemon and is therefore not allowed to connect to the window server. More info here http://developer.apple.com/library/mac/#technotes/tn2083/_index.html.
Sorry - not got time to put a complete answer now, will update later....
This is possible if you run jenkins as a user app rather than as a deamon -- this might come in handy (https://github.com/stisti/jenkins-app) I haven't tried it but looks like it should work -- I went down another route setting up an always logged in user, that ran jenkins from a login script, it did mean I had to re-install jenkins but managed to get it up and running... word of warning from someone thats been through it, are you using instruments for automated testing? If so, you'll need to do some transformation on the output so it displays in Jenkins.
We have a Jenkins Linux instance that builds to a Mac slave over SSH. One interesting requirement that we noticed with this error is that the build user on the slave must be logged into the console in order for everything to work correctly.
In addition, we had to make the build user an Admin, developer permissions were insufficient.
See more info here:
UIAutomation : Failed to authorize rights with status: -60007

Resources