macOS in Jenkins batch command is not working - jenkins

I am trying to execute windows batch command in Jenkins from macOS and not succeed, walk through the internet try to find a way how I can create artifact (file) in Jenkins command line with this code echo Hello World! >> config.txt from macOS but couldn't succeed, if anyone who had experience and can suggest solution it will be appreciated.
This is the place where I added to command
This is the output of build

Related

Execute script into Jenkins file system from the job

I am a Jenkins newbie, so I am sorry if this question looks so. I would like to execute batch command from Jenkins master, which can execute script stored into Jenkins file system, so NOT into workspace created by Jenkins into my local D:/... .
I am trying from Execute Windows batch command field:
start https://our.jenkins.in.company.cz/var/jenkins_home/HELLO/hello.py
but Jenkins cannot find the file:
HTTP ERROR 404 Not Found
URI: /var/jenkins_home/HELLO/hello.py
STATUS: 404
MESSAGE: Not Found
SERVLET: Stapler
R/W/X rights for the script are allowed.
Please let me know how to achieve the right way.
Thank you very very much.
I assume the python was installed on the machine.
May you can run the script with the following command:
python /home/some-user/mount/HELLO/hello.py
But I am little bit confused, because you wrote about an Windows batch command and "D:/" path which assume you work on windows system but /home/some-user/mount/HELLO/hello.py assume something is linux based system.
The start as I see works with .exe runnable, you need to tell exactly to run a script with python, this is the first part of the command.
If you using windows with linux subsystem, may you can run something like this as I remember correctly:
python D:\windowspath_to_subsytem\home\some-user\mount\HELLO\hello.py

how to run robot framework(autoit) test in jenkins?

