Problem
 
                
               
               It is a common practice to have execution plans in a hierarchical structure that represents different testing areas or purposes.
                  In some cases, for example for knowing the test status and therefore the quality of an area or purpose, you will want to know
                  the overall passed, failed, and not executed count. 
                  
               
 
               
              
            
            
               Solution
 
                
               
               Use the data mart view 
                  RV_ExecutionPlanStatusRollup to create a report that returns the passed, failed, and not executed counts grouped by build for a specific execution planning
                  folder. 
                  
               
 
               
                
                  SELECT BuildName, PassedCount, FailedCount, NotExecutedCount
FROM RV_ExecutionPlanStatusRollup
WHERE ExecutionFolderID = ${executionPlanID|43|Execution Plan ID} 
                    
               
               The query does the following: 
                  
                  
 
                     
                     - Selects 
                        BuildName and the status counts from the 
                        RV_ExecutionPlanStatusRollup view. 
                        
                     
- Specifies the top-level folder you want the status from (ExecutionFolderID). 
                        
                     
The result of the SQL query shows the status of your test runs in all execution plans of the selected folder, aggregated per
                  build. 
                  
                  
                     
                         
                           
                            
                              
                              | BuildName | PassedCount | FailedCount | NotExecutedCount | 
                         
                        
                         
                           
                            
                              
                              | 351 | 0 | 0 | 2 | 
 
                           
                            
                              
                              | 352 | 15 | 7 | 1 | 
 
                           
                         
                        
                     
                    
                  
               If you are interested in more details, for example the status counts for each execution plan within the selected hierarchy,
                  you can use the data mart view 
                  
RV_ExecutionPlanStatusPerBuild: 
                  
SELECT eps.BuildName, eps.ExecutionPlanID, SUM(eps.PassedCount) PassedCount,
  SUM(eps.FailedCount) FailedCount, SUM(eps.NotExecutedCount) NotExecutedCount
FROM RV_ExecutionPlanStatusPerBuild eps
INNER JOIN TM_ExecTreePaths etp ON eps.ExecutionPlanID = etp.NodeID_pk_fk
WHERE etp.ParentNodeID_pk_fk = ${execFolderID|44|Execution Folder ID}
GROUP BY eps.ExecutionPlanID, eps.BuildOrderNumber, eps.BuildName
ORDER BY eps.BuildOrderNumber, eps.ExecutionPlanID 
                  The query does the following: 
                  
                  
 
                     
                     - Uses the 
                        RV_ExecutionPlanStatusPerBuild view to access execution-plan specific data (ExecutionPlanID and 
                        ExecutionPlanName). The previously used 
                        RV_ExecutionPlanStatusRollup view contains pre-aggregated data (summed up data), which is not suitable for the purpose here as you would get results not
                        only for execution plans but for the folder nodes as well. 
                        
                     
- Selects all nodes within a specific folder with a 
                        JOIN of the 
                        TM_ExecTreePath table to bring in hierarchy information. 
                        
                     
- Specifies the top-level folder with 
                        ExecutionFolderID. As the table 
                        TM_ExecutionTreePaths also contains a self-reference for every execution plan, you could run this query with an execution plan ID for 
                        ParentNodeID_pk_fk too, which would return the rows for the specific execution plan. 
                        
                     
- Adds 
                        ORDER BY BuildOrderNumber and 
                        ExecutionPlanID to get a nicely ordered result, showing the oldest builds and their execution plans first. 
                        
                     
The result of the SQL query shows the status of your test runs in all execution plans of the selected folder. 
                  
                  
                     
                         
                           
                            
                              
                              | BuildName | ExecutionPlanID | PassedCount | FailedCount | NotExecutedCount | 
                         
                        
                         
                           
                            
                              
                              | 351 | 2307 | 0 | 0 | 2 | 
 
                           
                            
                              
                              | 352 | 2184 | 11 | 2 | 0 | 
 
                           
                            
                              
                              | 352 | 2185 | 0 | 3 | 0 | 
 
                           
                            
                              
                              | 352 | 2186 | 2 | 1 | 0 | 
 
                           
                            
                              
                              | 352 | 2187 | 1 | 0 | 0 | 
 
                           
                            
                              
                              | 352 | 2191 | 0 | 1 | 0 | 
 
                           
                            
                              
                              | 352 | 2307 | 1 | 0 | 1 |