From f4fb261229a660becfed2600540189fbb67cfc5f Mon Sep 17 00:00:00 2001 From: Bruce Ritchie Date: Sun, 15 Dec 2024 22:56:21 +0000 Subject: [PATCH] Added completed in xx time message --- datafusion/sqllogictest/bin/sqllogictests.rs | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/datafusion/sqllogictest/bin/sqllogictests.rs b/datafusion/sqllogictest/bin/sqllogictests.rs index 3434f1c3c5a0..3ab4ae61ac89 100644 --- a/datafusion/sqllogictest/bin/sqllogictests.rs +++ b/datafusion/sqllogictest/bin/sqllogictests.rs @@ -24,14 +24,14 @@ use std::future::Future; use std::path::{Path, PathBuf}; #[cfg(feature = "postgres")] use std::{env, thread}; - +use std::time::Instant; use clap::Parser; use datafusion_common::utils::get_available_parallelism; use datafusion_common::{exec_datafusion_err, exec_err, DataFusionError, Result}; use datafusion_common_runtime::SpawnedTask; use datafusion_sqllogictest::{DataFusion, TestContext}; use futures::stream::StreamExt; -use indicatif::{MultiProgress, ProgressBar, ProgressDrawTarget, ProgressStyle}; +use indicatif::{HumanDuration, MultiProgress, ProgressBar, ProgressDrawTarget, ProgressStyle}; use itertools::Itertools; use log::Level::{Info, Warn}; use log::{info, log_enabled, warn}; @@ -201,6 +201,8 @@ async fn run_tests() -> Result<()> { .unwrap() .progress_chars("##-"); + let start = Instant::now(); + let errors: Vec<_> = futures::stream::iter(read_test_files(&options)?) .map(|test_file| { let validator = if options.include_sqlite @@ -265,7 +267,7 @@ async fn run_tests() -> Result<()> { .collect() .await; - m.println("Completed")?; + m.println(format!("Completed in {}", HumanDuration(start.elapsed())))?; #[cfg(feature = "postgres")] if options.postgres_runner {