I have a robot file, written with autoit library. Using it for testing a 3rd party software installation in Windows 7.
If I run this robot file, a pop-up window will appear, from here I need to proceed with next steps of software installation. (Please NOTE : I know that , I can do silent installation here. But my job is to validate the pop-up window :( )
Now the problem is :
If I run this robot file from windows command prompt, using "pybot test.robot" command. its working as expected. But when I integrate this with jenkins, the pop-up window NOT appearing. I am getting the below error:
[Job to run RFW test] $ cmd /c call C:\Windows\TEMP\hudson8861333201655586740.bat
C:\Program Files (x86)\Jenkins\workspace\Job to run RFW test>pybot Software_install_testsuite.robot
==============================================================================
Software install testsuite
==============================================================================
TESTCASE1 : ID 1234 | FAIL |
**AutoItError: timeout on wait for activate window**
------------------------------------------------------------------------------
I have tried with "xshell", "power shell" and "Windows batch command" in ADD BUILD STEP in jenkins. But still I am seeing the same error.
From last two weeks I am trying to fix this. Any help on this is really appreciated.
Thanks.
Try to install vnc (e.g. ultravnc), run jenkins slave within this vnc session (don't use RDP connection), and then try to trigger test from jenkins.

codewarrior IDE is not responding back when build runs from jenkins

I m trying to build a project from codewarrior IDE command line. It works fine when i run it manually on the windows slave as:
CmdIDE.exe C:\Jenkins\build\workspace\project_name\xxxxxxxx.mcp /b /c /q
But when i try to run the build from Jenkins nothing happens and it keeps on running. I tried to do this from a batch script using psexec but still no response. Please help if anyone has done this from jenkins.
C:\Program Files\Freescale\CodeWarrior for Microcontrollers V6.3\bin>CmdIDE.exe 'C:\project_name\xxxxxxxx.mcp' /b /c /q
Freescale CodeWarrior IDE. Hit /? for help ERROR: Process Aborted. (Code 9)
C:\Program Files\Freescale\CodeWarrior for Microcontrollers V6.3\bin>exit 9 Build step 'Execute Windows batch command' marked build as failure
Thanks in advance

Robotium Tests not running on Jenkins but local

i try to integrate my Robotium Tests on our Jenkins Server. I implemented an android Test Project that based on our app Project. Everything works like a charm when i run the Tests on my local Machine on Windows out of Eclipse and also by calling from shell by call
'adb shell am instrument -w <our-package>/android.test.InstrumentationTestRunner'
So far, so good, but after i set up a build Job in Jenkins, let the Projects build by maven clean install sign etc. none of my tests will be proceeded. I also tried to call 'adb shell am instrument -w <our-package>/android.test.InstrumentationTestRunner' as shell command after the build step but also no result. The build ended up with just 2 Tests shown log below
[workspace] $ /bin/sh -xe /tmp/hudson3571502822112946903.sh
+ /home/jenkins/tools/android-sdk-linux/platform-tools/adb shell pm list instrumentation
instrumentation:com.android.emulator.connectivity.test/android.test.InstrumentationTestRunner (target=com.android.emulator.connectivity.test)
instrumentation:com.android.emulator.gps.test/android.test.InstrumentationTestRunner (target=com.android.emulator.gps.test)
instrumentation:com.zeppelin.zemos.test.addispo/android.test.InstrumentationTestRunner (target=com.zeppelin.zemos.addispo)
+ /home/jenkins/tools/android-sdk-linux/platform-tools/adb shell am instrument -w com.zeppelin.zemos.test.addispo/android.test.InstrumentationTestRunner
android.test.AndroidTestCase:.
android.test.LoaderTestCase:.
Test results for InstrumentationTestRunner=..
Time: 0.031
OK (2 tests)
Just the 2 Tests AndroidTestCase and LoaderTestCase are shown up and it seems that all of my other Testcases (i've implemented 11) are not processed by Jenkins.
I spent a long time googling around but found no solution for this. Could this be a ant Problem? I have Version 1.8 local and 1.6 on the Jenkins Server. Or is there another Problem i cannot see.....
Thanks a lot
You can try uninstalling the package from device/ emulator, using
"adb uninstall your_package"
Then, do a clean debug install again and then run the tests.

execute shell step skipped completely in jenkins

I can't seem to run a build execute shell step in Jenkins. I've worked with Hudson in the past on windows and I was able to create shell/batch steps without a problem but I seem to be be missing something here.
It's a fresh jenkins install and I go to "add build step", "execute shell" and enter "echo hi" in the command. I run the build and when I look in the console output, nothing happens.
I've also tried executing a test.sh file which also just echoes hi. I've tested this in both a linux install and an os X installed Jenkins server.
What am I missing in the configuration to run a shell script?
The console output shows that the shell script steps were skipped completely
Started by user admin
Finished: SUCCESS
It looks like Jenkins is not being able to redirect the output from the system. What version of Java are you using? If you're using OpenJDK, could you try with Sun Java/Sun JDK?
First test to try to check if anything is executing at all: add the following to your "Execute Shell"
#!/bin/bash
echo "HELLO WORLD" > /tmp/testfile
Run this and check if there is a /tmp/testfile in on your Linux system, and if it contains the HELLO WORLD text, it means your script is in fact executing.
Which version of Jenkins do you have?
The last good version that I can attest to (last one I know works well at least for us) is 1.447. If you're not using that one, would you be able to try with it?
Also, could you add #!/bin/sh or #!/bin/bash before echo hi on your "Execute Shell" for the Linux system and see if that works.
Also, try running a script using source /path/to/script and see if that works. The script should contain #!/bin/sh or #!/bin/bash as the first line, just to see if that makes a difference.
Note: none of this should be required, but is helpful just to get more information on what's going on. Couldn't fit all this into a comment. I'll update my answer based on your answers to the above, or delete if I can't get anything..
Putting this here for posterity.
I had a Jenkins project configured with Maven running clean test and a execute shell in the pre steps. The logs from Maven where not coming through and the script was not executing. Once I unchecked Build modules in parallel under the Maven build options my logs and scripts started working.
Make sure its in a location where Jenkins can see it, check permissions.

Resources