0

I use jenkins for my countinuous integration testing + possibility of starting manual checks.

My utilization is a job that :

  1. Poll mercurial repo every 10 mn
  2. Once a commit is done, start a generation (clone + make)
  3. Launch a python suite test script
  4. Gather result

Sometimes I want to be able to gracefully stop a job without using the "stop" button that simply aborts the test. I managed to do it using a trick that check the presence of a file in the log directory used by the Python test suite

But I'm looking for a way to do it inside jenkins job itself.

Is there a way to have a customizable button for that purpose ? I tried "batch task" plugin that would have been perfect BUT it waits for the python script to complete before execution ... So useless in my case (but the code works)

Thanks in advance for your help

ALNO
  • 1
  • Hi ALNO, what exactly are you trying to achieve? You want to abort the python script but still run other parts of the pipeline? In this case, this might be a solution https://stackoverflow.com/questions/43599268/how-to-catch-manual-ui-cancel-of-job-in-jenkinsfile – smelm Sep 24 '20 at 16:03
  • Hi ! In fact, the python tests suite is running a "while test" loop. Between each loop, it checks the presence of a "stop_test.txt" file in the log directory. So I want to be able to have a button (or other mecanism) to create this file inside the job execution (because the job knows the directory of logs I'll check your solution, thanks – ALNO Sep 25 '20 at 06:39
  • My first thought is, that this isn't a particularly well designed test. Is there any reason for the while loop inside the test? That being said, you could just have another job which only creates this flag file in the other jobs workspace. – smelm Sep 25 '20 at 17:28
  • That's what I finally did yes, thanks for the help – ALNO Sep 28 '20 at 06:27

0 Answers0