@@ -396,93 +396,4 @@ describe("Task Runs V2", () => {
396396 ) ;
397397 }
398398 ) ;
399-
400- clickhouseTest (
401- "should be able to insert task runs with invalid output" ,
402- async ( { clickhouseContainer } ) => {
403- const client = new ClickhouseClient ( {
404- name : "test" ,
405- url : clickhouseContainer . getConnectionUrl ( ) ,
406- logLevel : "debug" ,
407- } ) ;
408-
409- const insert = insertTaskRuns ( client , {
410- async_insert : 0 , // turn off async insert for this test
411- } ) ;
412-
413- const output = await readFile ( `${ __dirname } /fixtures/bad-clickhouse-output.json` , "utf-8" ) ;
414-
415- const [ insertError , insertResult ] = await insert ( [
416- {
417- environment_id : "env_1234" ,
418- environment_type : "DEVELOPMENT" ,
419- organization_id : "org_1234" ,
420- project_id : "project_1234" ,
421- run_id : "run_1234" ,
422- friendly_id : "friendly_1234" ,
423- attempt : 1 ,
424- engine : "V2" ,
425- status : "PENDING" ,
426- task_identifier : "my-task" ,
427- queue : "my-queue" ,
428- schedule_id : "schedule_1234" ,
429- batch_id : "batch_1234" ,
430- created_at : Date . now ( ) ,
431- updated_at : Date . now ( ) ,
432- completed_at : undefined ,
433- tags : [ "tag1" , "tag2" ] ,
434- output : JSON . parse ( output ) ,
435- error : {
436- type : "BUILT_IN_ERROR" ,
437- name : "Error" ,
438- message : "error" ,
439- stackTrace : "stack trace" ,
440- } ,
441- usage_duration_ms : 1000 ,
442- cost_in_cents : 100 ,
443- task_version : "1.0.0" ,
444- sdk_version : "1.0.0" ,
445- cli_version : "1.0.0" ,
446- machine_preset : "small-1x" ,
447- is_test : true ,
448- span_id : "span_1234" ,
449- trace_id : "trace_1234" ,
450- idempotency_key : "idempotency_key_1234" ,
451- expiration_ttl : "1h" ,
452- root_run_id : "root_run_1234" ,
453- parent_run_id : "parent_run_1234" ,
454- depth : 1 ,
455- _version : "1" ,
456- } ,
457- ] ) ;
458-
459- expect ( insertError ) . toBeNull ( ) ;
460- expect ( insertResult ) . toEqual ( expect . objectContaining ( { executed : true } ) ) ;
461- expect ( insertResult ?. summary ?. written_rows ) . toEqual ( "1" ) ;
462-
463- const query = client . query ( {
464- name : "query-task-runs" ,
465- query : "SELECT * FROM trigger_dev.task_runs_v2" ,
466- schema : z . object ( {
467- environment_id : z . string ( ) ,
468- run_id : z . string ( ) ,
469- } ) ,
470- params : z . object ( {
471- run_id : z . string ( ) ,
472- } ) ,
473- } ) ;
474-
475- const [ queryError , result ] = await query ( { run_id : "run_1234" } ) ;
476-
477- expect ( queryError ) . toBeNull ( ) ;
478- expect ( result ) . toEqual (
479- expect . arrayContaining ( [
480- expect . objectContaining ( {
481- environment_id : "env_1234" ,
482- run_id : "run_1234" ,
483- } ) ,
484- ] )
485- ) ;
486- }
487- ) ;
488399} ) ;
0 commit comments