From 9d405369ba32df9927ca2683a579394e45fce2e0 Mon Sep 17 00:00:00 2001 From: Andrew Lamb Date: Fri, 16 Oct 2026 13:31:54 -0400 Subject: [PATCH] test: combine datafusion-ffi test binaries into ffi_integration Co-Authored-By: Claude Sonnet 5.5 --- .../{ffi_catalog.rs => cases/catalog.rs} | 9 ++----- .../tests/{ffi_config.rs => cases/config.rs} | 3 --- .../execution_plan.rs} | 1 - datafusion/ffi/tests/cases/mod.rs | 26 +++++++++++++++++++ .../physical_optimizer.rs} | 1 - .../query_planner.rs} | 3 --- .../ffi/tests/{ffi_udaf.rs => cases/udaf.rs} | 3 --- .../ffi/tests/{ffi_udf.rs => cases/udf.rs} | 3 --- .../ffi/tests/{ffi_udtf.rs => cases/udtf.rs} | 7 +---- .../ffi/tests/{ffi_udwf.rs => cases/udwf.rs} | 3 --- datafusion/ffi/tests/ffi_integration.rs | 4 +++ 11 files changed, 33 insertions(+), 30 deletions(-) rename datafusion/ffi/tests/{ffi_catalog.rs => cases/catalog.rs} (88%) rename datafusion/ffi/tests/{ffi_config.rs => cases/config.rs} (96%) rename datafusion/ffi/tests/{ffi_execution_plan.rs => cases/execution_plan.rs} (99%) create mode 100644 datafusion/ffi/tests/cases/mod.rs rename datafusion/ffi/tests/{ffi_physical_optimizer.rs => cases/physical_optimizer.rs} (98%) rename datafusion/ffi/tests/{ffi_query_planner.rs => cases/query_planner.rs} (99%) rename datafusion/ffi/tests/{ffi_udaf.rs => cases/udaf.rs} (97%) rename datafusion/ffi/tests/{ffi_udf.rs => cases/udf.rs} (97%) rename datafusion/ffi/tests/{ffi_udtf.rs => cases/udtf.rs} (89%) rename datafusion/ffi/tests/{ffi_udwf.rs => cases/udwf.rs} (93%) diff --git a/datafusion/ffi/tests/ffi_catalog.rs b/datafusion/ffi/tests/cases/catalog.rs similarity index 88% rename from datafusion/ffi/tests/ffi_catalog.rs rename to datafusion/ffi/tests/cases/catalog.rs index 440a435f75c7d..5493c9f32dfba 100644 --- a/datafusion/ffi/tests/ffi_catalog.rs +++ b/datafusion/ffi/tests/cases/catalog.rs @@ -15,11 +15,6 @@ // specific language governing permissions and limitations // under the License. -mod utils; - -/// Add an additional module here for convenience to scope this to only -/// when the feature integration-tests is built -#[cfg(feature = "integration-tests")] mod tests { use std::sync::Arc; @@ -29,7 +24,7 @@ mod tests { #[tokio::test] async fn test_catalog() -> datafusion_common::Result<()> { let module = get_module()?; - let (ctx, codec) = super::utils::ctx_and_codec(); + let (ctx, codec) = crate::utils::ctx_and_codec(); let ffi_catalog = (module.create_catalog)(codec); let foreign_catalog: Arc = (&ffi_catalog).into(); @@ -50,7 +45,7 @@ mod tests { #[tokio::test] async fn test_catalog_list() -> datafusion_common::Result<()> { let module = get_module()?; - let (ctx, codec) = super::utils::ctx_and_codec(); + let (ctx, codec) = crate::utils::ctx_and_codec(); let ffi_catalog_list = (module.create_catalog_list)(codec); let foreign_catalog_list: Arc = diff --git a/datafusion/ffi/tests/ffi_config.rs b/datafusion/ffi/tests/cases/config.rs similarity index 96% rename from datafusion/ffi/tests/ffi_config.rs rename to datafusion/ffi/tests/cases/config.rs index 4e5ad56722fe3..66a0573e4bebb 100644 --- a/datafusion/ffi/tests/ffi_config.rs +++ b/datafusion/ffi/tests/cases/config.rs @@ -15,9 +15,6 @@ // specific language governing permissions and limitations // under the License. -/// Add an additional module here for convenience to scope this to only -/// when the feature integration-tests is built -#[cfg(feature = "integration-tests")] mod tests { use datafusion::error::Result; use datafusion_common::ScalarValue; diff --git a/datafusion/ffi/tests/ffi_execution_plan.rs b/datafusion/ffi/tests/cases/execution_plan.rs similarity index 99% rename from datafusion/ffi/tests/ffi_execution_plan.rs rename to datafusion/ffi/tests/cases/execution_plan.rs index 6b2cbc380f4d5..bce4b3061fa35 100644 --- a/datafusion/ffi/tests/ffi_execution_plan.rs +++ b/datafusion/ffi/tests/cases/execution_plan.rs @@ -15,7 +15,6 @@ // specific language governing permissions and limitations // under the License. -#[cfg(feature = "integration-tests")] mod tests { use arrow::datatypes::Field; use arrow::datatypes::Schema; diff --git a/datafusion/ffi/tests/cases/mod.rs b/datafusion/ffi/tests/cases/mod.rs new file mode 100644 index 0000000000000..b32a54af49fa8 --- /dev/null +++ b/datafusion/ffi/tests/cases/mod.rs @@ -0,0 +1,26 @@ +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// with the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. + +mod catalog; +mod config; +mod execution_plan; +mod physical_optimizer; +mod query_planner; +mod udaf; +mod udf; +mod udtf; +mod udwf; diff --git a/datafusion/ffi/tests/ffi_physical_optimizer.rs b/datafusion/ffi/tests/cases/physical_optimizer.rs similarity index 98% rename from datafusion/ffi/tests/ffi_physical_optimizer.rs rename to datafusion/ffi/tests/cases/physical_optimizer.rs index d8baf522889e8..5787bab55ab8c 100644 --- a/datafusion/ffi/tests/ffi_physical_optimizer.rs +++ b/datafusion/ffi/tests/cases/physical_optimizer.rs @@ -15,7 +15,6 @@ // specific language governing permissions and limitations // under the License. -#[cfg(feature = "integration-tests")] mod tests { use std::sync::Arc; diff --git a/datafusion/ffi/tests/ffi_query_planner.rs b/datafusion/ffi/tests/cases/query_planner.rs similarity index 99% rename from datafusion/ffi/tests/ffi_query_planner.rs rename to datafusion/ffi/tests/cases/query_planner.rs index c72b8c3e889ae..9cd3969eaeacd 100644 --- a/datafusion/ffi/tests/ffi_query_planner.rs +++ b/datafusion/ffi/tests/cases/query_planner.rs @@ -15,9 +15,6 @@ // specific language governing permissions and limitations // under the License. -mod utils; - -#[cfg(feature = "integration-tests")] mod tests { use std::sync::{Arc, OnceLock, Weak}; diff --git a/datafusion/ffi/tests/ffi_udaf.rs b/datafusion/ffi/tests/cases/udaf.rs similarity index 97% rename from datafusion/ffi/tests/ffi_udaf.rs rename to datafusion/ffi/tests/cases/udaf.rs index 090151416e4e9..71aca901d0a51 100644 --- a/datafusion/ffi/tests/ffi_udaf.rs +++ b/datafusion/ffi/tests/cases/udaf.rs @@ -15,9 +15,6 @@ // specific language governing permissions and limitations // under the License. -/// Add an additional module here for convenience to scope this to only -/// when the feature integration-tests is built -#[cfg(feature = "integration-tests")] mod tests { use std::sync::Arc; diff --git a/datafusion/ffi/tests/ffi_udf.rs b/datafusion/ffi/tests/cases/udf.rs similarity index 97% rename from datafusion/ffi/tests/ffi_udf.rs rename to datafusion/ffi/tests/cases/udf.rs index f97153526f733..adbc2a20cf8ba 100644 --- a/datafusion/ffi/tests/ffi_udf.rs +++ b/datafusion/ffi/tests/cases/udf.rs @@ -15,9 +15,6 @@ // specific language governing permissions and limitations // under the License. -/// Add an additional module here for convenience to scope this to only -/// when the feature integration-tests is built -#[cfg(feature = "integration-tests")] mod tests { use arrow::array::{Array, AsArray, record_batch}; use arrow::datatypes::DataType; diff --git a/datafusion/ffi/tests/ffi_udtf.rs b/datafusion/ffi/tests/cases/udtf.rs similarity index 89% rename from datafusion/ffi/tests/ffi_udtf.rs rename to datafusion/ffi/tests/cases/udtf.rs index d1215b331b509..ac87f26bff113 100644 --- a/datafusion/ffi/tests/ffi_udtf.rs +++ b/datafusion/ffi/tests/cases/udtf.rs @@ -15,11 +15,6 @@ // specific language governing permissions and limitations // under the License. -mod utils; - -/// Add an additional module here for convenience to scope this to only -/// when the feature integration-tests is built -#[cfg(feature = "integration-tests")] mod tests { use std::sync::Arc; @@ -35,7 +30,7 @@ mod tests { #[tokio::test] async fn test_user_defined_table_function() -> Result<()> { let module = get_module()?; - let (ctx, codec) = super::utils::ctx_and_codec(); + let (ctx, codec) = crate::utils::ctx_and_codec(); let ffi_table_func = (module.create_table_function)(codec); let foreign_table_func: Arc = ffi_table_func.into(); diff --git a/datafusion/ffi/tests/ffi_udwf.rs b/datafusion/ffi/tests/cases/udwf.rs similarity index 93% rename from datafusion/ffi/tests/ffi_udwf.rs rename to datafusion/ffi/tests/cases/udwf.rs index 66f2621d5fe63..70369b2243624 100644 --- a/datafusion/ffi/tests/ffi_udwf.rs +++ b/datafusion/ffi/tests/cases/udwf.rs @@ -15,9 +15,6 @@ // specific language governing permissions and limitations // under the License. -/// Add an additional module here for convenience to scope this to only -/// when the feature integration-tests is built -#[cfg(feature = "integration-tests")] mod tests { use std::sync::Arc; diff --git a/datafusion/ffi/tests/ffi_integration.rs b/datafusion/ffi/tests/ffi_integration.rs index cba334e8fae57..766ede2b2a241 100644 --- a/datafusion/ffi/tests/ffi_integration.rs +++ b/datafusion/ffi/tests/ffi_integration.rs @@ -17,6 +17,10 @@ mod utils; +/// Run all tests that are found in the `cases` directory +#[cfg(feature = "integration-tests")] +mod cases; + /// Add an additional module here for convenience to scope this to only /// when the feature integration-tests is built #[cfg(feature = "integration-tests")]