You are viewing a plain text version of this content. The canonical link for it is here.
Posted to github@arrow.apache.org by GitBox <gi...@apache.org> on 2021/08/24 18:36:49 UTC

[GitHub] [arrow-datafusion] alamb commented on a change in pull request #938: Add metrics for SortExect + HashExec

alamb commented on a change in pull request #938:
URL: https://github.com/apache/arrow-datafusion/pull/938#discussion_r695105559



##########
File path: datafusion/tests/sql.rs
##########
@@ -2212,6 +2215,111 @@ async fn csv_explain_analyze_verbose() {
     );
 }
 
+/// A macro to assert that some particular line contains two substrings
+///
+/// Usage: `assert_metrics!(actual, operator_name, metrics)`
+///
+macro_rules! assert_metrics {
+    ($ACTUAL: expr, $OPERATOR_NAME: expr, $METRICS: expr) => {
+        let found = $ACTUAL
+            .lines()
+            .any(|line| line.contains($OPERATOR_NAME) && line.contains($METRICS));
+        assert!(
+            found,
+            "Can not find a line with both '{}' and '{}' in\n\n{}",
+            $OPERATOR_NAME, $METRICS, $ACTUAL
+        );
+    };
+}
+
+#[tokio::test]
+async fn explain_analyze_baseline_metrics() {

Review comment:
       Here is the basic testing strategy I plan for these baseline metrics




-- 
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: github-unsubscribe@arrow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org