1
votes

In Jenkins, I am running two tests in only one job. One is a smoke test and the other is a regression test.

When the smoke test is passed, then the regression test starts to run.

Both tests are done in only one build one after another.

Now I want to send an email when the smoke test is passed -- in other words, before the regression test starts.

For infomation, if the smoke test pass, than in the Jenkins console

Smoke Test:PASSED 

is shown.

I have tried email-ext plugin as

Post build action

and it is sending an email after completing the total build -- in other words, after completing the regression test.

Please help me to find a solution.

1
Please add more information about your project configuration. Is this a Maven project with two JUnit tests? Is it a custom build config? Are you using build plugins? Anything else? The solution really depends on how you are performing your build.André Stannek
my project is a maven project and i am using builld plugins. Please, if u know the process how to do it, please u can tell me..whether using any other plugins or not.noor
If it is a single Maven project you could split it up using profiles. Define two build profiles that each includes one of the tests. Then configure your Jenkins job to run the build with the profile of the first test. After that you introduce a step that is sending the mail. After that you run the build with the other profile. Can't go into detail right now but you'll figure it out :-)André Stannek
sorry, my requirement is run both smoke and regression test in only one build..... :(noor
than you can't solve this problem with Jenkins. As far as I know, there is no way to do something else during a single Maven run. Maybe you can solve this in Maven itself with a plugin but I don't know.André Stannek

1 Answers

1
votes

One solution is described here: Jenkins: Sending email based on each build step result in same Jenkins Job

But I did some tests and I'm not sure it will solve your pb.

There is another solution using the Jenkins Workflow plugin.

With this plugin, you design your job with a DSL and you can easily add a build step to send an email: https://www.cloudbees.com/blog/mail-step-jenkins-workflow