Jenkins CI - java.exe child process hangs after job is done - process

I have following problem: on my Jenkins 1.438 I have job with maven 3 application. When I run it, sometimes after build is completed successfully Jenkins child process - java.exe - still hangs in the system. It also holds a handle to POM file and when I run my job again i get error that POM file cannot be deleted and build fails. Does anyone know how to fix this? Jenkins runs on Windows Server 2008

We experienced the same problem with Jenkins (on a Linux server).
I'm not sure if you can achieve this with Powershell in Windows server (or use windows-port of bash etc), but for example we start and stop our builds in Jenkins with seperated starter and stopper shell scripts. The point: start script saves the PID of the java process being started into a text file, and the stop script reads it and kills after a given amount of time.

Related

Cucumber JVM generates empty JSON report

I have a suite of Cucumber tests being run by Jenkins periodically. Most runs are not generating a JSON report. More specifically, a zero sized JSON file is created. I'm using version 4.3.1 of cucumber-java, cucumber-java8 and cucumber-junit and Java 1.8.
My test setup is a little convoluted. Jenkins runs a job every 2 hours to run the tests. This job runs in its own Docker container (running a Linux image) wherein a fresh clone of the test repo is created. Jenkins then executes Gradle to build and run the tests.
In the Jenkins console output I can see Gradle starts the tests and presumably executes some but never completes them all. But there is no error or exception from Gradle, it simply stops running. Nor is there any message about the JVM exiting with a non-zero status.
There is the occasional run of the tests that will produce a non-empty JSON report. This tends to coincide with all of the tests passing, but not always.
Unfortunately I am not able to post the Jenkinsfile, build.gradle or anything else. If you need further details I might be able to provide small snippets.

How to run shell commands in intellij after debugger ends

I'm trying to spin up docker container when I run a particular configuration in intellij, which I have done successfully by adding a 'Before Launch external tool command', as described here:
IntelliJ IDEA: Running a shell script as a Run/Debug Configuration
What doesn't seem obvious though is how I stop the container when the program has finished running? There doesn't seem to be any options for after.
How do I run a shell script when my run configuration finishes? (Either by reaching it's end, or being forcefully stopped).

VeriFIX test automation in Jenkins

We are working with a client that uses VeriFIX to test their FIX message flow. Whilst they have built up lots of tests in many suites, it is a manual process to run them and to collate the results.
On the VeriFIX website it says
Incorporate tests into nightly builds using VeriFIX’s command-line script player.
but I cannot find any details on how to to it. Does anyone have any experience in running VeriFIX tests in a continuous integration server (ideally a Jenkins pipeline).
Many thanks.
You can run VeriFIX playlists in batch mode from the command line:
"%VERIFIX_HOME%\verifixbatch\verifixbatch.exe" -version "FIX (x.y)" -playlist "myplaylist" -disablelogging "false"
If you have received the user manual with your installation of veriFIX, the details of how to integrate with CI are in there.
To integrate veriFIX with Jenkins you will create batch files containing tests and run the batch files as jobs in Jenkins.
The placement of your veriFIX installation is important. If your veriFIX is on a users machine, as is often the case, separate from the environment machine Jenkins resides on, there can be difficulties getting the tests to run.
If you have a centralised install of veriFIX things are much easier.

Bamboo builder task

I am a newbie for CI & now start using Bamboo server for continuous integration. I've just get running Bamboo server and set first plan. I set the task for source checkout. Now I am trying to add automated build for my app.
For now app is just simple console based example running both at windows and linux. I have makefile associated with app to build it and then I run .exe (win) or ./ (linux) manually.
Now I want to set the "Builder task" (script task), how do I automatize it building it with Bamboo?
Yes, you have to add "Script task" and call your makefile to build your application in it. You also would need to define an Artifact - providing relative path to your .exe file. (Artifacts tab within your job configuration, more info here) so you can download your .exe file when the build is finished.
Depends on where you bamboo is running
If the Bamboo is on linux machine , just script task would be enough . To build it on windows environment as well , you need to have windows agent or use winexe to call it remotely .

Jenkins - Trigger Selenium test after deployment

I'm new to Jenkins, so please go easy!
I have a web application which we are developing, and we've started automating our release using Jenkins.
I also have a standalone Selenium WebDriver script which will perform a Smoke test on our web app. We usually run this manually each time there's a new deployment.
I heard Jenkins can automatically trigger Selenium tests. So what I did was to create a batch file, which will in turn call the Selenium script. I added a Build Step which will call this batch file.
What's happening now is Jenkins first Builds the WAR file, executes the batch (for selenium) and then deploys it to the target Tomcat.
But I was wondering if I could change the order to Build WAR --> Deploy to Tomcat --> Call the Batch file that executes Selenium Test. I want to do this as Jenkins Tests before deploying, which means my Selenium test still runs on the old build. This makes little sense, as I would rather run the Selenium test on the new build.
In short, is there a way I can execute the Batch file as part of a Post Build Step rather than a Build Step?
Thank you Würgspaß !!
I solved my problem by creating a separate Selenium Job which gets triggered automatically if my Build is successful. This way, I can create any number of downstream jobs to be triggered for a successful build.