@@ -47,43 +47,14 @@ mod tests {
4747 use super :: * ;
4848 use crate :: arrow:: array:: { StringArray , StructArray } ;
4949 use crate :: engine:: arrow_data:: EngineDataArrowExt as _;
50- use crate :: engine:: default:: executor:: tokio:: TokioBackgroundExecutor ;
51- use crate :: engine:: default:: DefaultEngine ;
5250 use crate :: scan:: COMMIT_READ_SCHEMA ;
53- use crate :: { Error , Snapshot , SnapshotRef } ;
51+ use crate :: utils :: test_utils :: load_extracted_test_table ;
5452 use itertools:: Itertools ;
55- use object_store:: local:: LocalFileSystem ;
56- use std:: path:: PathBuf ;
5753 use std:: sync:: Arc ;
58- use url:: Url ;
59-
60- fn load_test_table (
61- table_name : & str ,
62- ) -> DeltaResult < (
63- Arc < DefaultEngine < TokioBackgroundExecutor > > ,
64- SnapshotRef ,
65- url:: Url ,
66- ) > {
67- let mut path = PathBuf :: from ( env ! ( "CARGO_MANIFEST_DIR" ) ) ;
68- path. push ( "tests/data" ) ;
69- path. push ( table_name) ;
70-
71- let path = std:: fs:: canonicalize ( path)
72- . map_err ( |e| Error :: Generic ( format ! ( "Failed to canonicalize path: {}" , e) ) ) ?;
73-
74- let url = Url :: from_directory_path ( path)
75- . map_err ( |_| Error :: Generic ( "Failed to create URL from path" . to_string ( ) ) ) ?;
76-
77- let store = Arc :: new ( LocalFileSystem :: new ( ) ) ;
78- let engine = Arc :: new ( DefaultEngine :: new ( store) ) ;
79- let snapshot = Snapshot :: builder_for ( url. clone ( ) ) . build ( engine. as_ref ( ) ) ?;
80-
81- Ok ( ( engine, snapshot, url) )
82- }
8354
8455 #[ test]
8556 fn test_commit_phase_processes_commits ( ) -> Result < ( ) , Box < dyn std:: error:: Error > > {
86- let ( engine, snapshot, _url ) = load_test_table ( "app-txn-no-checkpoint" ) ?;
57+ let ( engine, snapshot) = load_extracted_test_table ( env ! ( "CARGO_MANIFEST_DIR" ) , "app-txn-no-checkpoint" ) ?;
8758 let log_segment = Arc :: new ( snapshot. log_segment ( ) . clone ( ) ) ;
8859
8960 let schema = COMMIT_READ_SCHEMA . clone ( ) ;
0 commit comments