tvalentyn commented on code in PR #27288:
URL: https://github.com/apache/beam/pull/27288#discussion_r1259012603


##########
sdks/python/apache_beam/testing/analyzers/perf_analysis_test.py:
##########
@@ -193,6 +198,32 @@ def test_alert_on_data_with_reported_change_point(self, 
*args):
         big_query_metrics_fetcher=None)
     self.assertFalse(is_alert)
 
+  def test_change_point_has_anomaly_marker_in_gh_description(self):
+    metric_values, timestamps = get_fake_data_with_change_point()
+    timestamps = [datetime.datetime.fromtimestamp(ts) for ts in timestamps]
+    change_point_index = find_latest_change_point_index(metric_values)
+
+    description = github_issues_utils.get_issue_description(
+        test_name=self.test_id,
+        test_description=self.params['test_description'],
+        metric_name=self.params['metric_name'],
+        metric_values=metric_values,
+        timestamps=timestamps,
+        change_point_index=change_point_index,
+        max_results_to_display=(
+            constants._NUM_RESULTS_TO_DISPLAY_ON_ISSUE_DESCRIPTION))
+
+    runs_info = next((

Review Comment:
   This is too specific to the formatting, and if one changes the formatting, 
one would have to modify the test. The "new lines joiner" constant a sample 
inconvenience that this creates. We could simplify this scenario by checking 
that anomaly marker occurs only once, and and that the string "metric_value: 
{anomaly_value} {_ANOMALY_MARKER}" occurs in the description.  



##########
sdks/python/apache_beam/testing/analyzers/perf_analysis_test.py:
##########
@@ -193,6 +198,32 @@ def test_alert_on_data_with_reported_change_point(self, 
*args):
         big_query_metrics_fetcher=None)
     self.assertFalse(is_alert)
 
+  def test_change_point_has_anomaly_marker_in_gh_description(self):
+    metric_values, timestamps = get_fake_data_with_change_point()

Review Comment:
   fake data returns a series with a changepoint exactly in the middle. can we 
add a skew?  



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to