()
| 74 | |
| 75 | #[tokio::test] |
| 76 | pub async fn test_execute_ingest() { |
| 77 | let test_server = FlightSqlServiceImpl::new(); |
| 78 | let fixture = TestFixture::new(test_server.service()).await; |
| 79 | let channel = fixture.channel().await; |
| 80 | let mut flight_sql_client = FlightSqlServiceClient::new(channel); |
| 81 | let cmd = make_ingest_command(); |
| 82 | let expected_rows = 10; |
| 83 | let batches = vec![ |
| 84 | make_primitive_batch(5), |
| 85 | make_primitive_batch(3), |
| 86 | make_primitive_batch(2), |
| 87 | ]; |
| 88 | let actual_rows = flight_sql_client |
| 89 | .execute_ingest(cmd, futures::stream::iter(batches.clone()).map(Ok)) |
| 90 | .await |
| 91 | .expect("ingest should succeed"); |
| 92 | assert_eq!(actual_rows, expected_rows); |
| 93 | // make sure the batches made it through to the server |
| 94 | let ingested_batches = test_server.ingested_batches.lock().await.clone(); |
| 95 | assert_eq!(ingested_batches, batches); |
| 96 | } |
| 97 | |
| 98 | #[tokio::test] |
| 99 | pub async fn test_execute_ingest_error() { |
nothing calls this directly
no test coverage detected