Commits

Andriy Kornatskyy committed 37055e7

Split public and static benchmark tests.

  • Participants
  • Parent commits d2ef3bb

Comments (0)

Files changed (1)

File demos/template/src/public/web/tests/benchmark_views.py

 from public.web.tests.test_views import ErrorTestCase
 
 
-class BenchmarkTestCase(PublicTestCase, ErrorTestCase):  # pragma: nocover
+class PublicBenchmarkTestCase(PublicTestCase, ErrorTestCase):  # pragma: nocover
 
     def runTest(self):
         """ Perform bachmark and print results.
         """
         p = Benchmark((
+            self.test_root,
             self.test_home,
             self.test_about,
             self.test_error_400,
             self.test_error_403,
             self.test_error_404,
+        ), 1000)
+        p.report('public', baselines={
+            'test_root': 1.0,
+            'test_home': 0.8,
+            'test_about': 0.8,
+            'test_error_400': 0.75,
+            'test_error_403': 0.75,
+            'test_error_404': 0.75,
+        })
+
+
+class StaticBenchmarkTestCase(PublicTestCase, ErrorTestCase):  # pragma: nocover
+
+    def runTest(self):
+        """ Perform bachmark and print results.
+        """
+        p = Benchmark((
             self.test_static_files,
             self.test_static_file_not_found,
             self.test_static_file_forbidden,
             self.test_static_file_gzip,
             self.test_head_static_file,
         ), 1000)
-        p.report('public', baselines={
-            'test_home': 1.0,
-            'test_about': 0.95,
-            'test_error_400': 0.95,
-            'test_error_403': 0.95,
-            'test_error_404': 0.95,
-            'test_static_files': 2.17,
-            'test_static_file_not_found': 2.1,
-            'test_static_file_forbidden': 2.3,
-            'test_static_file_gzip': 11.4,
-            'test_head_static_file': 12.5,
+        p.report('static', baselines={
+            'test_static_files': 1.00,
+            'test_static_file_not_found': 0.95,
+            'test_static_file_forbidden': 1.05,
+            'test_static_file_gzip': 5.2,
+            'test_head_static_file': 5.6,
         })