jenkins running test code example

Example 1: how to trigger test in jenkins

2. Build Triggers
We specify how often we run those tests.
we choose Build periodically because we
want to run in certain schedule. 
in my project, we run smoke tests every morning.
so in the build trigger we entered daily option:
H 6 * * * --> every day around 6 am.
Jenkins used a cron expression, and the different fields are:

  H * * * *   ==> Build every hour at any minute (6.12 am, 8.38pm)
  0 * * * *   ==> Build every hour at exactly on the hour (6.00 am, 8.00pm)
  0 8 * * *   ==> Build every day exactly 8.00 am
  H/5 * * * * ==> Build every 5 minutes
  H 6 * * 1-5 ==> Build around 6 am from first day of the week (Monday) to 5th day (Friday)
  H 1 * 6,20 * * ==> Build on 6th and 20th day of the month around 1 am for regression

Example 2: what test you have on jenkins

I personally set up 2-3 jobs for automated tests
 One for smoke - > Smoke is running daily 2,3 times a day , making sure 
that all environments are up and running
- Full regression (80% automation 20% manual)?
* Before each production release(after 3 sprints)
* Only very stable test cases are stored in full regression
* Updating functionality
- Minor regression
* Runs at the end of sprint
* Tests that are related to certain modules and functionalities
* I use tags to specify which module to run

Tags:

Misc Example