Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Minor: include the number of files run in sqllogictest display #14359

Merged
merged 3 commits into from
Jan 30, 2025
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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>> {
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This function was already basically returning a Vec so there didn't seem to be any need to have the iterator indirection

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