File tree Expand file tree Collapse file tree 2 files changed +19
-13
lines changed
apps/app/src/jobs/tasks/integration Expand file tree Collapse file tree 2 files changed +19
-13
lines changed Original file line number Diff line number Diff line change @@ -135,10 +135,7 @@ export const sendIntegrationResults = schemaTask({
135135 logger . error ( `Failed to create error record: ${ createError } ` ) ;
136136 }
137137
138- return {
139- success : false ,
140- error : error instanceof Error ? error . message : String ( error ) ,
141- } ;
138+ throw error ;
142139 }
143140 } ,
144141} ) ;
Original file line number Diff line number Diff line change @@ -57,9 +57,24 @@ export const runIntegrationTests = task({
5757
5858 try {
5959 const batchHandle = await sendIntegrationResults . batchTriggerAndWait ( batchItems ) ;
60-
60+
61+ // Check if any child runs failed
62+ const failedRuns = batchHandle . runs . filter ( ( run ) => ! run . ok ) ;
63+
64+ if ( failedRuns . length > 0 ) {
65+ const errorMessages = failedRuns
66+ . map ( ( run ) => {
67+ const errorMsg = run . error instanceof Error ? run . error . message : String ( run . error ) ;
68+ return errorMsg ;
69+ } )
70+ . join ( '; ' ) ;
71+
72+ logger . error ( `Integration tests failed for organization ${ organizationId } : ${ errorMessages } ` ) ;
73+ throw new Error ( errorMessages ) ;
74+ }
75+
6176 logger . info ( `Successfully completed batch integration tests for organization: ${ organizationId } ` ) ;
62-
77+
6378 return {
6479 success : true ,
6580 organizationId,
@@ -68,13 +83,7 @@ export const runIntegrationTests = task({
6883 } ;
6984 } catch ( error ) {
7085 logger . error ( `Failed to run integration tests for organization ${ organizationId } : ${ error } ` ) ;
71-
72- return {
73- success : false ,
74- error : error instanceof Error ? error . message : String ( error ) ,
75- organizationId,
76- integrationsCount : integrations . length ,
77- } ;
86+ throw error ;
7887 }
7988 } ,
8089} ) ;
You can’t perform that action at this time.
0 commit comments