@@ -304,76 +304,41 @@ pub async fn execute(args: &RunArgs) -> anyhow::Result<()> {
304304 let run_id = uuid:: Uuid :: new_v4 ( ) ;
305305 let scenario_name = args. scenario . to_string ( ) ;
306306
307- let mut setup_metadata: HashMap < String , serde_json:: Value > = HashMap :: from ( [
308- (
309- "executor_instance_type" . to_string ( ) ,
310- serde_json:: Value :: String ( args. executor_instance_type . clone ( ) ) ,
311- ) ,
312- (
313- "table_format" . to_string ( ) ,
314- serde_json:: Value :: String ( args. table_format . to_string ( ) ) ,
315- ) ,
316- (
317- "scenario" . to_string ( ) ,
318- serde_json:: Value :: String ( scenario_name. clone ( ) ) ,
319- ) ,
320- (
321- "etl_bucket" . to_string ( ) ,
322- serde_json:: Value :: String ( args. etl_bucket . clone ( ) ) ,
323- ) ,
324- (
325- "etl_prefix" . to_string ( ) ,
326- serde_json:: Value :: String ( args. etl_prefix . clone ( ) ) ,
327- ) ,
328- (
329- "etl_version" . to_string ( ) ,
330- serde_json:: Value :: String ( derived_version. clone ( ) ) ,
331- ) ,
332- (
333- "etl_region" . to_string ( ) ,
334- args. etl_region
335- . as_ref ( )
336- . map_or ( serde_json:: Value :: Null , |v| {
337- serde_json:: Value :: String ( v. clone ( ) )
338- } ) ,
339- ) ,
340- (
341- "etl_endpoint" . to_string ( ) ,
342- args. etl_endpoint
343- . as_ref ( )
344- . map_or ( serde_json:: Value :: Null , |v| {
345- serde_json:: Value :: String ( v. clone ( ) )
346- } ) ,
347- ) ,
348- (
349- "etl_sink" . to_string ( ) ,
350- serde_json:: Value :: String ( "adbc" . to_string ( ) ) ,
351- ) ,
352- (
353- "etl_type" . to_string ( ) ,
354- serde_json:: Value :: String ( version_metadata. etl_type ( ) . to_string ( ) ) ,
355- ) ,
356- ] ) ;
307+ let serde_json:: Value :: Object ( setup_map) = serde_json:: json!( {
308+ "executor_instance_type" : args. executor_instance_type,
309+ "table_format" : args. table_format. to_string( ) ,
310+ "scenario" : scenario_name,
311+ "etl_bucket" : args. etl_bucket,
312+ "etl_prefix" : args. etl_prefix,
313+ "etl_version" : derived_version,
314+ "etl_region" : args. etl_region,
315+ "etl_endpoint" : args. etl_endpoint,
316+ "etl_sink" : "adbc" ,
317+ "etl_type" : version_metadata. etl_type( ) . to_string( ) ,
318+ } ) else {
319+ unreachable ! ( )
320+ } ;
321+ let mut setup_metadata: HashMap < String , serde_json:: Value > = setup_map. into_iter ( ) . collect ( ) ;
357322
358323 if let Ok ( system_under_test) = std:: env:: var ( "SYSTEM_UNDER_TEST" ) {
359324 setup_metadata. insert (
360325 "system_under_test" . to_string ( ) ,
361- serde_json:: Value :: String ( system_under_test. clone ( ) ) ,
326+ serde_json:: json! ( system_under_test) ,
362327 ) ;
363328
364329 if let Some ( ( prefix, variant) ) = system_under_test. split_once ( '-' ) {
365330 setup_metadata. insert (
366331 "system_adapter_prefix" . to_string ( ) ,
367- serde_json:: Value :: String ( prefix. to_string ( ) ) ,
332+ serde_json:: json! ( prefix) ,
368333 ) ;
369334 setup_metadata. insert (
370335 "system_adapter_variant" . to_string ( ) ,
371- serde_json:: Value :: String ( variant. to_string ( ) ) ,
336+ serde_json:: json! ( variant) ,
372337 ) ;
373338 } else {
374339 setup_metadata. insert (
375340 "system_adapter_prefix" . to_string ( ) ,
376- serde_json:: Value :: String ( system_under_test) ,
341+ serde_json:: json! ( system_under_test) ,
377342 ) ;
378343 }
379344 }
0 commit comments