mailto:jenkins,subject:test case1, case2 on http://staging.site.com
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 http://mysite.com
– mail watcher will write testcase1.checks file with BASE_URL=http://mysite.com
– shell script will set ENV variable BASE_URL=http://mysite.com
Following is the mail watcher that we simply run to be able to get Jenkins job triggered.
https://gist.github.com/3974972
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>