0

I have three projects in question, lets call them A, B and C. Where 'A' just prepares a cetain build scenario for B, which is the main build. C cleans up the scenario and basically resets B to its original state. I have set these projects in the same queue, and tested this process for the most part works excecpt when Project B fails. Here is the situation, which is explained below.

<project name="A" queue="main">
    <publishers>
     <email status of build/>
      <forcebuild>
        <project>B</project>
      </forcebuild>
      <forcebuild>
        <project>C</project>
      </forcebuild>
       </publishers>
   <task>Prepares special scenario</task>
 </project>
 <project name="B" queue="main">
   <publishers>
   </publishers>
    <task>Builds main project</task>
 </project>
 <project name="C" queue="main">
   <publishers>
   </publishers>
    <task>Resets special scenario</task>
 </project>

Scenarios:

  1. When project 'A' is forced, it builds project B, if B is successful, it builds C. This works fine.
  2. When project 'A' is forced, it builds project 'B', if B fails, it builds C. This is also fine in my case.
  3. Now after number 2 scenario and bug are fixed in Project B; if project A is forced once more and project B displays a cruise status of 'fixed', it DOES NOT build C. This is NOT fine?

Can anyone see that reason why project C will not build if a combination of No.2 and No.3 is happens? Any help or direction is welcomed.

Thanks.

Geddon
  • 1,266
  • 1
  • 11
  • 31

2 Answers2

1

Can project A be responsible for cleaning up the current state and preparing for the new build.

Say for example there was a power failure part way through B's build. In this configuration you would need to manually force C to be able to run the build process?

If A runs the same tasks as C, then as own task, this would remove this problem and yours too I believe.

Simon Laing
  • 1,194
  • 7
  • 18
  • Thanks. I suppose project A can be responsible for both, but A needs to be successful so B can build and C should only be built after B. This is why C is a separate project. Since A, B and C are in the same queue B will always be built before C if A is forced..... Can you explain a little more exactly what you mean by "If A runs the same tasks as C, then it's own task," ? – Geddon Nov 13 '12 at 15:56
  • 1
    You should always clean up your environment after a test case is run. Therefore, you should always run C in order to get yourself back to a valid state. – Matthew Brubaker Nov 13 '12 at 18:11
  • @Jerome. I've fixed the grammar, sorry for the confusion – Simon Laing Nov 13 '12 at 20:27
  • True, you should always do your best to clean up the environment after a build. However you should also cater for the scenario where some outside force leaves the environment in a weird state. The only way to resolve this is to clean up before also. – Simon Laing Nov 13 '12 at 20:28
  • Outside forces can be as mundane as a power failure, someone clicks' abort' etc – Simon Laing Nov 13 '12 at 20:29
1

You should always clean up your test environment after you are done with it. I would recommend using the project trigger for project C and set it up something akin to the following. This will allow C to always run if A is successful (can be changed by modifying the project trigger in C).

<project name="A" queue="main">
    <publishers>
     <email status of build/>
     <forcebuild>
       <project>B</project>
     </forcebuild>
   </publishers>
   <tasks>Prepares special scenario</tasks>
 </project>

 <project name="B" queue="main">
 ...
 </project>

 <project name="C" queue="main">
   <triggers>
     <projectTrigger project="A" />
   </triggers>
   <publishers />
   <tasks>Resets special scenario</tasks>
 </project>
Matthew Brubaker
  • 3,097
  • 1
  • 21
  • 18
  • Thanks Matthew. The funny thing is I was not able to re-create my scenarios initial stated on my local server. Both my method and the one you suggested works as expected. But moving forward i will adopt the use of the ProjectTrigger as it seems to be the cleaner way to handle these situations. Thanks again ! – Geddon Nov 15 '12 at 15:38