Skip to content

Apache DataFusion SQL Query Engine

minor: combine datafusion-ffi test binaries into ffi_integration (#26423)

Andrew Lamb894c2d323bfd
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 440a435f75..5493c9f32d 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<dyn CatalogProvider> = (&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<dyn CatalogProviderList> =
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 4e5ad56722..66a0573e4b 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 6b2cbc380f..bce4b3061f 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 0000000000..b32a54af49
--- /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 d8baf52288..5787bab55a 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 c72b8c3e88..9cd3969eae 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 090151416e..71aca901d0 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 f97153526f..adbc2a20cf 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 d1215b331b..ac87f26bff 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<dyn TableFunctionImpl> = 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 66f2621d5f..70369b2243 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 cba334e8fa..766ede2b2a 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")]