mailto:jenkins,subject:test case1, case2 on

mailto:jenkins,subject:test case1, case2 on

So this is something we thought of

– email Jenkins
– to run one or more jobs
– against one of our deployed staging apps(given base_url)

We wrote a mail_watcher.rb, which periodically reads such emails, and rewrite <JENKINS_CHECKS_DIR>/<test_case_name>.checks files adding parameters to be passed on to the test case. In this case it is BASE_URL=. And all we know that we could make Jenkins

1. watch files getting modified
2. use file contents(key=val), as paramters further to be used or passed on to the job exec

Ohh, wait, I did not know how could Jenkins read parameters from a given key=val file and pass it on further. We actaully wrote another shell script which runs as the first step of every job and reads the testcase_name.checks file and set ENV variables like for example BASE_URL.

So in case of subject:test testcase1 on

– mail watcher will write testcase1.checks file with BASE_URL=
– shell script will set ENV variable BASE_URL=

Following is the mail watcher that we simply run to be able to get Jenkins job triggered.

Now any of us teammates, can anytime send an email and get a test case executed. In addition we are as well generating a detailed report email for each job-run that gets published on a Google group. We do have our own custom, half-baked, reporting mechanism(ruby code), which we want to compile the job-execution-report email for each testcase/job executed.

Example reports

subject: testcase1 failed.
body: <Jenkins console output>

subject: rspec 231 passed, 2 failed.
body: <Jenkins console output>

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s