Skip to content

Commit 75f9b49

Browse files
committed
Test more feature flag combinations in CI (#1630)
1 parent ba38ebe commit 75f9b49

File tree

16 files changed

+54
-260
lines changed

16 files changed

+54
-260
lines changed

.github/workflows/rust.yml

+33-73
Original file line numberDiff line numberDiff line change
@@ -108,31 +108,42 @@ jobs:
108108
109109
# run tests on all workspace members with default feature list
110110
cargo test
111-
112-
# Switch to arrow crate
113-
cd arrow
114-
# re-run tests on arrow crate to ensure
115-
# all arrays are created correctly
116-
cargo test --features=force_validate
117-
cargo test --features=prettyprint
118-
# run test on arrow crate with minimal set of features
119-
cargo test --no-default-features
111+
112+
# re-run tests on arrow crate with all supported features
113+
cargo test -p arrow --features=force_validate,prettyprint
114+
115+
# Test arrow examples
120116
cargo run --example builders
121117
cargo run --example dynamic_types
122118
cargo run --example read_csv
123119
cargo run --example read_csv_infer_schema
124-
cargo check --no-default-features
120+
121+
# Test compilation of arrow library crate with different feature combinations
122+
cargo check -p arrow
123+
cargo check -p arrow --no-default-features
124+
125+
# Test compilation of arrow targets with different feature combinations
126+
cargo check -p arrow --all-targets
127+
cargo check -p arrow --no-default-features --all-targets
125128
126-
# Switch to parquet crate
127-
cd ../parquet
128-
# re-run tests on parquet crate with async feature enabled
129-
cargo test --features=async
130-
cargo check --no-default-features
129+
# re-run tests on arrow-flight with all features
130+
cargo test -p arrow-flight --all-features
131131
132-
# Switch to arrow-flight
133-
cd ../arrow-flight
134-
cargo test --features=flight-sql-experimental
135-
cargo check --no-default-features
132+
# re-run tests on parquet crate with all features
133+
cargo test -p parquet --all-features
134+
135+
# Test compilation of parquet library crate with different feature combinations
136+
cargo check -p parquet
137+
cargo check -p parquet --no-default-features
138+
cargo check -p parquet --no-default-features --features arrow
139+
140+
# Test compilation of parquet targets with different feature combinations
141+
cargo check -p parquet --all-targets
142+
cargo check -p parquet --no-default-features --all-targets
143+
cargo check -p parquet --no-default-features --features arrow --all-targets
144+
145+
# Test compilation of parquet_derive macro with different feature combinations
146+
cargo check -p parquet_derive
136147
137148
# test the --features "simd" of the arrow crate. This requires nightly.
138149
linux-test-simd:
@@ -173,12 +184,12 @@ jobs:
173184
export CARGO_TARGET_DIR="/github/home/target"
174185
cd arrow
175186
cargo test --features "simd"
176-
- name: Check new project build with simd features
187+
- name: Check compilation with simd features
177188
run: |
178189
export CARGO_HOME="/github/home/.cargo"
179190
export CARGO_TARGET_DIR="/github/home/target"
180-
cd arrow/test/dependency/simd
181-
cargo check
191+
cargo check -p arrow --features simd
192+
cargo check -p arrow --features simd --all-targets
182193
183194
windows-and-macos:
184195
name: Test on ${{ matrix.os }} Rust ${{ matrix.rust }}
@@ -435,54 +446,3 @@ jobs:
435446
export CARGO_TARGET_DIR="/github/home/target"
436447
export RUSTDOCFLAGS="-Dwarnings"
437448
cargo doc --document-private-items --no-deps --workspace --all-features
438-
439-
440-
# test builds with various feature flag combinations outside the main workspace
441-
default-build:
442-
name: Feature Flag Builds ${{ matrix.rust }}
443-
runs-on: ubuntu-latest
444-
strategy:
445-
matrix:
446-
arch: [amd64]
447-
rust: [stable]
448-
container:
449-
image: ${{ matrix.arch }}/rust
450-
env:
451-
# Disable debug symbol generation to speed up CI build and keep memory down
452-
RUSTFLAGS: "-C debuginfo=0"
453-
steps:
454-
- uses: actions/checkout@v2
455-
- name: Cache Cargo
456-
uses: actions/cache@v3
457-
with:
458-
path: /github/home/.cargo
459-
# this key equals the ones on `linux-build-lib` for re-use
460-
key: cargo-cache3-
461-
- name: Cache Rust dependencies
462-
uses: actions/cache@v3
463-
with:
464-
path: /github/home/target
465-
# this key equals the ones on `linux-build-lib` for re-use
466-
key: ${{ runner.os }}-${{ matrix.arch }}-target-cache3-${{ matrix.rust }}
467-
- name: Setup Rust toolchain
468-
uses: ./.github/actions/setup-builder
469-
with:
470-
rust-version: ${{ matrix.rust }}
471-
- name: Arrow Build with default features
472-
run: |
473-
export CARGO_HOME="/github/home/.cargo"
474-
export CARGO_TARGET_DIR="/github/home/target"
475-
cd arrow/test/dependency/default-features
476-
cargo check
477-
- name: Arrow Build with default-features=false
478-
run: |
479-
export CARGO_HOME="/github/home/.cargo"
480-
export CARGO_TARGET_DIR="/github/home/target"
481-
cd arrow/test/dependency/no-default-features
482-
cargo check
483-
- name: Parquet Derive build with default-features
484-
run: |
485-
export CARGO_HOME="/github/home/.cargo"
486-
export CARGO_TARGET_DIR="/github/home/target"
487-
cd parquet_derive/test/dependency/default-features
488-
cargo check

Cargo.toml

+1
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@ members = [
2424
"arrow-flight",
2525
"integration-testing",
2626
]
27+
resolver = "2"
2728

2829
# this package is excluded because it requires different compilation flags, thereby significantly changing
2930
# how it is compiled within the workspace, causing the whole workspace to be compiled from scratch

arrow/test/dependency/README.md

-21
This file was deleted.

arrow/test/dependency/default-features/Cargo.toml

-30
This file was deleted.

arrow/test/dependency/default-features/src/main.rs

-3
This file was deleted.

arrow/test/dependency/no-default-features/Cargo.toml

-30
This file was deleted.

arrow/test/dependency/no-default-features/src/main.rs

-3
This file was deleted.

arrow/test/dependency/simd/Cargo.toml

-30
This file was deleted.

arrow/test/dependency/simd/src/main.rs

-3
This file was deleted.

parquet/Cargo.toml

+12-5
Original file line numberDiff line numberDiff line change
@@ -39,38 +39,44 @@ brotli = { version = "3.3", optional = true }
3939
flate2 = { version = "1.0", optional = true }
4040
lz4 = { version = "1.23", optional = true }
4141
zstd = { version = "0.11.1", optional = true, default-features = false }
42-
chrono = { version = "0.4", default-features = false }
42+
chrono = { version = "0.4", default-features = false, features = ["alloc"] }
4343
num = "0.4"
4444
num-bigint = "0.4"
4545
arrow = { path = "../arrow", version = "15.0.0", optional = true, default-features = false, features = ["ipc"] }
4646
base64 = { version = "0.13", optional = true }
4747
clap = { version = "3", optional = true, features = ["derive", "env"] }
48-
serde_json = { version = "1.0", features = ["preserve_order"], optional = true }
48+
serde_json = { version = "1.0", optional = true }
4949
rand = "0.8"
5050
futures = { version = "0.3", optional = true }
5151
tokio = { version = "1.0", optional = true, default-features = false, features = ["macros", "fs", "rt", "io-util"] }
5252

5353
[dev-dependencies]
54+
base64 = "0.13"
5455
criterion = "0.3"
5556
rand = "0.8"
5657
snap = "1.0"
5758
tempfile = "3.0"
5859
brotli = "3.3"
5960
flate2 = "1.0"
6061
lz4 = "1.23"
62+
zstd = "0.11"
6163
serde_json = { version = "1.0", features = ["preserve_order"] }
62-
arrow = { path = "../arrow", version = "15.0.0", default-features = false, features = ["test_utils", "prettyprint"] }
64+
arrow = { path = "../arrow", version = "15.0.0", default-features = false, features = ["ipc", "test_utils", "prettyprint"] }
6365

6466
[package.metadata.docs.rs]
6567
all-features = true
6668

6769
[features]
6870
default = ["arrow", "snap", "brotli", "flate2", "lz4", "zstd", "base64"]
71+
# Enable arrow reader/writer APIs
72+
arrow = ["dep:arrow", "base64"]
73+
# Enable CLI tools
6974
cli = ["serde_json", "base64", "clap"]
75+
# Enable internal testing APIs
7076
test_common = []
7177
# Experimental, unstable functionality primarily used for testing
7278
experimental = []
73-
# Enable async API
79+
# Enable async APIs
7480
async = ["futures", "tokio"]
7581

7682
[[bin]]
@@ -87,11 +93,12 @@ required-features = ["cli"]
8793

8894
[[bench]]
8995
name = "arrow_writer"
96+
required-features = ["arrow"]
9097
harness = false
9198

9299
[[bench]]
93100
name = "arrow_reader"
94-
required-features = ["test_common", "experimental"]
101+
required-features = ["arrow", "test_common", "experimental"]
95102
harness = false
96103

97104
[lib]

parquet/README.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ See [crate documentation](https://docs.rs/parquet/latest/parquet/) for examples
2727

2828
## Rust Version Compatbility
2929

30-
This crate is tested with the latest stable version of Rust. We do not currrently test against other, older versions of the Rust compiler.
30+
This crate is tested with the latest stable version of Rust. We do not currently test against other, older versions of the Rust compiler.
3131

3232
## Features
3333

parquet/src/errors.rs

+3-2
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717

1818
//! Common Parquet errors and macros.
1919
20-
use std::{cell, convert, io, result, str};
20+
use std::{cell, io, result, str};
2121

2222
#[cfg(any(feature = "arrow", test))]
2323
use arrow::error::ArrowError;
@@ -108,7 +108,7 @@ pub type Result<T> = result::Result<T, ParquetError>;
108108
// ----------------------------------------------------------------------
109109
// Conversion from `ParquetError` to other types of `Error`s
110110

111-
impl convert::From<ParquetError> for io::Error {
111+
impl From<ParquetError> for io::Error {
112112
fn from(e: ParquetError) -> Self {
113113
io::Error::new(io::ErrorKind::Other, e)
114114
}
@@ -135,6 +135,7 @@ macro_rules! eof_err {
135135
($fmt:expr, $($args:expr),*) => (ParquetError::EOF(format!($fmt, $($args),*)));
136136
}
137137

138+
#[cfg(any(feature = "arrow", test))]
138139
macro_rules! arrow_err {
139140
($fmt:expr) => (ParquetError::ArrowError($fmt.to_owned()));
140141
($fmt:expr, $($args:expr),*) => (ParquetError::ArrowError(format!($fmt, $($args),*)));

0 commit comments

Comments
 (0)