You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@datafusion.apache.org by gi...@apache.org on 2026/10/20 22:29:51 UTC
(datafusion) 01/01: minor: combine datafusion-ffi test binaries into ffi_integration (#26423)
This is an automated email from the ASF dual-hosted git repository.
github-merge-queue[bot] pushed a commit to branch gh-readonly-queue/main/pr-26423-496b9a9badcbe5db00ecc0154b2d22d89d3bf04a
in repository https://gitbox.apache.org/repos/asf/datafusion.git
commit 894c2d323bfd123239e4afa1129e0fd3ec81e583
Author: Andrew Lamb <an...@nerdnetworks.org>
AuthorDate: Tue Oct 20 20:26:00 2026 +0000
minor: combine datafusion-ffi test binaries into ffi_integration (#26423)
## Which issue does this PR close?
This follows the same rationale as earlier PRs like
- #10588
- #11831
- #18226
- #26419
## Rationale for this change
Each `.rs` file directly in `datafusion/ffi/tests` becomes its own test
binary. In this case, the 10 standalone `ffi_*` binaries require about
**2.48 GB** (2,664,138,160 bytes) in total on my machine (macOS,
aarch64)
```shell
cargo test -p datafusion-ffi --features integration-tests --tests --no-run
```
The binaries were added in
- `ffi_integration`: #14579
- `ffi_udaf`: #14775
- `ffi_udf`: #15487
- `ffi_udtf`: #15581
- `ffi_udwf`: #16261
- `ffi_catalog`: #18657
- `ffi_config`: #19469
- `ffi_execution_plan`: #20449
- `ffi_physical_optimizer`: #20451
- `ffi_query_planner`: #24028
## What changes are included in this PR?
Combine the 10 `datafusion/ffi/tests/ffi_*.rs` files into the single
`ffi_integration` test binary:
Size of the binaries (debug build):
| binary | bytes |
|---|---|
| `ffi_catalog` | 382,295,824 |
| `ffi_config` | 6,295,496 |
| `ffi_execution_plan` | 71,841,312 |
| `ffi_integration` (before) | 382,373,904 |
| `ffi_physical_optimizer` | 71,361,096 |
| `ffi_query_planner` | 382,445,168 |
| `ffi_udaf` | 320,780,232 |
| `ffi_udf` | 319,111,528 |
| `ffi_udtf` | 407,588,120 |
| `ffi_udwf` | 320,045,480 |
| **total before (10 binaries)** | **2,664,138,160** |
| **`ffi_integration` after (1 binary)** | **408,453,600** |
So this goes from about 2.48 GB to about 390 MB (408,453,600 bytes)
(~85% smaller) and from 10 link steps to 1.
## What is the testing strategy for this PR?
CI. The same 32 tests run before and after:
```shell
cargo test -p datafusion-ffi --features integration-tests --test ffi_integration
```
## Are there any user-facing changes?
No, developer productivity / CI efficiency
Co-authored-by: Claude Sonnet 5.5 <no...@anthropic.com>
---
.../ffi/tests/{ffi_catalog.rs => cases/catalog.rs} | 9 ++------
.../ffi/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 ---
datafusion/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(-)
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")]
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@datafusion.apache.org
For additional commands, e-mail: commits-help@datafusion.apache.org