comphead commented on code in PR #24493:
URL: https://github.com/apache/datafusion/pull/24493#discussion_r3864289666
##########
datafusion/sqllogictest/bin/sqllogictests.rs:
##########
@@ -443,33 +443,48 @@ async fn run_test_file_substrait_round_trip(
path,
relative_path,
} = test_file;
- let Some(test_ctx) =
TestContext::try_new_for_test_file(&relative_path).await else {
- info!("Skipping: {}", path.display());
- return Ok(());
- };
- setup_scratch_dir(&relative_path)?;
- let count: u64 = get_record_count(&path,
"DatafusionSubstraitRoundTrip".to_string());
- let pb = mp.add(ProgressBar::new(count));
+ // Parsed once and replayed for every configuration.
+ let records = parse_records(&path)?;
+ let count = count_records(&records, "DatafusionSubstraitRoundTrip");
- pb.set_style(mp_style);
- pb.set_message(relative_path.display().to_string());
+ for test_configuration in test_configurations(&path)? {
+ let Some(test_ctx) =
TestContext::try_new_for_test_file(&relative_path).await
+ else {
+ info!("Skipping: {}", path.display());
+ return Ok(());
+ };
+ setup_scratch_dir(&relative_path)?;
+ // Before the engine is built: it snapshots config to detect drift.
+ test_ctx.apply_config_overrides(test_configuration.settings(),
&relative_path)?;
+
+ let pb = mp.add(ProgressBar::new(count));
+ pb.set_style(mp_style.clone());
+ pb.set_message(relative_path.display().to_string());
+
+ let mut runner = sqllogictest::Runner::new(|| async {
+ Ok(DataFusionSubstraitRoundTrip::new(
+ test_ctx.session_ctx().clone(),
+ relative_path.clone(),
+ pb.clone(),
+ )
+ .with_currently_executing_sql_tracker(
+ currently_executing_sql_tracker.clone(),
+ ))
+ });
+ runner.add_label("DatafusionSubstraitRoundTrip");
+ runner.with_column_validator(strict_column_validator);
+ runner.with_normalizer(value_normalizer);
+ runner.with_validator(validator);
+ let result =
+ run_file_in_runner(&path, &records, &mut runner, filters,
colored_output)
+ .await;
+ pb.finish_and_clear();
+
+ test_configuration.attribute_failure(result)?;
Review Comment:
Thanks @kosiew for trying this, I made a smoke test it worked, checking what
is with substrait
--
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]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]