Просмотр исходного кода

HUE-910 [oozie] Add labels to Oozie instrumentation timers

Adding tests
Romain Rigaux 12 лет назад
Родитель
Сommit
3d4c3c5

+ 18 - 2
apps/oozie/src/oozie/templates/dashboard/list_oozie_info.mako

@@ -89,8 +89,24 @@ ${ layout.menubar(section='dashboard') }
                         <tbody>
                           % for item in group['data']:
                             <tr>
-                              <td>${ item.pop('name') }</td>
-                              <td>${ ', '.join(map(str, item.values())) }</td>
+                              <% name = item.pop('name') %>
+                              <td>${ name }</td>
+                              % if category == 'timers':
+                                <td>
+                                  % for label, timer in zip(['ownMinTime', 'ownTimeStdVar', 'totalTimeStdVar', 'ownTimeAvg', 'ticks', 'name', 'ownMaxTime', 'totalMinTime', 'totalMaxTime', 'totalTimeAvg'], item.values()):
+                                  ${ label } :
+                                  % if label == 'name':
+                                    ${ name } -
+                                  % endif
+                                  ${ timer }
+                                  % if not loop.last:
+                                    </br>
+                                  % endif
+                                  % endfor
+                                </td>
+                              % else:
+                                <td>${ ', '.join(map(str, item.values())) }</td>
+                              % endif
                             </tr>
                           % endfor
                         </tbody>

+ 16 - 0
apps/oozie/src/oozie/tests.py

@@ -2122,6 +2122,22 @@ class TestDashboardNoMocking:
       finish()
 
 
+class TestDashboardWithOozie(OozieBase):
+
+  def test_oozie_page(self):
+    response = self.c.get(reverse('oozie:list_oozie_info'))
+    assert_true('version' in response.content, response.content)
+    assert_true('NORMAL' in response.content, response.content)
+
+    assert_true('variables' in response.content, response.content)
+    assert_true('timers' in response.content, response.content)
+    assert_true('counters' in response.content, response.content)
+
+    assert_true('ownMinTime' in response.content, response.content)
+    assert_true(':END:#action.end' in response.content, response.content)
+    assert_true('oozie.base.url' in response.content, response.content)
+
+
 class TestDashboard(OozieMockBase):
 
   def test_manage_workflow_dashboard(self):