[ 
https://issues.apache.org/jira/browse/BEAM-4065?focusedWorklogId=101654&page=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-101654
 ]

ASF GitHub Bot logged work on BEAM-4065:
----------------------------------------

                Author: ASF GitHub Bot
            Created on: 14/May/18 10:12
            Start Date: 14/May/18 10:12
    Worklog Time Spent: 10m 
      Work Description: szewi commented on a change in pull request #5180: 
[BEAM-4065] Basic performance tests analysis added.
URL: https://github.com/apache/beam/pull/5180#discussion_r187900175
 
 

 ##########
 File path: .test-infra/jenkins/verify_performance_test_results_test.py
 ##########
 @@ -0,0 +1,62 @@
+#!/usr/bin/env python
+#
+#
+#    Licensed to the Apache Software Foundation (ASF) under one or more
+#    contributor license agreements.  See the NOTICE file distributed with
+#    this work for additional information regarding copyright ownership.
+#    The ASF licenses this file to You under the Apache License, Version 2.0
+#    (the "License"); you may not use this file except in compliance with
+#    the License.  You may obtain a copy of the License at
+#
+#       http://www.apache.org/licenses/LICENSE-2.0
+#
+#    Unless required by applicable law or agreed to in writing, software
+#    distributed under the License is distributed on an "AS IS" BASIS,
+#    WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+#    See the License for the specific language governing permissions and
+#    limitations under the License.
+#
+#   This script performs testing of scenarios from 
verify_performance_test_results.py
+#
+
+import unittest, mock
+from mock import patch
+from verify_performance_test_results import create_report
+
+class VerifyAnalysisScript(unittest.TestCase):
+    """Tests for `verify_performance_test_results.py`."""
+
+    @patch('verify_performance_test_results.count_queries', return_value=0)
+    def test_create_daily_report_when_no_data_was_uploaded(self, *args):
+        """Testing creating report when no data was uploaded. Expected: Error 
message"""
+        output_message = create_report(["test_bq_table"], "test", False)
+        assert "no tests results uploaded in recent 24h." in output_message
+
+    @patch('verify_performance_test_results.count_queries', return_value=1)
+    @patch('verify_performance_test_results.get_average_from', return_value=10)
+    @patch('verify_performance_test_results.get_stddev_from', return_value=10)
+    def test_create_daily_report_when_single_entry_was_uploaded(self, *args):
+        """Testing stddev value when single data entry was uploaded. Expected: 
0"""
+        output_message = create_report(["test_bq_table"], "test", False)
+        assert ", stddev 0.00" in output_message
+
+    @patch('verify_performance_test_results.count_queries', side_effect=[1, 0])
+    @patch('verify_performance_test_results.get_average_from', return_value=10)
+    @patch('verify_performance_test_results.get_stddev_from', return_value=10)
+    def test_create_daily_report_when_no_historical_data_was_uploaded(self, 
*args):
+        """Testing output when no historical data is available. Expected: no 
message."""
+        output_message = create_report(["test_bq_table"], "test", False)
+        self.assertEqual(output_message, "")
+
+    @patch('verify_performance_test_results.count_queries', side_effect=[5, 5])
 
 Review comment:
   Ok, those tests take no longer than a second, so I will add them as a part 
of Performance Analysis job to be executed before running 
verify_performance_test_results.py script.

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


Issue Time Tracking
-------------------

    Worklog Id:     (was: 101654)
    Time Spent: 8h  (was: 7h 50m)

> Performance Tests Results Analysis and Regression Detection
> -----------------------------------------------------------
>
>                 Key: BEAM-4065
>                 URL: https://issues.apache.org/jira/browse/BEAM-4065
>             Project: Beam
>          Issue Type: Improvement
>          Components: build-system
>            Reporter: Kamil Szewczyk
>            Assignee: Kamil Szewczyk
>            Priority: Major
>          Time Spent: 8h
>  Remaining Estimate: 0h
>
> Performance tests are running on Jenkins on regular basis and results are 
> pushed to BigQuery. However there is no automatic regression detection or 
> daily reports with results.



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)

Reply via email to