milenkovicm commented on code in PR #1541: URL: https://github.com/apache/datafusion-ballista/pull/1541#discussion_r3035643171
########## ballista/riffle/tests/integration_test.rs: ########## @@ -0,0 +1,221 @@ +// 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. + +//! Integration test for the Riffle client against a local Riffle cluster. +//! +//! Requires a running Riffle cluster: +//! - Uniffle coordinator on localhost:21000 +//! - Riffle shuffle server on localhost:21100 +//! +//! Run with: cargo test -p ballista-riffle --test integration_test + +use ballista_riffle::client::RiffleClient; +use ballista_riffle::config::RiffleConfig; +use ballista_riffle::serde::{ipc_bytes_to_record_batches, record_batches_to_ipc_bytes}; + +use arrow::array::{Int32Array, StringArray}; +use arrow::datatypes::{DataType, Field, Schema}; +use arrow::record_batch::RecordBatch; +use std::sync::Arc; + +fn test_schema() -> Arc<Schema> { + Arc::new(Schema::new(vec![ + Field::new("id", DataType::Int32, false), + Field::new("name", DataType::Utf8, false), + ])) +} + +fn test_batches(schema: &Arc<Schema>) -> Vec<RecordBatch> { + vec![ + RecordBatch::try_new( + schema.clone(), + vec![ + Arc::new(Int32Array::from(vec![1, 2, 3])), + Arc::new(StringArray::from(vec!["alice", "bob", "carol"])), + ], + ) + .unwrap(), + RecordBatch::try_new( + schema.clone(), + vec![ + Arc::new(Int32Array::from(vec![4, 5])), + Arc::new(StringArray::from(vec!["dave", "eve"])), + ], + ) + .unwrap(), + ] +} + +#[tokio::test] +#[ignore = "requires a running Riffle cluster (coordinator on localhost:21000, server on localhost:21100)"] Review Comment: I would suggest to use test container for this, have a look at the example https://github.com/milenkovicm/datafusion-ballista/blob/master/examples/tests/object_store.rs -- 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]
