How to Execute Local Python Scripts in Jenkins Ui

How to execute local python scripts in Jenkins UI

Create a Jenkins job and run your scripts as shell script from jenkins job.
Like this

#!/bin/sh
python <absolute_path_of_python_script>.py

Run Python script that calls ADB command to run UI tests in Jenkins

The test was failing because the app wasn't being built correctly.

To build the APK this command must be used:

./gradlew clean assembleAdhoctestDebug assembleAdhoctestDebugAndroidTest

This will generate TWO APKs, both must be installed in the simulator.

/usr/local/bin/adb root

/usr/local/bin/adb push app/build/outputs/apk/adhoctest/debug/app-adhoctest-debug.apk /data/local/tmp/com.myproj.adhoctest

/usr/local/bin/adb shell pm install -t -r "/data/local/tmp/com.myproj.adhoctest"

/usr/local/bin/adb push app/build/outputs/apk/androidTest/adhoctest/debug/app-adhoctest-debug-androidTest.apk /data/local/tmp/com.myproj.adhoctest.test

/usr/local/bin/adb shell pm install -t -r "/data/local/tmp/com.myproj.adhoctest.test"

How to allow jenkins from local machine to run remote python test scripts

You might want to have a look at this:
https://wiki.jenkins-ci.org/display/JENKINS/Distributed+builds

for you req, precisely this part:
https://wiki.jenkins-ci.org/display/JENKINS/Distributed+builds#Distributedbuilds-Launchslaveagentheadlessly

However, i believe you still have to have java on your slave unix node to run the slave.jar on it

Run jenkins job periodically

You should use the Build periodically option as below:

H(0-6) ****

you should use the hours option **** means every day in every week of every month of every year during 0-6 hours this worked perfectly for me

Answer :

 H(0-10) 13 * * *


Related Topics



Leave a reply



Submit