Skip to content

Commit

Permalink
Minor: include the number of files run in sqllogictest display (#14359)
Browse files Browse the repository at this point in the history
* Minor: include the number of files run in sqllogictest display

* fmt

* Update datafusion/sqllogictest/bin/sqllogictests.rs
  • Loading branch information
alamb authored Jan 30, 2025
1 parent 7efa2f3 commit 0edc3d9
Showing 1 changed file with 10 additions and 6 deletions.
16 changes: 10 additions & 6 deletions datafusion/sqllogictest/bin/sqllogictests.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down Expand Up @@ -184,7 +186,11 @@ async fn run_tests() -> Result<()> {
.collect()
.await;

m.println(format!("Completed in {}", HumanDuration(start.elapsed())))?;
m.println(format!(
"Completed {} test files in {}",
num_tests,
HumanDuration(start.elapsed())
))?;

#[cfg(feature = "postgres")]
terminate_postgres_container().await?;
Expand Down Expand Up @@ -491,9 +497,7 @@ impl TestFile {
}
}

fn read_test_files<'a>(
options: &'a Options,
) -> Result<Box<dyn Iterator<Item = TestFile> + 'a>> {
fn read_test_files(options: &Options) -> Result<Vec<TestFile>> {
let mut paths = read_dir_recursive(TEST_DIRECTORY)?
.into_iter()
.map(TestFile::new)
Expand All @@ -516,7 +520,7 @@ fn read_test_files<'a>(
paths.append(&mut sqlite_paths)
}

Ok(Box::new(paths.into_iter()))
Ok(paths)
}

/// Parsed command line options
Expand Down

0 comments on commit 0edc3d9

Please sign in to comment.