File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 2222 run : make test-iceberg-rust
2323 - name : Run datafusion-iceberg tests
2424 run : make test-datafusion_iceberg
25+ - name : Run iceberg-rest-catalog tests
26+ run : make test-rest-catalog
27+ - name : Run iceberg-file-catalog tests
28+ run : make test-file-catalog
29+ - name : Run iceberg-sql-catalog tests
30+ run : make test-sql-catalog
2531
2632 lint :
2733 runs-on : ubuntu-latest
Original file line number Diff line number Diff line change @@ -7,7 +7,15 @@ test-iceberg-rust:
77 cargo test -p iceberg-rust --lib
88
99test-datafusion_iceberg :
10- cargo test -p datafusion_iceberg --tests -j 2
10+ cargo test -p datafusion_iceberg --tests -j 2 && cargo clean -p datafusion_iceberg
1111
12+ test-rest-catalog :
13+ cargo test -p iceberg-rest-catalog --lib && cargo clean -p iceberg-rest-catalog
14+
15+ test-file-catalog :
16+ cargo test -p iceberg-file-catalog --lib && cargo clean -p iceberg-file-catalog
17+
18+ test-sql-catalog :
19+ cargo test -p iceberg-sql-catalog --lib && cargo clean -p iceberg-sql-catalog
1220clippy :
1321 cargo clippy --all-targets --all-features -- -D warnings
Original file line number Diff line number Diff line change @@ -215,7 +215,8 @@ impl Catalog for RestCatalog {
215215 . await
216216 } )
217217 . await
218- . map_err ( Into :: < Error > :: into) {
218+ . map_err ( Into :: < Error > :: into)
219+ {
219220 Ok ( _) => Ok ( true ) ,
220221 Err ( Error :: NotFound ( _) ) => Ok ( false ) ,
221222 Err ( e) => Err ( e) ,
@@ -613,7 +614,7 @@ pub mod tests {
613614 . await
614615 . unwrap ( ) ;
615616
616- localstack
617+ let command = localstack
617618 . exec ( ExecCommand :: new ( vec ! [
618619 "awslocal" ,
619620 "s3api" ,
@@ -624,6 +625,10 @@ pub mod tests {
624625 . await
625626 . unwrap ( ) ;
626627
628+ while command. exit_code ( ) . await . unwrap ( ) . is_none ( ) {
629+ sleep ( Duration :: from_millis ( 100 ) ) . await ;
630+ }
631+
627632 let localstack_host = localstack. get_host ( ) . await . unwrap ( ) ;
628633 let localstack_port = localstack. get_host_port_ipv4 ( 4566 ) . await . unwrap ( ) ;
629634
Original file line number Diff line number Diff line change 11use iceberg_rust:: error:: Error ;
2+ use reqwest:: StatusCode ;
23
3- use crate :: apis:: { self , catalog_api_api:: CreateNamespaceError } ;
4+ use crate :: apis:: { self , catalog_api_api:: CreateNamespaceError , ResponseContent } ;
45
56/**
67Error conversion
@@ -11,6 +12,11 @@ impl<T> From<apis::Error<T>> for Error {
1112 apis:: Error :: Reqwest ( err) => Error :: InvalidFormat ( err. to_string ( ) ) ,
1213 apis:: Error :: Serde ( err) => Error :: JSONSerde ( err) ,
1314 apis:: Error :: Io ( err) => Error :: IO ( err) ,
15+ apis:: Error :: ResponseError ( ResponseContent {
16+ status : StatusCode :: NOT_FOUND ,
17+ content,
18+ entity : _,
19+ } ) => Error :: NotFound ( content) ,
1420 apis:: Error :: ResponseError ( err) => Error :: InvalidFormat ( format ! (
1521 "Response status: {}, Response content: {}" ,
1622 err. status, err. content
Original file line number Diff line number Diff line change @@ -760,6 +760,10 @@ pub mod tests {
760760 . await
761761 . unwrap ( ) ;
762762
763+ while command. exit_code ( ) . await . unwrap ( ) . is_none ( ) {
764+ sleep ( Duration :: from_millis ( 100 ) ) . await ;
765+ }
766+
763767 let postgres = Postgres :: default ( )
764768 . with_db_name ( "postgres" )
765769 . with_user ( "postgres" )
Original file line number Diff line number Diff line change @@ -25,6 +25,7 @@ use testcontainers::{
2525 GenericImage , ImageExt ,
2626} ;
2727use testcontainers_modules:: localstack:: LocalStack ;
28+ use tokio:: time:: sleep;
2829
2930fn configuration ( host : & str , port : u16 ) -> Configuration {
3031 Configuration {
@@ -77,7 +78,7 @@ async fn integration_trino_rest() {
7778 . await
7879 . unwrap ( ) ;
7980
80- localstack
81+ let command = localstack
8182 . exec ( ExecCommand :: new ( vec ! [
8283 "awslocal" ,
8384 "s3api" ,
@@ -88,6 +89,10 @@ async fn integration_trino_rest() {
8889 . await
8990 . unwrap ( ) ;
9091
92+ while command. exit_code ( ) . await . unwrap ( ) . is_none ( ) {
93+ sleep ( Duration :: from_millis ( 100 ) ) . await ;
94+ }
95+
9196 let localstack_host = localstack. get_host ( ) . await . unwrap ( ) ;
9297 let localstack_port = localstack. get_host_port_ipv4 ( 4566 ) . await . unwrap ( ) ;
9398
You can’t perform that action at this time.
0 commit comments