alamb commented on code in PR #4665:
URL: https://github.com/apache/arrow-datafusion/pull/4665#discussion_r1051594533


##########
datafusion/core/tests/sqllogictests/test_files/aggregate.slt:
##########
@@ -1077,3 +1077,17 @@ b 5
 c 4
 d 4
 e 4
+
+
+
+# array_agg_zero

Review Comment:
   Writing these tests was amazing -- I just added the queries and the 
`--complete` mode added the expected results ❤️ 



##########
datafusion/core/tests/sqllogictests/src/main.rs:
##########
@@ -78,78 +78,49 @@ pub async fn main() -> Result<()> {
 #[cfg(not(target_family = "windows"))]
 pub async fn main() -> Result<()> {
     // Enable logging (e.g. set RUST_LOG=debug to see debug logs)
+
+    use sqllogictest::{default_validator, update_test_file};
     env_logger::init();
 
-    // run each file using its own new DB
-    //
-    // Note: can't use tester.run_parallel_async()
-    // as that will reuse the same SessionContext
-    //
-    // We could run these tests in parallel eventually if we wanted.
+    let options = Options::new();
+
+    // default to all files in test directory filtering based on name
+    let files: Vec<_> = std::fs::read_dir(TEST_DIRECTORY)
+        .unwrap()
+        .map(|path| path.unwrap().path())
+        .filter(|path| options.check_test_file(path.as_path()))
+        .collect();
 
-    let files = get_test_files();
     info!("Running test files {:?}", files);
 
     for path in files {
         println!("Running: {}", path.display());
 
         let file_name = 
path.file_name().unwrap().to_str().unwrap().to_string();
 
+        // Create the test runner
         let ctx = context_for_test_file(&file_name).await;
-
-        let mut tester = sqllogictest::Runner::new(DataFusion { ctx, file_name 
});
-        tester.run_file_async(path).await?;
+        let mut runner = sqllogictest::Runner::new(DataFusion { ctx, file_name 
});
+
+        // run each file using its own new DB
+        //
+        // We could run these tests in parallel eventually if we wanted.
+        if options.complete_mode {
+            info!("Using complete mode to complete {}", path.display());
+            let col_separator = " ";
+            let validator = default_validator;
+            update_test_file(path, runner, col_separator, validator)

Review Comment:
   This calls the excellent function `update_test_file` from @xxchan added in 
https://github.com/risinglightdb/sqllogictest-rs/pull/130 👨‍🍳 👌 



-- 
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