From 516dacdd609b66077e3e90d20bdd3da8b3c43b6e Mon Sep 17 00:00:00 2001 From: Andrew Lamb Date: Wed, 29 Jan 2025 09:00:32 -0500 Subject: [PATCH 1/3] Minor: include the number of files run in sqllogictest display --- datafusion/sqllogictest/bin/sqllogictests.rs | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/datafusion/sqllogictest/bin/sqllogictests.rs b/datafusion/sqllogictest/bin/sqllogictests.rs index 2c518217d5ed..51dba2b5ed24 100644 --- a/datafusion/sqllogictest/bin/sqllogictests.rs +++ b/datafusion/sqllogictest/bin/sqllogictests.rs @@ -120,7 +120,9 @@ async fn run_tests() -> Result<()> { let start = Instant::now(); - let errors: Vec<_> = futures::stream::iter(read_test_files(&options)?) + let test_files = read_test_files(&options)?; + let num_tests = test_files.len(); + let errors: Vec<_> = futures::stream::iter(test_files) .map(|test_file| { let validator = if options.include_sqlite && test_file.relative_path.starts_with(SQLITE_PREFIX) @@ -184,7 +186,7 @@ async fn run_tests() -> Result<()> { .collect() .await; - m.println(format!("Completed in {}", HumanDuration(start.elapsed())))?; + m.println(format!("Completed {} tests in {}", num_tests, HumanDuration(start.elapsed())))?; #[cfg(feature = "postgres")] terminate_postgres_container().await?; @@ -491,9 +493,9 @@ impl TestFile { } } -fn read_test_files<'a>( - options: &'a Options, -) -> Result + 'a>> { +fn read_test_files( + options: &Options, +) -> Result> { let mut paths = read_dir_recursive(TEST_DIRECTORY)? .into_iter() .map(TestFile::new) @@ -516,7 +518,7 @@ fn read_test_files<'a>( paths.append(&mut sqlite_paths) } - Ok(Box::new(paths.into_iter())) + Ok(paths) } /// Parsed command line options From 45b7062862d804bf0605cb4f78ef1d2f32848aa4 Mon Sep 17 00:00:00 2001 From: Andrew Lamb Date: Wed, 29 Jan 2025 09:48:12 -0500 Subject: [PATCH 2/3] fmt --- datafusion/sqllogictest/bin/sqllogictests.rs | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/datafusion/sqllogictest/bin/sqllogictests.rs b/datafusion/sqllogictest/bin/sqllogictests.rs index 51dba2b5ed24..e9cc186f7ab5 100644 --- a/datafusion/sqllogictest/bin/sqllogictests.rs +++ b/datafusion/sqllogictest/bin/sqllogictests.rs @@ -186,7 +186,11 @@ async fn run_tests() -> Result<()> { .collect() .await; - m.println(format!("Completed {} tests in {}", num_tests, HumanDuration(start.elapsed())))?; + m.println(format!( + "Completed {} tests in {}", + num_tests, + HumanDuration(start.elapsed()) + ))?; #[cfg(feature = "postgres")] terminate_postgres_container().await?; @@ -493,9 +497,7 @@ impl TestFile { } } -fn read_test_files( - options: &Options, -) -> Result> { +fn read_test_files(options: &Options) -> Result> { let mut paths = read_dir_recursive(TEST_DIRECTORY)? .into_iter() .map(TestFile::new) From 5c969e10641fb3f89a54e2b34228070785aa7ac6 Mon Sep 17 00:00:00 2001 From: Andrew Lamb Date: Wed, 29 Jan 2025 16:53:42 -0500 Subject: [PATCH 3/3] Update datafusion/sqllogictest/bin/sqllogictests.rs --- datafusion/sqllogictest/bin/sqllogictests.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/datafusion/sqllogictest/bin/sqllogictests.rs b/datafusion/sqllogictest/bin/sqllogictests.rs index e9cc186f7ab5..2dda60074b5b 100644 --- a/datafusion/sqllogictest/bin/sqllogictests.rs +++ b/datafusion/sqllogictest/bin/sqllogictests.rs @@ -187,7 +187,7 @@ async fn run_tests() -> Result<()> { .await; m.println(format!( - "Completed {} tests in {}", + "Completed {} test files in {}", num_tests, HumanDuration(start.elapsed()) ))?;