4

I have some hardware components I'm looking to test in a semi-automated fashion. This will involve procedural steps similar to:

  1. Prompt user to connect signal A to connector J1
  2. After user confirms this is in place, automatically check for successful signal detection

I have experience writing such tests using bash, python, etc. I have also used Jenkins to manage builds and automated tests. What I would like to do (if possible) is combine the two somehow and use Jenkins to manage running of an interactive script on a test computer. This would allow me to leverage Jenkins' ability to consistently spawn scripts on a test computer and archive artifacts and console output history indefinitely. The part I'm not sure about is how to allow a user to interact with a Jenkins job that is in progress. Does anyone have any experience with this or know if it is possible?

This is on a Linux system, so maybe I can run it in a 'screen' session that the user could attach to?

Is there a better tool to use for this that I haven't considered?

Edit 1:

I did hear about the "Remote Terminal Access Plugin", but that doesn't allow direct interaction with the Jenkins build.

The best potential solution I've found so far is to launch a 'screen' session with logging enabled and have the user interact with this session on the slave:

screen -S test -d -m -L ./myscript.sh
PID=`screen -list | grep test | awk '{print $1}' | sed 's/\..*//g'`

#This will show the output of the screen session in the jenkins console:
tail -f screenlog.0 --pid=$PID

Then at the slave, a user can attach to this screen like this:

screen -r test

The downside to this method is that Jenkins doesn't get feedback if something fails.

1 Answer 1

0

You basically need some way to pause build until user interaction. I think there is no such public plug-in yet but you can check if some file exists or its contents and loop-sleep until your condition is met. Or you can check a remote URL instead. When user is ready, you change the file/url, your job detects that and continues.

I think such plug-in wouldn't be hard to write but nothing out there yet... except maybe have you looked at the jbpm plug-in? It must be usable in complicated scenarios.

Not the answer you're looking for? Browse other questions tagged or ask your own question.